a port of the Processing Visualization Language
Name

lightFalloff()

Description

Sets the falloff rates for point lights, spot lights, and ambient lights. The parameters are used to determine the falloff with the following equation:

d = distance from light position to vertex position
falloff = 1 / (CONSTANT + d * LINEAR + (d*d) * QUADRATIC)

Like fill(), it affects only the elements which are created after it in the code. The default value if LightFalloff(1.0, 0.0, 0.0). Thinking about an ambient light with a falloff can be tricky. It is used, for example, if you wanted a region of your scene to be lit ambiently one color and another region to be lit ambiently by another color, you would use an ambient light with location and falloff. You can think of it as a point light that doesn't care which direction a surface is facing.

Syntax
lightFalloff(constant,linear,quadratic)
Parameters
constant int or float: constant value for determining falloff
linear int or float: linear value for determining falloff
quadratic int or float: quadratic value for determining falloff
Returns None
Usage Web & Application
Related lights()
ambientLight()
pointLight()
spotLight()
lightSpecular()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub