[ 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
<shader_program> XML Node
<shader_program
name=""
active="TRUE"
filename=""
>
<constant_1i
name=""
x="0"
>
</constant_1i>
<constant_2i
name=""
x="0"
y="0"
>
</constant_2i>
<constant_3i
name=""
x="0"
y="0"
z="0"
>
</constant_3i>
<constant_4i
name=""
x="0"
y="0"
z="0"
w="0"
>
</constant_4i>
<constant_1f
name=""
x="0.0"
>
</constant_1f>
<constant_2f
name=""
x="0.0"
y="0.0"
>
</constant_2f>
<constant_3f
name=""
x="0.0"
y="0.0"
z="0.0"
>
</constant_3f>
<constant_4f
name=""
x="0.0"
y="0.0"
z="0.0"
w="0.0"
>
</constant_4f>
<raw_data
>
</raw_data>
</shader_program>
<shader_program>
Allows to load and execute real time shaders. Current shading languages supported: GLSL (OpenGL Shading Language).
shader_program element has 3 attributes and 9 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.
<constant_1i>
Specifies the name and the value of a 1D vector of integers constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_1i element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [INTEGER]: x componant of the vector. - Default value = 0
<constant_2i>
Specifies the name and the value of a 2D vector of integers constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_2i element has 3 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [INTEGER]: x componant of the vector. - Default value = 0
- y [INTEGER]: y componant of the vector. - Default value = 0
<constant_3i>
Specifies the name and the value of a 3D vector of integers constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_3i element has 4 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [INTEGER]: x componant of the vector. - Default value = 0
- y [INTEGER]: y componant of the vector. - Default value = 0
- z [INTEGER]: z componant of the vector. - Default value = 0
<constant_4i>
Specifies the name and the value of a 4D vector of integers constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_4i element has 5 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [INTEGER]: x componant of the vector. - Default value = 0
- y [INTEGER]: y componant of the vector. - Default value = 0
- z [INTEGER]: z componant of the vector. - Default value = 0
- w [INTEGER]: w componant of the vector. - Default value = 0
<constant_1f>
Specifies the name and the value of a 1D vector of reals (float) constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_1f element has 2 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [REAL]: x componant of the vector. - Default value = 0.0
<constant_2f>
Specifies the name and the value of a 2D vector of reals (float) constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_2f element has 3 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [REAL]: x componant of the vector. - Default value = 0.0
- y [REAL]: y componant of the vector. - Default value = 0.0
<constant_3f>
Specifies the name and the value of a 3D vector of reals (float) constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_3f element has 4 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [REAL]: x componant of the vector. - Default value = 0.0
- y [REAL]: y componant of the vector. - Default value = 0.0
- z [REAL]: z componant of the vector. - Default value = 0.0
<constant_4f>
Specifies the name and the value of a 4D vector of reals (float) constant to pass to the vertex/pixel shader. The name of this constant must be declared in the source code of the shader.
constant_4f element has 5 attributes and 0 sub-element(s)
- name [STRING]: name of the constant (or uniform) variable.
- x [REAL]: x componant of the vector. - Default value = 0.0
- y [REAL]: y componant of the vector. - Default value = 0.0
- z [REAL]: z componant of the vector. - Default value = 0.0
- w [REAL]: w componant of the vector. - Default value = 0.0
<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>
<shader_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>
</shader_program>
</geexlab>
|