Hello!
I would like to ask how to pixelize individual game objects, instead of the full screen.
I’ve come across a solution, on this link, that is:
“using the camera duplicate, which renders only objects in specified layer with pixelization. Pixelization can be done via render effect, like in mentioned “Retro Pixel”. The pixelated image can be merged with main camera image via another render effect (compare depth buffer of two images to decide what image is in front at a given pixel)” (Reply by user Oxymoron).
Looks straithfoward, but I did not got the idea of merging cameras pretty well. There is the possibility of losing depth, and I’m very worried on performance.
More simply put, have 2 cameras.
Camera 1 should be normal
Camera 2 should have a greater depth (depth as in the variable “Depth” NOT position.z), should have the clear flags set to “depth only”, should have the pixellate effect on it, and should use it’s culling mask to only display object that should be pixellated
Hope this helps!
Hello Gambit!
Sure it helps! But it’s half story, because the effect hits all the cameras below. What I’ve done, moments ago, is to render the “sprites” on a render texture, and blit it on the main Camera, on OnRenderImage(). It’s running great!
Sounds good to me ^^
To make sure your sprites aren’t rendered to the cameras below the one you want, you can use a culling mask to make sure certain cameras only render certain layers.
But hey, if you found another solution that works, no need to change it.