Type | function |
Library | shader.* |
See also | setAlpha(), setIntensity(), setZValue(), setLinear(), setQuadratic() |
Visual Guide | Visual Guide |
Used to set the constant value for light attenuation in the Dynamic Shader's 1 Point Light setting. The light attenuation table consists of three values {constant, linear, quadratic} The ratio of the 3 values modifies the behavior of light in the Dynamic Shader's 1 Point Light.
Not used with directional light
shader.setConstant( number )
number is a value between 0 and 1
local shader = require 'plugin.dynamic-shader'
shader.setConstant( 0.5 ) -- sets the "constant" value for light attenuation in the Dynamic Shader's 1 Point Light setting
local lightTable = shader.getLightTable() -- get the current Dynamic Shader values
print(lightTable.constant)
-- OUTPUT: 0.5