Artistic Experiments
  • Home
  • Reel
  • Shaders
    • Stylized Shaders
    • Lighting Techniques
    • Shader Effects
    • Cubemaps
    • Pixel Lit Shaders (Basic)
    • Vertex Lit Shaders (Basic)
    • Unlit Shaders (Basic)
  • Tools
  • WIP
  • Contact

CG Shaders - Vertex Lit Multi-Lights

11/27/2013

0 Comments

 
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.
Picture

Maya CGFX File:

vertexlitlamberttexturemultilights.cgfx
File Size: 4 kb
File Type: cgfx
Download File

Unity SHADER File:

vertexlitlamberttexturemultilights.shader
File Size: 6 kb
File Type: shader
Download File

0 Comments



Leave a Reply.

    CG Shaders

    Shaders I've built as i teach myself CG. Feel free to download and use for whatever. If you like them you can buy me a beer or something.

    Archives

    December 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.