↧
Answer by CHPedersen
You've almost got your own question answered in the topic. :) It's all about light range and implementing attenuation. Attenuation is the highlight's size as a function of distance between light and...
View ArticleAnswer by Optimus6128
I have the same problem. Writing my own cg shaders for lighting. Want to get the light range so that I can calculate attenuation on my own. Or get attenuation. Any of two. I debug in the shader by...
View ArticleAnswer by FluFFey
UnityShaderVariables.cginc has the built-in variable `float4 _LightPositionRange`, where xyz = pos and w = (1/range). From this you get `float attenuation = 1-(distanceToLight / (1 /...
View Article