1 void test_function(const in int in_int, inout int out_int);
\r
2 int test_function1(in int in_int, inout int out_int);
\r
4 int test_function1(in int in_int1, inout int , out int);
\r
5 int test_function1(in int in_int1, inout int , out int);
\r
7 uniform float array_float[2];
\r
22 varying struct light3 {
\r
26 attribute struct light4 {
\r
35 uniform light3 uniformLight3;
\r
37 uniform struct light6 {
\r
40 uniform light6 uniformLight6;
\r
54 light3 struct_var = light3(5.0);
\r
56 // Attribtue variables can only be Global
\r
57 attribute float flt_attrib;
\r
58 attribute vec2 vec2_attrib;
\r
59 attribute vec3 vec3_attrib;
\r
60 attribute vec4 vec4_attrib;
\r
61 attribute mat2 mat2_attrib;
\r
62 attribute mat3 mat3_attrib;
\r
63 attribute mat4 mat4_attrib;
\r
65 uniform float flt_uniform;
\r
66 uniform vec3 uniform_vec3;
\r
67 uniform mat3 uniform_mat3;
\r
69 uniform sampler1D samp[];
\r
70 uniform sampler1D samp1;
\r
72 const struct light12 {
\r
74 } uniform_struct = light12(2);
\r
76 varying vec3 varying_vec3;
\r
77 varying vec2 varying_vec2;
\r
78 varying vec4 varying_vec4;
\r
79 varying mat4 varying_mat4;
\r
80 varying mat2 varying_mat2;
\r
81 varying mat3 varying_mat3;
\r
82 varying float varying_flt;
\r
84 float frequencies[2];
\r
86 void test_function2(int func_int)
\r
90 void test_function3(light3);
\r
91 void test_function4(light5 ll20);
\r
92 void test_function5(light1);
\r
93 light6 test_function6(int a);
\r
95 const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0;
\r
96 const bool BoolConst1 = true && true || false;
\r
97 const bool BoolConst2 = false || !false && false;
\r
102 int test_int1 = 42;
\r
104 struct structMain {
\r
112 testStruct.i = 5.0 ;
\r
113 struct_var.i = 5.0;
\r
115 structMain newStruct, newStruct1;
\r
116 testStruct = newStruct;
\r
117 newStruct = newStruct1;
\r
119 lightVar.light2.f = 1.1;
\r
124 const struct const_struct {
\r
126 } const_struct_inst = const_struct(1.0);
\r
129 ll1.light2 = ll2.light2;
\r
130 ll1.light2 = ll1.light2;
\r
131 ll1.light2.f = ll2.light2.f;
\r
132 ll1.light2.f = ll1.light2.f;
\r
140 structMain newStruct2[2];
\r
141 newStruct2[0].i = 1.1;
\r
143 ll7[0].light8.light9.light10.f = 1.1;
\r
146 bool test_bool4 = false ;
\r
148 bool test_bool5 = 1.2 > 3.0 ;
\r
150 int test_int2 = 047;
\r
151 int test_int4 = 0xa8; // testing for hexadecimal numbers
\r
153 float test_float1 = 1.5;
\r
154 float test_float2 = .01;
\r
155 float test_float3 = 10.;
\r
156 float test_float4 = 10.01;
\r
157 float test_float5 = 23e+2;
\r
158 float test_float6 = 23E-3;
\r
159 float test_float8 = 23E2;
\r
160 bool test_bool6 = BoolConst1 && ! (test_int1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (test_float1 != 0.0);
\r
162 vec4 color = vec4(0.0, 1.0, 0.0, 1.0);
\r
163 vec4 color2 = vec4(0.0);
\r
165 vec3 color4 = vec3(test_float8);
\r
167 ivec4 test_int_vect1 = ivec4(1.0,1.0,1.0,1.0);
\r
168 ivec3 test_int_vec3 = ivec3(1, 1, 1) ;
\r
170 bvec4 test_bool_vect1 = bvec4(1., 1., 1. , 1. );
\r
172 vec2 test_vec2 = vec2(1., 1.);
\r
173 vec2 test_vec3 = vec2(1., 1);
\r
174 vec4 test_vec4 = vec4(test_int_vect1);
\r
176 vec2 test_vec5 = vec2(color4);
\r
177 vec3 test_vec7 = vec3(color);
\r
178 vec3 test_vec8 = vec3(test_vec2, test_float4);
\r
179 vec3 test_vec9 = vec3(test_float4, test_vec2);
\r
181 vec4 test_vec10 = vec4(test_vec9, 0.01);
\r
182 vec4 test_vec11 = vec4(0.01, test_vec9);
\r
184 vec4 test_vec12 = vec4(test_vec2, test_vec2);
\r
186 mat2 test_mat2 = mat2(test_float3);
\r
187 mat3 test_mat3 = mat3(test_float3);
\r
188 mat4 test_mat4 = mat4(test_float3);
\r
190 mat2 test_mat7 = mat2(test_vec2, test_vec2);
\r
191 mat2 test_mat8 = mat2(01.01, 2.01, 3.01, 4.01);
\r
193 mat3 test_mat9 = mat3(test_vec7, test_vec7, test_vec7);
\r
194 mat4 test_mat10 = mat4(test_vec10, test_vec10, test_vec10, test_vec10);
\r
195 test_mat10[1] = test_vec10;
\r
198 mat2 test_mat12 = mat2(test_vec2, 0.01, 0.01);
\r
199 mat2 test_mat13 = mat2(0.01, 5., test_vec2);
\r
200 mat2 test_mat15 = mat2(0.1, 5., test_vec2 );
\r
202 //mat2 test_mat16 = mat2(test_mat9);
\r
203 //mat2 test_mat17 = mat2(test_mat10);
\r
208 while(test_float1 < 1.0);
\r
213 const int array_index = 2;
\r
214 freq2[test_int1] = 1.9 ;
\r
215 freq2[array_index] = 1.8;
\r
217 const int const_int = 5;
\r
219 test_float1 = varying_flt;
\r
223 test_function(test_int1, test_int1);
\r
224 test_function(test_int1, intArray[2]);
\r
226 vec3 vv = vec3(test_function1(test_int1, out_int));
\r
227 bool bool_var = true;
\r
228 int test_int6 = int(bool_var);
\r
229 test_float1 = float(bool_var);
\r
230 test_float1 = float(test_int6);
\r
231 test_int6 = int(test_float1);
\r
232 bool_var = bool(test_int6);
\r
233 bool_var = bool(test_float1);
\r
234 test_float1 = float(test_vec9);
\r
236 test_vec2.x = 1.2;
\r
237 test_vec2.y = 1.4;
\r
241 color.zy = test_vec2;
\r
243 test_vec2[1] = 1.1;
\r
245 test_mat2[0][0] = 1.1;
\r
247 test_float1 += 1.0;
\r
248 test_float1 -= 1.0;
\r
249 test_float1 *= 1.0;
\r
250 test_float1 /= 1.0;
\r
252 test_mat12 *= test_mat13 ;
\r
253 test_mat12 *= test_float1;
\r
254 test_vec2 *= test_float1;
\r
255 test_vec2 *= test_mat12;
\r
264 test_vec2 = test_vec2 + test_float1;
\r
265 test_vec2 = test_float1 + test_vec2;
\r
267 test_mat12 = test_mat12 * test_mat13;
\r
268 test_vec2 = test_vec2 * test_vec5;
\r
273 bool test_bool2 = test_float2 > test_float3;
\r
275 bool test_bool3 = test_int1 > test_int6 ;
\r
277 test_bool3 = test_vec2 == test_vec5;
\r
279 test_bool2 = test_bool3 && test_bool4;
\r
280 test_bool2 = test_bool3 || test_bool4;
\r
281 test_bool2 = test_bool3 ^^ test_bool4;
\r
283 test_bool2 = !test_bool3;
\r
285 test_bool3 = !(test_int1 > test_int6) ;
\r
287 test_float1 = test_int1 > test_int6 ? test_float2 : test_float3;
\r
288 test_vec2 = test_int1 > test_int6 ? test_vec2 : test_vec5;
\r
294 if(test_float1 > test_float2)
\r
308 for(int for_int=0; for_int < 5; for_int++)
\r
310 // do nothing as such
\r
314 for(; test_bool2; )
\r
319 for(; test_bool2 = (test_float1 > test_float2); )
\r
323 for(int for_int1; test_bool2; )
\r
328 for(; test_bool2; test_float1++)
\r
333 while(bool b = (test_float1 > test_float2))
\r
348 while( test_bool2 )
\r
356 } while(test_bool2);
\r
359 // VERTEX SHADER ONLY VARIABLES
\r
360 gl_PointSize = 4.0;
\r
361 gl_ClipVertex = vec4(2.0, 3.0, 1.0, 1.1);
\r
363 gl_Position = vec4(2.0, 3.0, 1.0, 1.1);
\r
364 gl_Position = gl_Vertex;
\r
367 // VERTEX SHADER BUILT-IN ATTRIBUTES
\r
369 vec4 builtInV4 = gl_Color + gl_SecondaryColor + gl_Vertex + gl_MultiTexCoord0 + gl_MultiTexCoord1 + gl_MultiTexCoord2 + gl_MultiTexCoord3 + gl_MultiTexCoord4 + gl_MultiTexCoord5 + gl_MultiTexCoord6 + gl_MultiTexCoord7;
\r
372 int builtInI = gl_MaxLights + gl_MaxClipPlanes + gl_MaxTextureUnits + gl_MaxTextureCoords + gl_MaxVertexAttribs + gl_MaxVertexUniformComponents + gl_MaxVaryingFloats + gl_MaxVertexTextureImageUnits + gl_MaxCombinedTextureImageUnits + gl_MaxTextureImageUnits + gl_MaxFragmentUniformComponents + gl_MaxDrawBuffers ;
\r
375 mat4 builtInM4 = gl_ModelViewMatrix + gl_ModelViewProjectionMatrix + gl_ProjectionMatrix;
\r
379 gl_TextureMatrix[gl_MaxTextureCoords-1];
\r
383 gl_DepthRange.near ;
\r
385 test_float1 = gl_DepthRange.near;
\r
386 test_float1 = gl_DepthRange.far;
\r
387 test_float1 = gl_DepthRange.diff;
\r
389 gl_ClipPlane[gl_MaxClipPlanes-1] ;
\r
394 gl_Point.fadeThresholdSize ;
\r
395 gl_Point.distanceConstantAttenuation;
\r
396 gl_Point.distanceLinearAttenuation ;
\r
397 gl_Point.distanceQuadraticAttenuation;
\r
399 gl_MaterialParameters test;
\r
400 gl_FrontMaterial.emission;
\r
402 color = gl_FrontMaterial.emission;
\r
403 color = gl_FrontMaterial.ambient;
\r
404 color = gl_FrontMaterial.diffuse;
\r
405 color = gl_FrontMaterial.specular;
\r
406 test_float1 = gl_FrontMaterial.shininess;
\r
408 gl_LightSourceParameters lightSource;
\r
410 float builtInFloat1 = gl_LightSource[0].spotExponent;
\r
411 color = gl_LightSource[0].ambient;
\r
412 color = lightSource.ambient;
\r
413 color = lightSource.diffuse;
\r
414 color = lightSource.specular;
\r
415 color = lightSource.position;
\r
416 color = lightSource.halfVector;
\r
417 color4 = lightSource.spotDirection;
\r
418 test_float1 = lightSource.spotExponent;
\r
419 test_float1 = lightSource.spotCutoff;
\r
420 test_float1 = lightSource.spotCosCutoff;
\r
421 test_float1 = lightSource.constantAttenuation;
\r
422 test_float1 = lightSource.linearAttenuation;
\r
423 test_float1 = lightSource.quadraticAttenuation;
\r
425 color = gl_LightModel.ambient;
\r
427 gl_LightModelParameters lightModel;
\r
428 color = gl_LightModel.ambient;
\r
429 color = lightModel.ambient;
\r
431 color = gl_FrontLightModelProduct.sceneColor ;
\r
433 gl_LightModelProducts lightModelProd;
\r
435 color = lightModelProd.sceneColor;
\r
436 color = gl_FrontLightModelProduct.sceneColor;
\r
438 color = gl_FrontLightProduct[0].ambient;
\r
439 color = gl_FrontLightProduct[0].ambient;
\r
440 gl_LightProducts lightProd;
\r
442 color = lightProd.ambient;
\r
443 color = lightProd.diffuse;
\r
444 color = lightProd.specular;
\r
447 color = gl_TextureEnvColor[gl_MaxTextureUnits-1];
\r
449 color = gl_EyePlaneS[gl_MaxTextureCoords-1] ;
\r
451 color = gl_EyePlaneT[gl_MaxTextureCoords-1];
\r
453 color = gl_EyePlaneR[gl_MaxTextureCoords-1];
\r
455 color = gl_EyePlaneQ[gl_MaxTextureCoords-1];
\r
457 color = gl_ObjectPlaneS[gl_MaxTextureCoords-1];
\r
459 color = gl_ObjectPlaneT[gl_MaxTextureCoords-1] ;
\r
461 color = gl_ObjectPlaneR[gl_MaxTextureCoords-1];
\r
463 color = gl_ObjectPlaneQ[gl_MaxTextureCoords-1];
\r
465 test_float1 = gl_Fog.density ;
\r
466 test_float1 = gl_Fog.start ;
\r
467 test_float1 = gl_Fog.end ;
\r
468 test_float1 = gl_Fog.scale ;
\r
469 color = gl_Fog.color ;
\r
471 gl_FrontColor = vec4(1.0, 1.0, 1.0, 1.0);
\r
472 gl_BackColor = vec4(1.0, 1.0, 1.0, 1.0);
\r
473 gl_FrontSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
\r
474 gl_BackSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
\r
477 // VARYING VARIABLES AVAILABLE IN FRAGMENT AND VERTEX SHADERS BOTH
\r
478 gl_TexCoord[0] = vec4(1.0, 1.0, 1.0, 1.0);
\r
479 gl_FogFragCoord = 1.0;
\r
483 void test_function(const in int in_int, inout int out_int)
\r
490 int test_function1(in int in_int1, inout int , out int)
\r
497 void test_function3(light3 ll)
\r
503 void test_function4(light5 ll20)
\r
508 void test_function5(light1 struct_light1)
\r
510 struct_light1.light2.a = 1;
\r
512 struct_light1.light2.f = ll5.i;
\r
513 struct_light1.light2.f++;
\r
514 struct_light1.light2.a++;
\r
517 light6 test_function6(int a)
\r
521 light7 funcStruct1;
\r
528 return funcStruct;
\r
531 float test_function7(light1 ll1, int light1 )
\r