- Home /
ShaderLab builtin lighting properties are not correct?
Hi All,
I was trying to access lighting properties inside a CG shader (vertex lighting without using surface shaders)
using the following doc:
http://docs.unity3d.com/Documentation/Components/SL-BuiltinValues.html
However, when i tried using: _ModelLightColor[0], _ObjectSpaceLightPos[0] I got undefined variable error.
Anyway after digging into UnityCG.cginc I found: unity_LightPosition[0] & unity_LightColor[0] variables which did the trick.
Are the Docs outdated? or I am missing something?
Thanks in advance
==EDIT==
Just to add that I am using Unity 3.5.7 PRO
I ended up using the unity_ values for a similar reason
Really thanks for sharing, for me also the _$$anonymous$$odelLightColor[0] was not working so I tried unity_LightColor[0] and no more errors, i have Unity 4.1 pro, using Dx11, so yes the doc seems outdated.