GLSL Hacker
FEATURES DOWNLOAD GALLERY BLOG LEARN



Back to Reference Guide Index

<gpu_program> XML node

XML Node Summary

<gpu_program
  name=""
  filename=""
  absolute_path="0"
  filename_vs=""
  absolute_path_vs="0"
  filename_ps=""
  absolute_path_ps="0"
  filename_gs=""
  absolute_path_gs="0"
  filename_tcs=""
  absolute_path_tcs="0"
  filename_tes=""
  absolute_path_tes="0"
  filename_cs=""
  absolute_path_cs="0"
  >
  <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.


Attributes

  • name [STRING]: name of this XML node.
  • filename [STRING]: location of the complete GLSL progam file.
  • absolute_path [INTEGER]: absolute (1) or relative (0) path for the filename. - Default value = 0
  • 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.
  • absolute_path_vs [INTEGER]: absolute (1) or relative (0) path for the filename_vs. - Default value = 0
  • 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.
  • absolute_path_ps [INTEGER]: absolute (1) or relative (0) path for the filename_ps. - Default value = 0
  • 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.
  • absolute_path_gs [INTEGER]: absolute (1) or relative (0) path for the filename_gs. - Default value = 0
  • 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.
  • absolute_path_tcs [INTEGER]: absolute (1) or relative (0) path for the filename_tcs. - Default value = 0
  • 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.
  • absolute_path_tes [INTEGER]: absolute (1) or relative (0) path for the filename_tes. - Default value = 0
  • 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.
  • absolute_path_cs [INTEGER]: absolute (1) or relative (0) path for the filename_cs. - Default value = 0

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

Description

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


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

Description

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


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

Description

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

2013-2015 Geeks3D. All Rights Reserved.

.:- G3D Network -:.