Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 2.4 KB

getLightTable.markdown

File metadata and controls

64 lines (46 loc) · 2.4 KB

shader.getLightTable()

 
Type function
Library shader.*
Return value table
Visual Guide Visual Guide

Overview

Returns a table with the current values used by the Dynamic Shader note These values are only a snapshot of the moment the method is called. If any value changes in the Dynamic Shader system, e.g. effect, color, alpha, intensity, zValue, constant, linear, quadratic or engine, then getLightTable() will need to be called again to be accurate.

Syntax

shader.getLightTable( )

returns a table with the current shading values used by the Dynamic Shader

  • table.effect = string "composite.normalMapWith1DirLight" or "composite.normalMapWith1PointLight"
  • table.effectName = string "directional light" or "1 point light"
  • table.color = table table = {red, blue, greed, alpha}
  • table.alpha = number a value from 0 to 1
  • table.intensity = number a value from 0 to 1
  • table.zValue = number a value from 0 to 1
  • table.constant = number a value from 0 to 1
  • table.linear = number a value from 0 to 1
  • table.quadratic = number a value from 0 to 1
  • table.engine = Boolean true = "shader on" , false = "shader off"

Examples

local shader = require 'plugin.dynamic-shader'

local lightTable = shader.getLightTable( )

print(lightTable.alpha)
-- OUTPUT: 1

print(lightTable.effectName)
-- OUTPUT: "directional light"

print(lightTable.engine)
-- OUTPUT: true

print(lightTable.color[1])
-- OUTPUT: 0.5