This is a fairly straightforward extension of the previous shader. It adds support for point lights and multiple light sources. Unfortunately we have 2 diverging paths for lighting that makes things difficult to be 100% the same in either program. As far as i know, i can only access the position data in Maya for the point light, and not the falloff or brightness, so i used the light color alpha to determine brightness and added a custom falloff attribute. In terms of Unity, lighting is done in multiple passes, generally one per light as far as i can tell. This may be behind some of the draw call woes i’ve dealt with in the past with Unity…perhaps i should work on lightmap support for these at some point to reduce the draw calls.In any case, both examples are available for download.

Maya CGFX File:

vertexlitlamberttexturemultilights.cgfx
File Size: 8 kb
File Type: cgfx

Download File


Unity SHADER File:

vertexlitlamberttexturemultilights.shader
File Size: 11 kb
File Type: shader

Download File


Leave a Reply

Your email address will not be published. Required fields are marked *