0
$\begingroup$

Imagine I have an x value that ranges from 1-100. The light source is pointed at x=50.

From points 35 to 65 I want intensity to be 1

At the ends (ie 1 and 100), intensity should be 0

What formula should be used to model the in between values ?

Cosine ? Inverse square law ? ratio ?

$\endgroup$
  • 4
    $\begingroup$ What formula "should" be used depends on what you're trying to achieve. What's the situation you want the light to model? $\endgroup$ – Dan Hulme May 12 at 12:52
  • $\begingroup$ smoothstep(0,35,x) and ( 1.0 - smoothstep(65,100,x) ) $\endgroup$ – game development germ Jun 14 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.