| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
vertex_program myGLSLVertexProgram glsl
{
source myGLSLVertexProgram.txt
}
|
vertex_program myExternalGLSLFunction1 glsl
{
source myExternalGLSLfunction1.txt
}
vertex_program myExternalGLSLFunction2 glsl
{
source myExternalGLSLfunction2.txt
}
vertex_program myGLSLVertexProgram1 glsl
{
source myGLSLfunction.txt
attach myExternalGLSLFunction1 myExternalGLSLFunction2
}
vertex_program myGLSLVertexProgram2 glsl
{
source myGLSLfunction.txt
attach myExternalGLSLFunction1
}
|
varying vec2 UV;
uniform sampler2D diffuseMap;
void main(void)
{
gl_FragColor = texture2D(diffuseMap, UV);
}
|
fragment_program myFragmentShader glsl
{
source example.frag
}
material exampleGLSLTexturing
{
technique
{
pass
{
fragment_program_ref myFragmentShader
{
param_named diffuseMap int 0
}
texture_unit
{
texture myTexture.jpg 2d
}
}
}
}
|
material exampleGLSLmatrixUniforms
{
technique matrix_passing
{
pass examples
{
vertex_program_ref myVertexShader
{
// mat4 uniform
param_named OcclusionMatrix matrix4x4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0
// or
param_named ViewMatrix float16 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
// mat3
param_named TextRotMatrix float9 1 0 0 0 1 0 0 0 1
}
fragment_program_ref myFragmentShader
{
// mat2 uniform
param_named skewMatrix float4 0.5 0 -0.5 1.0
}
}
}
}
|
// in your GLSL #ifdef CLEVERTECHNIQUE // some clever stuff here #else // normal technique #endif #if NUM_THINGS==2 // Some specific code #else // something else #endif // in your program definition preprocessor_defines CLEVERTECHNIQUE,NUMTHINGS=2 |
geometry_program Ogre/GPTest/Swizzle_GP_GLSL glsl
{
source SwizzleGP.glsl
input_operation_type triangle_list
output_operation_type line_strip
max_output_vertices 6
}
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |