Type | function |
Library | shader.* |
See also | setAlpha(), setIntensity(), setZValue(), setConstant(), setQuadratic() |
Visual Guide | Visual Guide |
Used to set the linear 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.setLinear( number )
number is a value between 0 and 1
local shader = require 'plugin.dynamic-shader'
shader.setLinear( 0.5 ) -- sets the "linear" 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.linear)
-- OUTPUT: 0.5