fpglsl: a few more useful glsl tests

This commit is contained in:
Zack Rusin 2010-03-10 16:31:18 -05:00
parent a75519cb43
commit a44f362567
5 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,8 @@
void main() {
float sum = 0.0;
do {
sum += 0.1;
break;
} while (true);
gl_FragColor = vec4(sum);
}

View File

@ -0,0 +1,10 @@
void main() {
float sum = 0.0;
do {
sum += 0.1;
if (sum < 0.499999)
continue;
break;
} while (true);
gl_FragColor = vec4(sum);
}

View File

@ -0,0 +1,13 @@
uniform int KernelSizeInt;
void main() {
int i;
vec4 sum = vec4(0.0);
for (i = 0; i < KernelSizeInt; ++i) {
sum.g += 0.25;
if (i > 0)
break;
}
sum.a = 1;
gl_FragColor = sum;
}

View File

@ -0,0 +1,6 @@
void main() {
// this should always be true
if (gl_FragCoord.x >= 0.0) {
gl_FragColor = vec4(0.5, 0.0, 0.5, 1.0);
}
}

9
progs/fpglsl/while2.glsl Normal file
View File

@ -0,0 +1,9 @@
void main() {
float sum = 0.0;
while (true) {
sum += 0.1;
if (sum > 0.8)
break;
}
gl_FragColor = vec4(sum);
}