Type | function |
Library | shader.* |
See also | removeObject() |
Visual Guide | Visual Guide |
Adds an object to the Dynamic Shader. The object can be a display object or physics body.
A table named "shader" must be attached to the object before it is added to the Dynamic Shader. This table contains references to the image and normal map file for the object.
shader.addObject( object )
a display object or physics body.
local shader = require 'plugin.dynamic-shader'
-----add shaderInfo table to object------
object.shaderInfo = { -- create the object.shaderInfo table
name = "object", -- optional parameter - gives the object a name or the shader will assign one
map1 = "art/object.png", -- reference the image file
map2 = "art/object_n.png" -- refernece the normal map file
}
-----------------------------------
shader.addObject( object ) -- add object to the Dynamic Shader
shader.start() -- turn on the Dynamic Shader