One of the first things i learned about lighting was the importance of the 3 point lighting system. Movies and Photographers have been using it forever it seems and anything else generally just looks wrong. Games have a unique challenge with this however. We limited in the number of lights we can have and the player is generally free to mess with any character lighting we might do. This leads to a lot of extra work to tweak the lighting. Personally i am far to lazy for that, so i cheated and wrote a shader to do most of the hardest parts of this for me.

This shader takes the key light and creates a complementary fake rim / back light. It is designed so that no matter where the key light goes, the rim light will follow into a complementary position, saving you the effort of fiddling with a rim light. It is also implemented in the forward pass in Unity, making it a fairly cheap addition to mobile shaders. Its a nice break from the generic shaders i’ve been writing for this so far 🙂

Maya CGFX File:

vertexlitlamberttexturerimlight.cgfx
File Size:6 kb
File Type:cgfx

Download File


Unity SHADER File:

vertexlitlamberttexturerimlight.shader
File Size:9 kb
File Type:shader

Download File


Leave a Reply

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