[ Back to Geeks3D.com ]
 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
Real time shading language library
Number of functions: 47
HYP_GpuProgram.GetId
Returns the gpu program id from its name (declared in XML).
: Lua - Python
name [STRING]: gpu program name.
id [INTEGER]: shader id
:
id = HYP_GpuProgram.GetId("simpleShader")
HYP_GpuProgram.GetOpenGLId
Gets the OpenGL gpu program name or ID. This function is useful in post direct rendering scripts with HYP_Renderer.GpuProgramxxxxxx() functions.
: Lua - Python
id [INTEGER]: gpu program id
glId [INTEGER]: OpenGL gpu program name
:
glId = HYP_GpuProgram.GetOpenGLId(id)
HYP_GpuProgram.Destroy
Destroys an existing gpu program object.
: Lua - Python
id [INTEGER]: gpu program id
:
HYP_GpuProgram.Destroy(id)
HYP_GpuProgram.Create
Creates a new gpu program.
: Lua - Python
id [INTEGER]: gpu program id
:
id = HYP_GpuProgram.Create()
HYP_GpuProgram.CreateFromFile
Creates a new gpu program from a source code file.
: Lua - Python
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).
id [INTEGER]: gpu program id
:
id = HYP_GpuProgram.CreateFromFile("data/myGlslShader.glsl", 0)
HYP_GpuProgram.UpdateSourceCode
Creates a new gpu program from a source code memory buffer.
: Lua - Python
id [INTEGER]: gpu program id
sourceCode [STRING]: shader source code buffer. Currently only GLSL shaders are supported.
:
id = HYP_GpuProgram.Create()
HYP_GpuProgram.UpdateSourceCode(id, shaderBuffer)
HYP_GpuProgram.Activate
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.
: Lua
id [INTEGER]: gpu program id
:
HYP_GpuProgram.Activate(id)
HYP_GpuProgram.Deactivate
Unbinds the gpu program.
: Lua
id [INTEGER]: gpu program id
:
HYP_GpuProgram.Deactivate(id)
HYP_GpuProgram.SetUniform_1i
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x [INTEGER]: uniform value.
:
HYP_GpuProgram.SetConstant_1i(id, "varX", x)
HYP_GpuProgram.SetUniform_2i
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y [INTEGER]: uniform value.
:
HYP_GpuProgram.SetConstant_2i(id, "varXY", x, y)
HYP_GpuProgram.SetUniform_3i
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z [INTEGER]: uniform value.
:
HYP_GpuProgram.SetConstant_3i(id, "varXYZ", x, y, z)
HYP_GpuProgram.SetUniform_4i
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z, w [INTEGER]: uniform value.
:
HYP_GpuProgram.SetConstant_4i(id, "varXYZW", x, y, z, w)
HYP_GpuProgram.SetUniform_1f
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x [REAL]: uniform value.
:
elapsedTime = HYP_Utils.GetElapsedTime() * 0.001
HYP_GpuProgram.SetUniform_1f(id, "time", elapsedTime)
HYP_GpuProgram.SetUniform_2f
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y [REAL]: uniform value.
:
HYP_GpuProgram.SetUniform_2f(id, "myVec2", x, y)
HYP_GpuProgram.SetUniform_3f
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z [REAL]: uniform value.
:
HYP_GpuProgram.SetUniform_3f(id, "myVec3", x, y, z)
HYP_GpuProgram.SetUniform_4f
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z, w [REAL]: uniform value.
:
HYP_GpuProgram.SetUniform_4f(id, "myVec4", x, y, z, w)
HYP_GpuProgram.SetUniform_1d
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x [REAL]: uniform value (fp64).
:
HYP_GpuProgram.SetUniform_1d(id, "xx", x)
HYP_GpuProgram.SetUniform_2d
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y [REAL]: uniform value (fp64).
:
HYP_GpuProgram.SetUniform_2d(id, "myVec2d", xx, yy)
HYP_GpuProgram.SetUniform_3d
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z [REAL]: uniform value (fp64).
:
HYP_GpuProgram.SetUniform_3d(id, "myVec3d", xx, yy, zz)
HYP_GpuProgram.SetUniform_4d
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
x, y, z, w [REAL]: uniform value (fp64).
:
HYP_GpuProgram.SetUniform_4d(id, "myVec4d", xx, yy, zz, ww)
HYP_GpuProgram.SetUniform_4x4f
Specifies the value of an uniform 4x4 matrix. The name of this uniform must be declared in the source code of the shader.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
m0, ..., m15 [REAL]: 16 values of the 4x4 matrix in OpenGL conventions
:
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
Specifies the value of an uniform 4x4 matrix. The name of this uniform must be declared in the source code of the shader.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
m0, ..., m15 [REAL]: 16 values (double, fp64) of the 4x4 matrix in OpenGL conventions
:
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
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.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.SetUniform_4x4f_Model(id, "modelMat")
HYP_GpuProgram.AllocUniformArray_1fv
Allocates an array of 1D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_1fv(id, "convolutionShader", 9)
HYP_GpuProgram.SetUniformArrayElement_1fv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x [REAL]: value of the element
:
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
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_1fv(id, "convolutionShader")
HYP_GpuProgram.AllocUniformArray_2fv
Allocates an array of 2D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_2fv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_2fv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x, y [REAL]: value of the element
:
HYP_GpuProgram.SetUniformArrayElement_2fv(id, "myArray", 0, 1.0, 1.0)
HYP_GpuProgram.ApplyUniformArray_2fv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_2fv(id, "myArray")
HYP_GpuProgram.AllocUniformArray_3fv
Allocates an array of 3D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_3fv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_3fv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x, y, z [REAL]: value of the element
:
HYP_GpuProgram.SetUniformArrayElement_3fv(id, "myArray", 0, 1.0, 1.0, 1.0)
HYP_GpuProgram.ApplyUniformArray_3fv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_3fv(id, "myArray")
HYP_GpuProgram.AllocUniformArray_4fv
Allocates an array of 4D float in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_4fv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_4fv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x, y, z, w [REAL]: value of the element
:
HYP_GpuProgram.SetUniformArrayElement_4fv(id, "myArray", 0, 1.0, 1.0, 1.0, 0.1)
HYP_GpuProgram.ApplyUniformArray_4fv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_4fv(id, "myArray")
HYP_GpuProgram.AllocUniformArray_1dv
Allocates an array of 1D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_1fv(id, "convolutionShader", 9)
HYP_GpuProgram.SetUniformArrayElement_1dv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x [REAL]: value of the element (fp64)
:
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
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_1dv(id, "convolutionShader")
HYP_GpuProgram.AllocUniformArray_2dv
Allocates an array of 2D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_2dv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_2dv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x, y [REAL]: value of the element (fp64)
:
HYP_GpuProgram.SetUniformArrayElement_2dv(id, "myArray", 0, 1.0, 1.0)
HYP_GpuProgram.ApplyUniformArray_2fv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_2dv(id, "myArray")
HYP_GpuProgram.AllocUniformArray_3dv
Allocates an array of 3D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_3dv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_3dv
Sets the value of an element of an uniform array.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
index [INTEGER]: index of the element
x, y, z [REAL]: value of the element (fp64)
:
HYP_GpuProgram.SetUniformArrayElement_3dv(id, "myArray", 0, 1.0, 1.0, 1.0)
HYP_GpuProgram.ApplyUniformArray_3dv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_3dv(id, "myArray")
HYP_GpuProgram.AllocUniformArray_4dv
Allocates an array of 4D double in order to create an uniform array. Memory is freed when the gpu program is destroyed.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
count [INTEGER]: number of elements in the array
:
HYP_GpuProgram.AllocUniformArray_4dv(id, "myArray", 20)
HYP_GpuProgram.SetUniformArrayElement_4dv
Sets the value of an element of an uniform array.
: Lua - Python
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)
:
HYP_GpuProgram.SetUniformArrayElement_4dv(id, "myArray", 0, 1.0, 1.0, 1.0, 0.1)
HYP_GpuProgram.ApplyUniformArray_4dv
Applies the uniform array to the renderer. The gpu program must be active (bound). This function is useful in post direct rendering scripts.
: Lua - Python
id [INTEGER]: gpu program id
name [STRING]: uniform name
:
HYP_GpuProgram.ApplyUniformArray_4dv(id, "myArray")
|