"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
XML Nodes



Back to homepage
Back to Developer's Guide Index

<shader_program> XML Node


XML Node Summary
<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>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • name [STRING]: name of the constant (or uniform) variable.
  • x [INTEGER]: x componant of the vector. - Default value = 0

<constant_2i>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • name [STRING]: name of the constant (or uniform) variable.
  • x [REAL]: x componant of the vector. - Default value = 0.0

<constant_2f>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • 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>

Description
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)

Attributes
  • 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>

Description
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)
Code sample :

<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>
Random Projects

Pixelation PostFX
Pixelation PostFX

Thermal Vision PostFX
Thermal Vision PostFX

Gaussian Blur PostFX
Gaussian Blur PostFX


Random Code Samples

Python - PyOpenGL
Python - PyOpenGL

Revolute joints
Revolute joints

Python - NetworkX
Python - NetworkX



(C)2009-2010 Geeks3D.com