summaryrefslogtreecommitdiffstats
path: root/progs/vpglsl/varfor1f.glsl
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2008-06-12 00:04:30 -0400
committerZack Rusin <[email protected]>2008-06-12 14:15:37 -0400
commitf49dd47dc936587cd9eabddfe370651efc612f9f (patch)
tree62e80e914a1b3d164d5f87878c6c5dad7f1d12c5 /progs/vpglsl/varfor1f.glsl
parent38fdf130d4016197e9ecfa6beeade0362f9622eb (diff)
add some glsl example testing different arrays of uniforms
Diffstat (limited to 'progs/vpglsl/varfor1f.glsl')
-rw-r--r--progs/vpglsl/varfor1f.glsl22
1 files changed, 22 insertions, 0 deletions
diff --git a/progs/vpglsl/varfor1f.glsl b/progs/vpglsl/varfor1f.glsl
new file mode 100644
index 00000000000..9c3e8f2a238
--- /dev/null
+++ b/progs/vpglsl/varfor1f.glsl
@@ -0,0 +1,22 @@
+const int KernelSize = 16;
+uniform float KernelValue1f[KernelSize];
+
+void main(void)
+{
+ int i;
+ vec4 sum = vec4(0.0);
+ vec4 tmp = gl_Color;
+ gl_Position = gl_Vertex;
+
+ for (i = 0; i < KernelSize; ++i) {
+ float x, y, z, w;
+
+ x = KernelValue1f[i]; ++i;
+ y = KernelValue1f[i]; ++i;
+ z = KernelValue1f[i]; ++i;
+ w = KernelValue1f[i];
+
+ sum += tmp * vec4(x, y, z, w);
+ }
+ gl_FrontColor = sum;
+}