Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 1.79 KB

setQuadratic.markdown

File metadata and controls

39 lines (23 loc) · 1.79 KB

shader.setQuadratic()

 
Type function
Library shader.*
See also setAlpha(), setIntensity(), setZValue(), setConstant(), setLinear()
Visual Guide Visual Guide

Overview

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

Syntax

shader.setQuadratic( number )

number is a value between 0 and 1

Examples

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