Blending Modes

Hi, I was wondering if anyone knows if it’s possible to reproduce some of Photoshop’s blending modes in OpenGL.

I’m particularly interested in the vivid light (additive) blending mode. I’m currently using GL_SRC_ALPHA, GL_ONE for additive blending but it’s not nearly as good looking as photoshop’s vivid light.

This is very annoying as I use vivid light a lot in Photoshop, and the end result is very different in opengl, thus I can’t really use it.


You are wrong, vivid light is not a simple addition.

From here you get the exact formula :

It looks hard to do without a fragment shader… not that hard but it is a bit more involved.
See for example :

Someone else also asked something similar:;f=3;t=015326

I was kind of afraid that it wouldn’t be that simple… I tried to find an article that describes the equations but couldn’t find a one.

Unfortunately I can’t use shaders as I want to keep compatibility around opengl 1.1 - 1.3.

Also, I can ignore performance (at least for now), as I mainly want to generate textures by tinting them with a vivid light overlay.

Have I understood it right, that I need to use glReadPixels to achieve this, if I do not use shaders? So shaders would give me just performance?

Thanks a lot for the links, I’m sure I can figure it out with those eventually.