Search Unity

_LightPositionRange not working

Discussion in 'Shaders' started by sebastien lagarde, Feb 13, 2011.

  1. sebastien lagarde

    sebastien lagarde

    Joined:
    Jul 22, 2010
    Posts:
    15
    Hello,

    I have written my own shader without using surface shader.
    All works fined. I now try to attenuate my light with distance from the light. To get access to light information
    in the shader, I used _LightPositionRange but it seems to not contains valid value (all is zero).

    I am wondering if someone is able to use it or if there is special pragma or mode to enable it ?

    Thank you
     
  2. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    Same here "_LightPositionRange" does nothing, i'm wondering what the answer is for getting the correct atten??
    "1.0 / length(lightDir)" is NOT the right way to do it.
     
  3. WhiskyJoe

    WhiskyJoe

    Joined:
    Aug 21, 2012
    Posts:
    143
  4. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985