Quick Links
  • Homepage
        - Overview
        - Download
        - Screenshots
        - Community
  • Code Sample Pack
  • Reference Guide
  • Changelog
  • Overview of GLSL Hacker
  • Live Coding
  • Hack your first GLSL Code
  • Moon3D




  • GLSL Hacker Articles

    > Compute shaders on Radeon
    > Distance functions in GLSL
    > GLSL Interpolation Qualifiers
    > Tessellation Spacing Modes
    > Normal Visualizer with GS
    > 3D Surface Plots
    > Normal Mapping
    > Circle and Disc in GLSL
    > PhysX 3 Flag Demo
    > GLSL Hacker on Raspberry Pi
    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-2014 Geeks3D