-
Selective saturation
I'm not sure if a shader or other method exists for MMF that does this, but I would like to have the ability to selectively reduce or increase saturation with a specified greyscale image like an alpha map. Similar to the way looki's lens shader works. For example, I would like to be able to have the entire frame desaturate to greyscale using an an animated/rescaled circular gradient (obviously not visible to the player since it's for the shader only) moving outwards from my character with the color essentially getting wiped away within the circle until the whole scene is completely desaturated. Is there a current way to do this that I am missing? If there is not, can someone look into creating a shader to do so?
-
You didn't say the magic word.
...but since I'm feeling charitable, I made you a pixelshader anyway: http://sdrv.ms/Z8mqLU
-
Thank you very much. :) This will help me out a ton.
Here is a demonstration of the effect in action using the lens effect in tandem: http://dl.dropbox.com/u/7461878/SaturationMask_Demo.mfa
The gradients are fairly hi-res 2K images.
You can control the scale of the gradient with the A & D keys.
http://dl.dropbox.com/u/7461878/demo.png
-
The screenshot looks good, but I can't run the .mfa because I don't have the background shader (and the link for it goes to the old forums, which have been closed).
Would you mind posting the .fx and .xml files, please?
-
-
Thanks Marvin, but I meant the background lens shader ("Looki Background Lens.fx") - sorry, I should have said that.
EDIT: Never mind - I just renamed the normal "lens.fx" and it seems to work. Nice effect, Trey :)
-
Thanks again, MuddyMole. Just what I needed. :)
BTW, here are the ovine shaders you needed: http://dl.dropbox.com/u/7461878/Ovine.zip
I will be making a game using this and would like to place your name in the credits. I can use your forum name or you can PM me your proper name if you would like.
-
Thanks for the shader files. Don't worry about the credits - it's not a big deal.
-
Good Job MM. I never knew you was a dab hand with HLSL... can we expect anymore in the future?
-
I'm not. I don't know the first thing about HLSL - I just guessed how to modify one of the other shaders (ColorDodge.fx), based on this: http://www.tedlindstrom.se/?p=275
I made a shader for brightness & contrast a little while back too.
-
It should be noted this shader can only desaturate. It isn't to be used for increasing saturation. The max value (white) will show an unaffected image. Not really a problem for me as this does exactly what I need it to do. :)