- Home /
Light Cookie Doubles up Lighting on Transparent Objects ?
I came across this strange thing today, apparently when when light cookies are set, transparent objects that overlap themselves (so not regular transparent objects) behave weirdly as seen in the image.
I have tried a lot of things but it seems the only thing that fixes it is disabling pixel lighting (aka both forward and deferred) in either a new shader or per light, unfortunately I need this as I want to have a normal map on my transparent objects.
Any ideas would be greatly appreciated, Here is also a link to a stripped down project that shows the basic issue. :
https://dl.dropbox.com/s/6awohhm3jrh31vz/LightCookieExample.unitypackage?dl=1
Answer by ScroodgeM · Jul 20, 2012 at 08:22 AM
this causes by lighting calculations in shader.
light calculated as diffuse_color light_power alpha
so for top-left picture light power is calculated normally, but it top-right picture your alpha-component is doubled (50% opaque and 50% opaque in a single pixel gives totally 75% opaque), so light have increased power in that area
solution is not to use overlapping geometry in single model. better to use shader with texture overlapping - cheapy method without such bugs with light
other solution is to write a custom shader for correct blend of such surfaces