- Home /
Desaturating scene while leaving selected object fully saturated
I'm have a script that allows me to select and object, center it to the screen, and free form rotate it with the mouse.
What I would like to do is desaturate the background and keep the selected object in color.
I did some searching and found some people were talking about redrawing the screen after applying the greyscale image effect to the main camera.
Also, there was some mention of using separate layers, one for a camera that renders the screen in grey scale and another that renders the screen in color. At any rate, I started messing around with it and it seemed like it was overly complicated for what I was trying to do.
Basically, I want the same functionally as the search feature in the hierarchy editor-side. To me it seems like I would use two separate shaders, one that desaturates objects, and another that displays objects in full color, then animate between the two of them when selecting an object. Would this be the best way to handle it? Has anyone else done something similar to what I'm doing? Any help would be appreciated.
EDIT: Additionally, our end result is going to load up objects into the scene via xml so keeping this as generic as possible would be a plus.
If you use two shaders then all of your materials have to use those shaders - that might be a bit limiting mightn't it? I guess you could swap in the grayscale shader to the materials and then swap it back afterwards. Using 2 cameras would work for all shaders but I'm thinking you would have a depth issue as items rendered in colour would appear in front of all other items.
Having the colorized objects rendered in front would not be an issue as they are brought to the foreground when clicked on. So technically speaking, do you think rendering the scene with two cameras would be a smaller hit in performance vs swapping shaders?
Your answer
Follow this Question
Related Questions
How do I access the 'Shader' property of the Greyscale Effect? 1 Answer
Why does this shader make my 2D sprites disappear if they are rotated 180 degrees? Also, pixel snap? 3 Answers
grayscale shader on iOS turns black 1 Answer
2D Greyscale shader with lighting and color. 1 Answer
GrayscaleEffect shader broken in 3.5? 0 Answers