there’s a great page with some c code for the blend modes in photoshop. What I want is to use some of these modes in my XNA application. In particular, overlay, hue and saturation. Do you think it is possible with just the XNA blend functions and blend enum or I will need to create a shader for these effects?
Here’s the link for the photoshop blend modes math : http://www.nathanm.com/photoshop-blending-math/
First of all, here is a question that covers much of the same territory.
The problem is that the blend stage in a modern GPU is still very limited and fixed-function. You have these functions to choose from: add, subtract, max, min, and you have a few multipliers.
I’m pretty sure the blend modes you want to use cannot be implemented within this system. Overlay requires a conditional which probably cannot be worked around, and Hue and Saturation require a HSV conversion which cannot be done at all.
So the answer is – as you say – to create a shader that takes two textures as inputs and combines them using your custom blending mode. If you want to apply this effect on top of an entire scene, you will want to use render targets to render your scene to a texture that can be used as input to your shader.