Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Access all lights from fragment shaderq

Discussion in 'Shaders' started by mradfo21, Jan 31, 2015.

  1. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    hey there Unity. I'm wondering if i can get access to a list of the lights in the scene while inside a fragment program. Is there some kind of list that i could loop through getting the lights, their types, and their positions? I'm asking because i'm going to be raymarching, and at any step through the raymarcher i wan't to know the positions of all the lights in the game.
     
  2. TechnoCraft

    TechnoCraft

    Joined:
    Apr 6, 2012
    Posts:
    28
    See this topic. Attached project stores light data to a texture and then decodes it inside fragment program. Maybe it is possible with Unity Pro. Unity free has some limitations by design. Lights are one of them.