Sets the falloff rate for pointLight() and spotLight().
A light’s falloff describes the intensity of its beam at a distance. For example, a lantern has a slow falloff, a flashlight has a medium falloff, and a laser pointer has a sharp falloff.
lightFalloff() has three parameters, constant, linear, and quadratic. They’re numbers used to calculate falloff at a distance, d, as follows:
falloff = 1 / (constant + d * linear + (d * d) * quadratic)
Note: constant, linear, and quadratic should always be set to values greater than 0.
Examples
Syntax
lightFalloff(constant, linear, quadratic)
Parameters
constant
Number:
constant value for calculating falloff.
linear
Number:
linear value for calculating falloff.
quadratic
Number:
quadratic value for calculating falloff.
This page is generated from the comments in src/webgl/light.js . Please feel free to edit it and submit a pull request!