< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_material library

Description

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 is made up of one or several textures and a GPU program.


Number of functions: 6

  1. gh_material.add_texture (Lua - Python)
  2. gh_material.bind (Lua - Python)
  3. gh_material.create (Lua - Python)
  4. gh_material.get_gpu_program (Lua - Python)
  5. gh_material.remove_texture (Lua - Python)
  6. gh_material.set_gpu_program (Lua - Python)



add_texture

Description

Adds a texture to the material.


Syntax

gh_material.add_texture(
 material,
 texture
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_material.add_texture(material, texture)
            


bind

Description

Bind the material to the renderer: textures and gpu programs are bound.


Syntax

gh_material.bind(
 material
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_material.bind(material)
            


create

Description

Creates a material.


Syntax

material = gh_material.create()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
material = gh_material.create()
            


get_gpu_program

Description

Sets the GPU program of the material.


Syntax

gpu_program = gh_material.get_gpu_program(
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
gpu_program = gh_material.get_gpu_program(material)
            


remove_texture

Description

Removes a texture from the material.


Syntax

gh_material.remove_texture(
 material,
 texture
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_material.remove_texture(material, texture)
            


set_gpu_program

Description

Sets the GPU program of the material.


Syntax

gh_material.set_gpu_program(
 material,
 gpu_program
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_material.set_gpu_program(material, gpu_program)
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter