- Home /
How do you get ambient occlusion working with transparency and lightmapping?
http://unity3d.com/support/documentation/Components/class-LightMapping.html
Transparency Alpha-based: when using a transparent shader, main texture's alpha channel will control the transparency
Color-based: Beast's RGB transparency can be enabled by adding a texture property called _TransparencyLM to the shader. Bear in mind that this transparency is defined in the opposite way compared to the alpha-based transparency: here a pixel with value (1, 0, 0) will be fully transparent to red light component and fully opaque to green and blue component, which will result in a red shadow; for the same reason white texture will be fully transparent, while black texture - fully opaque.
I can't get lightmapped ambient occlusion to work properly without resorting to that Color-based approach. All I do is take the alpha channel of the main texture, invert it, use that for _TransparencyLM, and all is good. What's the proper practice to not have to rely on that? (I assume it has to do with naming conventions.)