Quantcast
Channel: Answers for "CG Programming, Points Lights attenuation and light range"
Browsing latest articles
Browse All 5 View Live

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 Article


Answer 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 Article


Answer 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
Browsing latest articles
Browse All 5 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>