"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_GpuProgram Library


Description
Real time shading language library

Number of functions: 47

HYP_GpuProgram.GetId

Description
Returns the gpu program id from its name (declared in XML).

Languages: Lua - Python

Parameters
  • name [STRING]: gpu program name.

    Return Values
  • id [INTEGER]: shader id

    Code sample :

    id = HYP_GpuProgram.GetId("simpleShader")


    HYP_GpuProgram.GetOpenGLId

    Description
    Gets the OpenGL gpu program name or ID. This function is useful in post direct rendering scripts with HYP_Renderer.GpuProgramxxxxxx() functions.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id

    Return Values
  • glId [INTEGER]: OpenGL gpu program name

    Code sample :

    glId = HYP_GpuProgram.GetOpenGLId(id)


    HYP_GpuProgram.Destroy

    Description
    Destroys an existing gpu program object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id

    Code sample :

    HYP_GpuProgram.Destroy(id)


    HYP_GpuProgram.Create

    Description
    Creates a new gpu program.

    Languages: Lua - Python

    Return Values
  • id [INTEGER]: gpu program id

    Code sample :

    id = HYP_GpuProgram.Create()


    HYP_GpuProgram.CreateFromFile

    Description
    Creates a new gpu program from a source code file.

    Languages: Lua - Python

    Parameters
  • filename [STRING]: shader source code file. Currently only GLSL shaders are supported.
  • absolutePath [INTEGER]: filename is specified by an absolute path (1) or a relative path (0).

    Return Values
  • id [INTEGER]: gpu program id

    Code sample :

    id = HYP_GpuProgram.CreateFromFile("data/myGlslShader.glsl", 0)


    HYP_GpuProgram.UpdateSourceCode

    Description
    Creates a new gpu program from a source code memory buffer.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • sourceCode [STRING]: shader source code buffer. Currently only GLSL shaders are supported.

    Code sample :

    id = HYP_GpuProgram.Create()
    HYP_GpuProgram.UpdateSourceCode(id, shaderBuffer)


    HYP_GpuProgram.Activate

    Description
    Links if necessary and binds the gpu program (sets this gpu program active at the level of the renderer). This function is useful in post direct rendering scripts.

    Languages: Lua

    Parameters
  • id [INTEGER]: gpu program id

    Code sample :

    HYP_GpuProgram.Activate(id)


    HYP_GpuProgram.Deactivate

    Description
    Unbinds the gpu program.

    Languages: Lua

    Parameters
  • id [INTEGER]: gpu program id

    Code sample :

    HYP_GpuProgram.Deactivate(id)


    HYP_GpuProgram.SetUniform_1i

    Description
    Specifies the name and the value of an uniform 1D vector of integers to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x [INTEGER]: uniform value.

    Code sample :

    HYP_GpuProgram.SetConstant_1i(id, "varX", x)


    HYP_GpuProgram.SetUniform_2i

    Description
    Specifies the name and the value of an uniform 2D vector of integers to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y [INTEGER]: uniform value.

    Code sample :

    HYP_GpuProgram.SetConstant_2i(id, "varXY", x, y)


    HYP_GpuProgram.SetUniform_3i

    Description
    Specifies the name and the value of an uniform 3D vector of integers to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z [INTEGER]: uniform value.

    Code sample :

    HYP_GpuProgram.SetConstant_3i(id, "varXYZ", x, y, z)


    HYP_GpuProgram.SetUniform_4i

    Description
    Specifies the name and the value of an uniform 4D vector of integers to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z, w [INTEGER]: uniform value.

    Code sample :

    HYP_GpuProgram.SetConstant_4i(id, "varXYZW", x, y, z, w)


    HYP_GpuProgram.SetUniform_1f

    Description
    Specifies the name and the value of an uniform 1D vector of float to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x [REAL]: uniform value.

    Code sample :

    elapsedTime = HYP_Utils.GetElapsedTime() * 0.001
    HYP_GpuProgram.SetUniform_1f(id, "time", elapsedTime)


    HYP_GpuProgram.SetUniform_2f

    Description
    Specifies the name and the value of an uniform 2D vector of float to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y [REAL]: uniform value.

    Code sample :

    HYP_GpuProgram.SetUniform_2f(id, "myVec2", x, y)


    HYP_GpuProgram.SetUniform_3f

    Description
    Specifies the name and the value of an uniform 3D vector of float to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z [REAL]: uniform value.

    Code sample :

    HYP_GpuProgram.SetUniform_3f(id, "myVec3", x, y, z)


    HYP_GpuProgram.SetUniform_4f

    Description
    Specifies the name and the value of an uniform 4D vector of float to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z, w [REAL]: uniform value.

    Code sample :

    HYP_GpuProgram.SetUniform_4f(id, "myVec4", x, y, z, w)


    HYP_GpuProgram.SetUniform_1d

    Description
    Specifies the name and the value of an uniform 1D vector of double (fp64) to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x [REAL]: uniform value (fp64).

    Code sample :

    HYP_GpuProgram.SetUniform_1d(id, "xx", x)


    HYP_GpuProgram.SetUniform_2d

    Description
    Specifies the name and the value of an uniform 2D vector of double (fp64) to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y [REAL]: uniform value (fp64).

    Code sample :

    HYP_GpuProgram.SetUniform_2d(id, "myVec2d", xx, yy)


    HYP_GpuProgram.SetUniform_3d

    Description
    Specifies the name and the value of an uniform 3D vector of double (fp64) to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z [REAL]: uniform value (fp64).

    Code sample :

    HYP_GpuProgram.SetUniform_3d(id, "myVec3d", xx, yy, zz)


    HYP_GpuProgram.SetUniform_4d

    Description
    Specifies the name and the value of an uniform 4D vector of double (fp64) to pass to the shader. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • x, y, z, w [REAL]: uniform value (fp64).

    Code sample :

    HYP_GpuProgram.SetUniform_4d(id, "myVec4d", xx, yy, zz, ww)


    HYP_GpuProgram.SetUniform_4x4f

    Description
    Specifies the value of an uniform 4x4 matrix. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • m0, ..., m15 [REAL]: 16 values of the 4x4 matrix in OpenGL conventions

    Code sample :

    HYP_GpuProgram.SetUniform_4x4f(id, "viewMat", m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)


    HYP_GpuProgram.SetUniform_4x4d

    Description
    Specifies the value of an uniform 4x4 matrix. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • m0, ..., m15 [REAL]: 16 values (double, fp64) of the 4x4 matrix in OpenGL conventions

    Code sample :

    HYP_GpuProgram.SetUniform_4x4d(id, "viewMat", m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)


    HYP_GpuProgram.SetUniform_4x4f_Model

    Description
    Specifies the value of an uniform 4x4 matrix. The value of the matrix is automatically set by GeeXLab when an object using this shader is rendered. The name of this uniform must be declared in the source code of the shader.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.SetUniform_4x4f_Model(id, "modelMat")


    HYP_GpuProgram.AllocUniformArray_1fv

    Description
    Allocates an array of 1D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_1fv(id, "convolutionShader", 9)


    HYP_GpuProgram.SetUniformArrayElement_1fv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x [REAL]: value of the element

    Code sample :

    HYP_GpuProgram.AllocUniformArray_1fv(id, "convolutionShader", 9)
    HYP_GpuProgram.SetUniformArrayElement_1fv(id, "convolutionShader", 0, 1.0)
    HYP_GpuProgram.SetUniformArrayElement_1fv(id, "convolutionShader", 1, 1.0)
    HYP_GpuProgram.SetUniformArrayElement_1fv(id, "convolutionShader", 2, 4.0)


    HYP_GpuProgram.ApplyUniformArray_1fv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_1fv(id, "convolutionShader")


    HYP_GpuProgram.AllocUniformArray_2fv

    Description
    Allocates an array of 2D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_2fv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_2fv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y [REAL]: value of the element

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_2fv(id, "myArray", 0, 1.0, 1.0)


    HYP_GpuProgram.ApplyUniformArray_2fv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_2fv(id, "myArray")


    HYP_GpuProgram.AllocUniformArray_3fv

    Description
    Allocates an array of 3D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_3fv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_3fv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y, z [REAL]: value of the element

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_3fv(id, "myArray", 0, 1.0, 1.0, 1.0)


    HYP_GpuProgram.ApplyUniformArray_3fv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_3fv(id, "myArray")


    HYP_GpuProgram.AllocUniformArray_4fv

    Description
    Allocates an array of 4D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_4fv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_4fv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y, z, w [REAL]: value of the element

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_4fv(id, "myArray", 0, 1.0, 1.0, 1.0, 0.1)


    HYP_GpuProgram.ApplyUniformArray_4fv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_4fv(id, "myArray")


    HYP_GpuProgram.AllocUniformArray_1dv

    Description
    Allocates an array of 1D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_1fv(id, "convolutionShader", 9)


    HYP_GpuProgram.SetUniformArrayElement_1dv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x [REAL]: value of the element (fp64)

    Code sample :

    HYP_GpuProgram.AllocUniformArray_1dv(id, "convolutionShader", 9)
    HYP_GpuProgram.SetUniformArrayElement_1dv(id, "convolutionShader", 0, 1.0)
    HYP_GpuProgram.SetUniformArrayElement_1dv(id, "convolutionShader", 1, 1.0)
    HYP_GpuProgram.SetUniformArrayElement_1dv(id, "convolutionShader", 2, 4.0)


    HYP_GpuProgram.ApplyUniformArray_1dv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_1dv(id, "convolutionShader")


    HYP_GpuProgram.AllocUniformArray_2dv

    Description
    Allocates an array of 2D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_2dv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_2dv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y [REAL]: value of the element (fp64)

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_2dv(id, "myArray", 0, 1.0, 1.0)


    HYP_GpuProgram.ApplyUniformArray_2fv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_2dv(id, "myArray")


    HYP_GpuProgram.AllocUniformArray_3dv

    Description
    Allocates an array of 3D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_3dv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_3dv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y, z [REAL]: value of the element (fp64)

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_3dv(id, "myArray", 0, 1.0, 1.0, 1.0)


    HYP_GpuProgram.ApplyUniformArray_3dv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_3dv(id, "myArray")


    HYP_GpuProgram.AllocUniformArray_4dv

    Description
    Allocates an array of 4D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • count [INTEGER]: number of elements in the array

    Code sample :

    HYP_GpuProgram.AllocUniformArray_4dv(id, "myArray", 20)


    HYP_GpuProgram.SetUniformArrayElement_4dv

    Description
    Sets the value of an element of an uniform array.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name
  • index [INTEGER]: index of the element
  • x, y, z, w [REAL]: value of the element (fp64)

    Code sample :

    HYP_GpuProgram.SetUniformArrayElement_4dv(id, "myArray", 0, 1.0, 1.0, 1.0, 0.1)


    HYP_GpuProgram.ApplyUniformArray_4dv

    Description
    Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gpu program id
  • name [STRING]: uniform name

    Code sample :

    HYP_GpuProgram.ApplyUniformArray_4dv(id, "myArray")




  • Random Projects

    Phong Lighting Multiple Lights
    Phong Lighting Multiple Lights

    2D Shockwave Effect
    2D Shockwave Effect

    Dream Vision Effect
    Dream Vision Effect


    Random Code Samples

    Simple PhysX demo
    Simple PhysX demo

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

    OBJ Format Loading
    OBJ Format Loading



    (C)2009-2010 Geeks3D.com