I'm currently doing some research on OpenGL and Shaders but I can't seem to figure out if there are any fundamental differences between blending using the glBlendMode
or writing your own blend modes in a shader.
What are the reasons to choose the former or the latter? Are there any performance bottlenecks by choosing the one over the other? Or is this just a matter of personal preference?
Traditional blending with glBlendFunc can't be replicated in a shader. Blending requires sampling the destination framebuffer before modifying it, which isn't something that can be done on current hardware.
Currently you can only pass along a color, and choose one of a limited selection of blending modes (glBlendFunc/glBlendEquation) which will be applied by the GPU's rasterizer before writing to framebuffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With