[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<gpu_program> XML Node
<gpu_program
name=""
active="TRUE"
filename=""
>
<uniform_1i
name=""
x="0"
>
</uniform_1i>
<uniform_2i
name=""
x, y="0"
>
</uniform_2i>
<uniform_3i
name=""
x, y, z="0"
>
</uniform_3i>
<uniform_4i
name=""
x, y, z, w="0"
>
</uniform_4i>
<uniform_1f
name=""
x="0"
>
</uniform_1f>
<uniform_2f
name=""
x, y="0"
>
</uniform_2f>
<uniform_3f
name=""
x, y, z="0"
>
</uniform_3f>
<uniform_4f
name=""
x, y, z, w="0"
>
</uniform_4f>
<uniform_4x4f_view_matrix
name=""
>
</uniform_4x4f_view_matrix>
<uniform_4x4f_projection_matrix
name=""
>
</uniform_4x4f_projection_matrix>
<uniform_4x4f_model_matrix
name=""
>
</uniform_4x4f_model_matrix>
<raw_data
>
</raw_data>
</gpu_program>
<gpu_program>
Allows to load and execute real time shaders. Current shading languages supported: GLSL (OpenGL Shading Language).
gpu_program element has 3 attributes and 12 sub-element(s)
- name [STRING]: name of this XML node.
- active [BOOLEAN]: enables (TRUE) or disables (FALSE) the shader. - Default value = TRUE
- filename [STRING]: location of the shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
<uniform_1i>
Specifies the name and the value of an uniform 1D vector of integers to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_1i element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x [INTEGER]: uniform value. - Default value = 0
<uniform_2i>
Specifies the name and the value of an uniform 2D vector of integers to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_2i element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y [INTEGER]: uniform value. - Default value = 0
<uniform_3i>
Specifies the name and the value of an uniform 3D vector of integers to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_3i element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y, z [INTEGER]: uniform value. - Default value = 0
<uniform_4i>
Specifies the name and the value of an uniform 4D vector of integers to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_4i element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y, z, w [INTEGER]: uniform value. - Default value = 0
<uniform_1f>
Specifies the name and the value of an uniform 1D vector of float to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_1f element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x [REAL]: uniform value. - Default value = 0
<uniform_2f>
Specifies the name and the value of an uniform 2D vector of float to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_2f element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y [REAL]: uniform value. - Default value = 0
<uniform_3f>
Specifies the name and the value of an uniform 3D vector of float to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_3f element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y, z [REAL]: uniform value. - Default value = 0
<uniform_4f>
Specifies the name and the value of an uniform 4D vector of float to pass to the shader. The name of this constant must be declared in the source code of the shader.
uniform_4f element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
- x, y, z, w [REAL]: uniform value. - Default value = 0
<uniform_4x4f_view_matrix>
Specifies the name of a 4x4 matrix to pass to the shader. The value of the matrix is automatically set by GeeXLab (current view matrix).
uniform_4x4f_view_matrix element has 1 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
<uniform_4x4f_projection_matrix>
Specifies the name of a 4x4 matrix to pass to the shader. The value of the matrix is automatically set by GeeXLab (current projection matrix).
uniform_4x4f_projection_matrix element has 1 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
<uniform_4x4f_model_matrix>
Specifies the name of a 4x4 matrix to pass to the shader. The value of the matrix is automatically set by GeeXLab (transformation matrix of the object that is currently rendered).
uniform_4x4f_model_matrix element has 1 attributes and 0 sub-element(s)
- name [STRING]: name of the uniform variable.
<raw_data>
Allows to integrate the source code of a shader directly in the XML code without requiring an external file.
raw_data element has 0 attributes and 0 sub-element(s)
:
<geexlab>
<gpu_program name="simpleShader" >
<raw_data><![CDATA[
[Vertex_Shader]
void main(void)
{
gl_Position = ftransform();
}
[Pixel_Shader]
void main()
{
gl_FragColor = vec4(1.0, 0.5, 0.5, 1.0);
}
]]></raw_data>
</gpu_program>
</geexlab>
|