From 5f80dad7fd03ca811f2b0561269be0180970dbf8 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 10 Mar 2010 15:37:18 -0500 Subject: fpglsl: add some for and while loops --- progs/fpglsl/for.glsl | 11 +++++++++++ progs/fpglsl/while.glsl | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 progs/fpglsl/for.glsl create mode 100644 progs/fpglsl/while.glsl (limited to 'progs/fpglsl') diff --git a/progs/fpglsl/for.glsl b/progs/fpglsl/for.glsl new file mode 100644 index 00000000000..6aa03d6ef48 --- /dev/null +++ b/progs/fpglsl/for.glsl @@ -0,0 +1,11 @@ +uniform int KernelSizeInt; + +void main() { + int i; + vec4 sum = vec4(0.0); + for (i = 0; i < KernelSizeInt; ++i) { + sum.g += 0.25; + } + sum.a = 1; + gl_FragColor = sum; +} diff --git a/progs/fpglsl/while.glsl b/progs/fpglsl/while.glsl new file mode 100644 index 00000000000..05fb860ddcf --- /dev/null +++ b/progs/fpglsl/while.glsl @@ -0,0 +1,7 @@ +void main() { + float sum = 0.0; + while (sum < 0.499999) { + sum += 0.1; + } + gl_FragColor = vec4(sum); +} -- cgit v1.2.1