Quick Links
- Homepage
- Downloads
- Code Sample Pack
- Gallery
- Forum

Documentation
- Overview
- GLSL Programs
- Live Coding
- Hack your first
  GLSL program

- Reference guide

Follow GLSL Hacker

GLSL Hacker @ Twitter

GLSL Hacker

Reference Guide
Host-API Lua / Python



» Back to Homepage
» Back to Developer's 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 can have light reflection coefficients, textures and GPU programs that contribute to the final pixel color.

Number of functions: 6

gh_material.create

Description
Creates a material.

Languages: Lua - Python

Return Values
  • material [INTEGER]: material identifier

    Code sample :

    material = gh_material.create()


    gh_material.bind

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

    Languages: Lua - Python

    Parameters
  • material [INTEGER]: material identifier.

    Code sample :

    gh_material.bind(material)


    gh_material.set_gpu_program

    Description
    Sets the GPU program of the material.

    Languages: Lua - Python

    Parameters
  • material [INTEGER]: material identifier.
  • gpu_program [INTEGER]: GPU program identifier.

    Code sample :

    gh_material.set_gpu_program(material, gpu_program)


    gh_material.get_gpu_program

    Description
    Sets the GPU program of the material.

    Languages: Lua - Python

    Parameters
  • material [INTEGER]: material identifier.

    Return Values
  • gpu_program [INTEGER]: GPU program identifier

    Code sample :

    gpu_program = gh_material.get_gpu_program(material)


    gh_material.add_texture

    Description
    Adds a texture to the material.

    Languages: Lua - Python

    Parameters
  • material [INTEGER]: material identifier.
  • texture [INTEGER]: texture identifier.

    Code sample :

    gh_material.add_texture(material, texture)


    gh_material.remove_texture

    Description
    Removes a texture from the material.

    Languages: Lua - Python

    Parameters
  • material [INTEGER]: material identifier.
  • texture [INTEGER]: texture identifier.

    Code sample :

    gh_material.remove_texture(material, texture)






  • (C)2012 Geeks3D