Posted By: MatAllum
Subtractive blending - 01/30/15 03:37
I've found it very simple (with some help, I recall) to activate standard additive blending in a shader:
But is there an easy way to handle "subtractive" blending? For instance, if I have a light gray blob texture, I want it not to show up as a bright light, but as a color-saturated dark patch (which is generally how it looks when you uniformly subtract from a color).
Changing BlendOp to Subtract definitely does not do the trick, as it makes my scene resemble a disco on drugs. The closest I've found is Min, which gives the color saturation I want but seems to make anything bright look washed-out (yet also dim, as planned).
Code:
pass base { SrcBlend = One; DestBlend = One; BlendOp = Add; VertexShader=compile vs_1_1 mainVS(); PixelShader=compile ps_1_1 mainPS(); }
But is there an easy way to handle "subtractive" blending? For instance, if I have a light gray blob texture, I want it not to show up as a bright light, but as a color-saturated dark patch (which is generally how it looks when you uniformly subtract from a color).
Changing BlendOp to Subtract definitely does not do the trick, as it makes my scene resemble a disco on drugs. The closest I've found is Min, which gives the color saturation I want but seems to make anything bright look washed-out (yet also dim, as planned).