Advertisement

Additive Blending Problem

Started by May 23, 2017 11:08 PM
12 comments, last by _WeirdCat_ 7 years, 8 months ago

Another reason may be that clears are affected by the current write masks; if you have glColorMask (0, 0, 0, 0) when you clear, the color buffer will not be cleared! This will result in multiple frames work accumulating in the manner described by the OP.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I never worked out why GL.BlendFunc(BlendingFactorSrc.One, BlendingFactorDest.One); was giving me the results I got but I have worked around it.

I used GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.SrcAlpha); instead and manually set my alphas to 1.0f in the particles. This results in a 1 in the destination after a particle is written and then any source particles thereafter are also 1.0f, which is what I wanted in the first place, I do not understand why the result is different though. Perhaps I'm not understanding what GL_ONE is supposed to do or perhaps OpenTK is passing the wrong enums, but I'm just guessing. Hopefully this helps someone else if they get stuck though.

Thanks for all of the suggestions, helped me work though an alternative method.

Advertisement

Glad it worked out! I'm not surprised by this at all with OpenTK. I've seen similar bizarre behavior.

Once again http://www.andersriggelsen.dk/glblendfunc.php
and set alpha to 1

This topic is closed to new replies.

Advertisement