Quick Links
- Homepage
- Downloads
- Code Sample Pack
- Gallery
- Forum

Documentation
- Overview
- GLSL Programs
- Live Coding
- Hack your first
  GLSL program

- Reference guide

Follow GLSL Hacker

GLSL Hacker @ Twitter

GLSL Hacker

Reference Guide
XML Nodes



» Back to homepage
» Back to Developer's Guide Index

<gpu_program> XML Node


XML Node Summary
<gpu_program
  name=""
  filename=""
  filename_vs=""
  filename_ps=""
  filename_gs=""
  filename_tcs=""
  filename_tes=""
  filename_cs=""
  >
  <raw_data />
  <raw_data_vs />
  <raw_data_ps />
  <raw_data_gs />
  <raw_data_tcs />
  <raw_data_tes />
  <raw_data_cs />
</gpu_program>


<gpu_program>

Description
Allows to load and execute real time shaders written in GLSL.

gpu_program element has 8 attributes and 7 sub-element(s)

Attributes
  • name [STRING]: name of this XML node.
  • 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.
  • filename_vs [STRING]: location of a vertex shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
  • filename_ps [STRING]: location of a pixel shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
  • filename_gs [STRING]: location of a geometry shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
  • filename_tcs [STRING]: location of a tessellation control shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
  • filename_tes [STRING]: location of a tessellation evaluation shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.
  • filename_cs [STRING]: location of a compute shader file relative to the main XML script. Currently the vertex and pixel shaders must be in the same file.

Code sample :

<glsl_hacker>

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


<gpu_program name="shader_v2" >
<raw_data_vs><![CDATA[
void main(void)
{
gl_Position = ftransform();
}
]]></raw_data_vs>

<raw_data_ps><![CDATA[
void main()
{
gl_FragColor = vec4(1.0, 0.5, 0.5, 1.0);
}
]]></raw_data_ps>
</gpu_program>

</glsl_hacker>

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

<raw_data_vs>

Description
Allows to integrate the source code of a vertex shader directly in the XML code without requiring an external file.

raw_data_vs element has 0 attributes and 0 sub-element(s)

<raw_data_ps>

Description
Allows to integrate the source code of a pixel shader directly in the XML code without requiring an external file.

raw_data_ps element has 0 attributes and 0 sub-element(s)

<raw_data_gs>

Description
Allows to integrate the source code of a geometry shader directly in the XML code without requiring an external file.

raw_data_gs element has 0 attributes and 0 sub-element(s)

<raw_data_tcs>

Description
Allows to integrate the source code of a tessellation control shader directly in the XML code without requiring an external file.

raw_data_tcs element has 0 attributes and 0 sub-element(s)

<raw_data_tes>

Description
Allows to integrate the source code of a tessellation evaluation shader directly in the XML code without requiring an external file.

raw_data_tes element has 0 attributes and 0 sub-element(s)

<raw_data_cs>

Description
Allows to integrate the source code of a compute shader directly in the XML code without requiring an external file.

raw_data_cs element has 0 attributes and 0 sub-element(s)


(C)2012 Geeks3D