Fix using RenderTargets on a texture that has mipmaps.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 5m40s

Also better mipmap generation.
This commit is contained in:
2024-10-10 13:10:04 -04:00
parent e155d272bb
commit 39c7c7ac0d
4 changed files with 40 additions and 50 deletions

View File

@@ -35,8 +35,9 @@ public:
/// @param new_size new size in px.
void Resize(const Vector2& new_size);
void SetMSAAEnabled(MSAA_SAMPLE_RATE sample_rate);
/// Blits the MSAA FBO onto the regular FBO if MSAA is enabled.
/// Does nothing is MSAA is not enabled or if the color attachment is a texture not created by the RenderTarget.
/// If you're using raw OpenGL commands to draw to this outside of J2D or J3D don't forget to do this.
/// Blits the MSAA FBO onto the regular FBO if MSAA is enabled and or If you're rendering to a texture which uses mipmaps,
/// It regenerates them so what you drew doesn't disappear at a distance. Otherwise it does nothing.
void Blit() const;
[[nodiscard]] bool TextureCreatedByRenderTarget() const;
public: