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 - Multiple Lights in a Single Pass

11/27/2013

0 Comments

 
One quick demonstration i wanted to make before moving on is multiple vertex lights in a single pass. Unity provides an array of 4 light positions which can be accessed in the vertex shader. By utilizing these, it is possible to run multiple lighting calculations in the Forward Base pass. However, this is not the most reliable system unfortunately. The 4 lights provided are the 4 closest point lights, so you may notice issues with dynamic lights ("Shadows" or lights behaving oddly when they move/switch order in terms of which light is closest). However the shadow fidelity is comparable to the multipass vertex lit shader, so this might be useful for mobile so you can avoid multiple passes.

I believe these are the lights that Unity considers not "Important" and thus vertex lit. Perhaps someone will be able to find a better use for these in the future.
Picture

Unity SHADER File:

vertexlitlamberttexturemultilightsonepass.shader
File Size: 4 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.