 Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
gh_material Library
gh_material is the module that manages materials: creation, destruction, parameters setting. The fundamental goal of material is to define the final appearence of an object surface. A material can have light reflection coefficients, textures and GPU programs
that contribute to the final pixel color.
Number of functions: 6
gh_material.create
Creates a material.
: Lua - Python
material [INTEGER]: material identifier
:
material = gh_material.create()
gh_material.bind
Bind the material to the renderer: textures and gpu programs are bound.
: Lua - Python
material [INTEGER]: material identifier.
:
gh_material.bind(material)
gh_material.set_gpu_program
Sets the GPU program of the material.
: Lua - Python
material [INTEGER]: material identifier.
gpu_program [INTEGER]: GPU program identifier.
:
gh_material.set_gpu_program(material, gpu_program)
gh_material.get_gpu_program
Sets the GPU program of the material.
: Lua - Python
material [INTEGER]: material identifier.
gpu_program [INTEGER]: GPU program identifier
:
gpu_program = gh_material.get_gpu_program(material)
gh_material.add_texture
Adds a texture to the material.
: Lua - Python
material [INTEGER]: material identifier.
texture [INTEGER]: texture identifier.
:
gh_material.add_texture(material, texture)
gh_material.remove_texture
Removes a texture from the material.
: Lua - Python
material [INTEGER]: material identifier.
texture [INTEGER]: texture identifier.
:
gh_material.remove_texture(material, texture)
|