mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.81k stars 440 forks source link

TextureTools::DistanceField doesn't work with blending enabled #472

Open cheezeygeek opened 4 years ago

cheezeygeek commented 4 years ago

Pretty much what the title says: if you call TextureTools::DistanceField::operator(), the resulting texture will not have the expected contents if blending is enabled in the renderer. In my experience, the texture was just a very dark solid color. Turning blending off fixed the problem. I think this should be a pretty simple fix, but I could be wrong.

mosra commented 4 years ago

Haha, thanks for reminding me of this one.

Handling this particular case is a simple fix, yes, but I wanted to tackle it in a more generic way that avoids all renderer state leaks (what if scissor stays enabled as well? it'll break too), mitigating the inherent problem of GL's global state. And that's why it's still an unfixed known issue.

I'm currently working on a Vulkan backend and I plan to reuse the gained knowledge on designing a better abstraction for scoped GL renderer state changes.