GLSL Hacker
FEATURES DOWNLOAD GALLERY BLOG LEARN



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 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

Parameters

This function has no input parameter(s).

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.

    Return Values

    This function has no return value(s).

    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.

    Return Values

    This function has no return value(s).

    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.

    Return Values

    This function has no return value(s).

    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.

    Return Values

    This function has no return value(s).

    Code sample


    gh_material.remove_texture(material, texture)





    2013-2015 Geeks3D. All Rights Reserved.

    .:- G3D Network -:.