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
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.
I’m not sure about the lightrange, but if eventually you also want to sample shadows, you might want to check out LIGHT_ATTENUATION().
It’s not really (properly) documented, but with this thread you should be able to get it working: http://forum.unity3d.com/threads/108612-Adding-shadows-to-custom-shader-(vert-frag)
Thanks, i’ll check it out.