Page 1 of 1

Additional blend operations apart from ADD

Posted: Thu Dec 25, 2008 3:43 pm
by ddungum
According to Pass::setSceneBlending doc :


...The result of the blending operation is: final = (texture * sourceFactor) + (pixel * destFactor)


Currently, we can set 'sourceFactor' and 'destFactor' parts with Pass::setSceneBlending(), but we can't replace '+' part with other operations.


Already Direct3D9 (via D3DRS_BLENDOP render state) and OpenGL (via glBlendEquation from version 1.2) have some additional blend operations like this :

- Direct3D : D3DBLENDOP_ADD, D3DBLENDOP_SUBTRACT, D3DBLENDOP_REVSUBTRACT, D3DBLENDOP_MIN, D3DBLENDOP_MAX
- OpenGL : GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN, GL_MAX

And even my motherboard-integrated graphic chip supports them !!


I hope these features are integrated into Ogre soon (I think the implementation is very trivial).

Re: Additional blend operations apart from ADD

Posted: Thu Dec 25, 2008 3:56 pm
by Praetor
This feature is currently implemented in 1.7, so you can get it from SVN. In your material scripts you can change the operation using "scene_blend_op [add][subtract][reverse_subtract][min][max]". Merry christmas!

Re: Additional blend operations apart from ADD

Posted: Thu Dec 25, 2008 4:31 pm
by ddungum
Wow, I didn't know that, Praetor. Thanks for the quick reply. It's really like a Christmas present to me. :D
I'll check the SVN version right now. Merry Christmas !!