OLD | NEW |
(Empty) | |
| 1 |
| 2 /* |
| 3 ** Copyright (c) 2012 The Khronos Group Inc. |
| 4 ** |
| 5 ** Permission is hereby granted, free of charge, to any person obtaining a |
| 6 ** copy of this software and/or associated documentation files (the |
| 7 ** "Materials"), to deal in the Materials without restriction, including |
| 8 ** without limitation the rights to use, copy, modify, merge, publish, |
| 9 ** distribute, sublicense, and/or sell copies of the Materials, and to |
| 10 ** permit persons to whom the Materials are furnished to do so, subject to |
| 11 ** the following conditions: |
| 12 ** |
| 13 ** The above copyright notice and this permission notice shall be included |
| 14 ** in all copies or substantial portions of the Materials. |
| 15 ** |
| 16 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 20 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 21 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 22 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 23 */ |
| 24 |
| 25 |
| 26 attribute vec4 gtf_Vertex; |
| 27 uniform mat4 gtf_ModelViewProjectionMatrix; |
| 28 varying vec4 color; |
| 29 |
| 30 void main (void) |
| 31 { |
| 32 int count1 = 0, count2 = 0; |
| 33 int val1 = 0, val2 = 0; |
| 34 for(int i=0;i<10;i++) |
| 35 { |
| 36 count1++; |
| 37 count2 = 0; |
| 38 for(int j=0;j<10;j++) |
| 39 { |
| 40 count2++; |
| 41 if(count2 == 5) |
| 42 continue; |
| 43 else |
| 44 val2 += count2; |
| 45 |
| 46 } |
| 47 |
| 48 |
| 49 if(count1 == 5) |
| 50 continue; |
| 51 else |
| 52 val1 += count1; |
| 53 |
| 54 } |
| 55 float gray; |
| 56 if( (val1 == 50) && (val2 == 500) ) |
| 57 gray=1.0; |
| 58 else gray=0.0; |
| 59 color = vec4(gray, gray, gray, 1.0); |
| 60 gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; |
| 61 } |
OLD | NEW |