"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

GeeXLab

Laboratory for Real Time 3D Programming (prototyping and demos)
OpenGL, Lua, Python, GLSL,
PhysX and more...

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

HYP_Material Library


Description
Material library

Number of functions: 36

HYP_Material.Create

Description
Creates a new material object.

Languages: Lua - Python

Return Values
  • matId [INTEGER]: material identifier

    Code sample :

    matId = HYP_Material.Create()


    HYP_Material.Destroy

    Description
    Destroys an existing material object.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Code sample :

    HYP_Material.Destroy(matId)


    HYP_Material.ApplyToRenderer

    Description
    Applies material properties to the renderer. This function is useful with render to texture or in direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Code sample :

    HYP_Material.ApplyToRenderer(matId)


    HYP_Material.GetNumMaterials

    Description
    Returns the total number of materials created. All materials are stored in a global list.

    Languages: Lua - Python

    Return Values
  • n [INTEGER]: number of materials

    Code sample :

    n = HYP_Material.GetNumMaterials()


    HYP_Material.GetIdByIndex

    Description
    Returns a material based on its index in the materials list.

    Languages: Lua - Python

    Parameters
  • index [INTEGER]: material index. - Values = [0 ; GetNumMaterials()-1]

    Return Values
  • matId [INTEGER]: material identifier

    Code sample :

    matId = HYP_Material.GetIdByIndex(0)


    HYP_Material.GetNameByIndex

    Description
    Returns material's name based on its index in the materials list.

    Languages: Lua - Python

    Parameters
  • index [INTEGER]: material index. - Values = [0 ; GetNumMaterials()-1]

    Return Values
  • name [STRING]: material name

    Code sample :

    name = HYP_Material.GetNameByIndex(0)


    HYP_Material.GetId

    Description
    Returns material identifier from its name.

    Languages: Lua - Python

    Parameters
  • name [STRING]: material name

    Return Values
  • matId [INTEGER]: material identifier

    Code sample :

    matId = HYP_Material.GetId(name)


    HYP_Material.GetName

    Description
    Returns material name from its id.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • name [STRING]: material name

    Code sample :

    name = HYP_Material.GetName(matId)


    HYP_Material.SetName

    Description
    Sets material name.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • name [STRING]: material name

    Code sample :

    HYP_Material.SetName(matId, name)


    HYP_Material.SetRenderState

    Description
    Sets the render state of the material. If this state is set to 0, objects that use this material will not be rendered.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • state [INTEGER]: render state

    Code sample :

    HYP_Material.SetRenderState(matId, 0)


    HYP_Material.GetRenderState

    Description
    Gets the render state.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • state [INTEGER]: render state

    Code sample :

    state = HYP_Material.GetRenderState(matId)


    HYP_Material.SetTexturingState

    Description
    Sets the texturing state. If the state is set to 0, texture mapping is disabled for all objects that use this material.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • state [INTEGER]: texturing state

    Code sample :

    HYP_Material.SetTexturingState(matId, 0)


    HYP_Material.GetTexturingState

    Description
    Gets the texturing state.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • state [INTEGER]: texturing state

    Code sample :

    state = HYP_Material.GetTexturingState(matId)


    HYP_Material.GetNumberOfTextures

    Description
    Returns the number of textures attached to a material.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • numTextures [INTEGER]: number of textures.

    Code sample :

    n = HYP_Material.GetNumberOfTextures(matId)


    HYP_Material.KillAllTextures

    Description
    Removes and destroys all textures attached to a material.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Code sample :

    HYP_Material.KillAllTextures(matId)


    HYP_Material.RemoveAllTextures

    Description
    Removes all textures attached to a material. The textures are not destroyed.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Code sample :

    HYP_Material.RemoveAllTextures(matId)


    HYP_Material.AddTexture

    Description
    Adds a texture to a material. A material can have an unlimited number of textures (multitexturing) but the number of textures used during the rendering is limited by the graphics hardware.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • textureId [INTEGER]: texture identifier

    Return Values
  • textureUnit [INTEGER]: texture unit where the texture is attached.

    Code sample :

    HYP_Material.AddTexture(matId, textureId01)
    HYP_Material.AddTexture(matId, textureId02)


    HYP_Material.SetTexture

    Description
    Modifies an existing material's texture.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • textureId [INTEGER]: texture identifier
  • textureUnit [INTEGER]: texture unit where the texture is attached. - Values = [0 ; (GetNumberOfTextures()-1)]

    Code sample :

    HYP_Material.SetTexture(matId, textureId01, 0)
    HYP_Material.SetTexture(matId, textureId02, 1)


    HYP_Material.RemoveTexture

    Description
    Removes a texture from a material.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • textureUnit [INTEGER]: texture unit - Values = [0 ; (GetNumberOfTextures()-1)] /> matId [INTEGER]: material identifier
  • textureUnit [INTEGER]: texture unit where the texture is attached. - Values = [0 ; (GetNumberOfTextures()-1)]

    Return Values
  • textureId [INTEGER]: texture identifier

    Code sample :

    textureId = HYP_Material.GetTextureId(matId, textureUnit)


    HYP_Material.SetShaderProgram

    Description
    (DEPRECATED - Use SetGpuProgram instead) Sets the shader program (or gpu shader) that will be enabled when the material will be used.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • shaderId [INTEGER]: GPU shader program identifier.

    Code sample :

    HYP_Material.SetShaderProgram(matId, shaderId)


    HYP_Material.SetShaderProgramForAmbientPass

    Description
    (DEPRECATED - Use SetGpuProgramForAmbientPass instead) Sets the shader program (or gpu shader) that will be enabled when the material will be used. This shader will be used in shadow ambient pass only.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • shaderId [INTEGER]: GPU shader program identifier.

    Code sample :

    HYP_Material.SetShaderProgramForAmbientPass(matId, shaderId)


    HYP_Material.SetGpuProgram

    Description
    Sets the gpu program that will be enabled when the material will be used.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • gpuProgramId [INTEGER]: GPU program identifier.

    Code sample :

    HYP_Material.SetGpuProgram(matId, gpuProgramId)


    HYP_Material.SetGpuProgramForAmbientPass

    Description
    Sets the gpu program that will be enabled when the material will be used. This gpu program will be used in shadow ambient pass only.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • shaderId [INTEGER]: GPU program identifier.

    Code sample :

    HYP_Material.SetGpuProgramForAmbientPass(matId, gpuProgramId)


    HYP_Material.SetAmbient

    Description
    Sets material's ambient reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    HYP_Material.SetAmbient(matId, 0.2, 0.2, 0.2, 1.0)


    HYP_Material.GetAmbient

    Description
    Gets material's ambient reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    r, g, b, a = HYP_Material.GetAmbient(matId)


    HYP_Material.SetDiffuse

    Description
    Sets material's diffuse reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    HYP_Material.SetDiffuse(matId, 0.2, 0.2, 0.2, 1.0)


    HYP_Material.GetDiffuse

    Description
    Gets material's diffuse reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    r, g, b, a = HYP_Material.GetDiffuse(matId)


    HYP_Material.SetSpecular

    Description
    Sets material's specular reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    HYP_Material.SetSpecular(matId, 0.2, 0.2, 0.2, 1.0)


    HYP_Material.GetSpecular

    Description
    Gets material's specular reflexion coefficients.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • r, g, b, a [REAL]: RGBA reflexion coefficients.

    Code sample :

    r, g, b, a = HYP_Material.GetSpecular(matId)


    HYP_Material.SetShininess

    Description
    Sets material's specular power factor or shininess.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • shininess [REAL]: power factor.

    Code sample :

    shininess = 90.0
    HYP_Material.SetShininess(matId, shininess)


    HYP_Material.GetShininess

    Description
    Gets material's specular power factor or shininess.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • shininess [REAL]: power factor.

    Code sample :

    shininess = HYP_Material.GetShininess(matId, shininess


    HYP_Material.SetEmissive

    Description
    Sets material's emissive color.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • r, g, b, a [REAL]: RGBA color.

    Code sample :

    HYP_Material.SetEmissive(matId, 0.8, 0.1, 0.1, 1.0)


    HYP_Material.GetEmissive

    Description
    Gets material's emissive color.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier

    Return Values
  • r, g, b, a [REAL]: RGBA color.

    Code sample :

    r, g, b, a = HYP_Material.GetEmissive(matId)


    HYP_Material.SetResilience

    Description
    Sets material's change rebound coefficient. For PhysX.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • resilience [REAL]: resilience factor.

    Code sample :

    HYP_Material.SetResilience(matId, 0.5)


    HYP_Material.SetStaticFriction

    Description
    Sets material's static friction coefficient. For PhysX.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • friction [REAL]: friction factor.

    Code sample :

    HYP_Material.SetStaticFriction(matId, 0.2)


    HYP_Material.SetDynamicFriction

    Description
    Sets material's dynamic friction coefficient. For PhysX.

    Languages: Lua - Python

    Parameters
  • matId [INTEGER]: material identifier
  • friction [REAL]: friction factor.

    Code sample :

    HYP_Material.SetDynamicFriction(matId, 0.2)




  • Random Projects

    2D Shockwave Effect
    2D Shockwave Effect

    Dream Vision Effect
    Dream Vision Effect

    Blender Object Viewer
    Blender Object Viewer


    Random Code Samples

    Anaglyph Stereoscopic 3D
    Anaglyph Stereoscopic 3D

    Hierarchy
    Hierarchy

    HUD (Head Up Display)
    HUD (Head Up Display)



    (C)2009-2010 Geeks3D.com