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