I’m searching for few weeks now for glowing effect that will work just on certain objects (like assasin’s creed, for example).
The shaders i got so far are not working well with objects which are not ball or boxes, and they also not really glowing but more bright…
anyway… i thought of creating another camera with glow/bloom effect which will render just a special layer, in which i will place my model. not really sure about it.
I’m working about an hour about it, ain’t really working as i expected. Even if i got and 2nd camera rendering only one layer of object, the camera effect still affects the whole frame.
Do you have other thoughts about it?
Or another shader which will talk with the camera and tell it to glow that object only?
Duplicate your object and make it render with a solid color and no lights (SelfIlum shader works I think)
Make this opaque object belong to the “Glow” layer.
Duplicate your camera and make it in the same position/rotation of your main camera
This second camera must only render the “Glow” layer (see the Culling Mask)
This second camera must render BEFORE the Main camera.
The main camera must clear only the Depth
Add the Blur post effect in the second camera rendering the “Glow” layer only.
The main idea of these steps is rendering only the object(s) with hilight in a pass, then applying the Blur effect on them. After that when the real scene is rendered the objects that belong to the “Glow” layer will have an “aura” like effect around them!
I made these steps to create an outline effect similar to the Left 4 Dead player overlay effect!
I’m not doubting that it works - I’m doubting that there isn’t a much simpler way to achieve a similar result without using a second camera and a post processing effect.
Forgot that! This selective behaviour is really tricky!
You could try combining the Glow + Outline PostEffect, then change the effect camera clear flags to “DepthOnly”, render it to a texture and put this texture over everything!
If I’m not mistaken Left4Dead uses a PostEffect + Stencil Buffer wich unity do not give access.