Blending question

Hi all,

Was wondering if it’s possible to replicate the blending functions found in photoshop and other graphics software with gl blend funcs?

I can see that I can replicate(or approximate?) only a couple, like ‘screen’ for example with:

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR)

note that I’m not certain if this is actually doing the screen function but it looks close to me…are the more complex blend funcs done in multiple passes? if anyone could point me in the right direction it would be much appreciated…

some of the blend functions…

screen overlay darken lighten colorDodge colorBurn softLight darkLight…etc…

thanks!

This page details the formulas behind each of these “classic” types:
http://www.simpelfilter.de/en/grundlagen/mixmods.html

Searching for “photoshop” on this forums returns :
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Board=3&Number=113924
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Board=2&Number=101350

The opengl blending mode and its extensions can already perform most useful combinations, off the top of my head : normal blend, add, substract, are easy.
Then for the others it would be better to use a shader that blends between two textures, in which you can code whatever fancy you want.
The risk with doing multipass is that you will loose in color precision unless you can have floating point render buffer (and it will be probably slower anyway).

Thanks for those links they were very helpful!