Unity 5 Shader ignore self occlusion
Having a problem with an occlusion shader that only when occluded applies a rim lighting effect on the occluded parts.
The shader works great but there are models that occlude themselves and then create the rim lighting effect without being occluded by another object (I believe this only happens on parts of the models that are behind others BUT have normals pointing at the camera)... How can i solve this problem? Is there something i'm doing wrong in my shader?
http://pastebin.com/d7DpBVRd Heres the code...
Heres an image of the problem, i outlined all the weird fragment of self occlusion
The outline occlusion effect is best understand below when its being obscured by a box, thats the desired effect
Please give me a hand in solving this!
undesiredeffects-rim.png
(74.3 kB)
Comment