< 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 ()
  2. gh_material.bind ()
  3. gh_material.create ()
  4. gh_material.get_gpu_program ()
  5. gh_material.remove_texture ()
  6. gh_material.set_gpu_program ()



add_texture

Description

Adds a texture to the material.


Syntax

gh_material.add_texture(
 mat_id,
 tex_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_material.add_texture(mat_id, tex_id)
			


bind

Description

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


Syntax

gh_material.bind(
 mat_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_material.bind(mat_id)
			


create

Description

Creates a material.


Syntax

mat_id = gh_material.create()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


mat_id = gh_material.create()
			


get_gpu_program

Description

Gets the GPU program of the material.


Syntax

gpuprog_id = gh_material.get_gpu_program(
 mat_id
)

Languages


Parameters


Return Values


Code sample


gpuprog_id = gh_material.get_gpu_program(mat_id)
			


remove_texture

Description

Removes a texture from the material.


Syntax

gh_material.remove_texture(
 mat_id,
 tex_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_material.remove_texture(mat_id, tex_id)
			


set_gpu_program

Description

Sets the GPU program of the material.


Syntax

gh_material.set_gpu_program(
 mat_id,
 gpuprog_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_material.set_gpu_program(mat_id, gpuprog_id)
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter