aboutsummaryrefslogtreecommitdiffstats
path: root/progs/vpglsl/nestedifs.glsl
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2007-10-25 07:52:59 -0400
committerZack Rusin <[email protected]>2007-10-25 09:04:41 -0400
commit1d26e9c447fd9746b2219edbf65b1991521bcfe7 (patch)
treeb590bb2bbbe9ce240c55981a9ed559d407cc4055 /progs/vpglsl/nestedifs.glsl
parente842b5e5ba738cd214137cca95c6da64492f9f92 (diff)
Fix nested conditionals
Diffstat (limited to 'progs/vpglsl/nestedifs.glsl')
-rw-r--r--progs/vpglsl/nestedifs.glsl13
1 files changed, 13 insertions, 0 deletions
diff --git a/progs/vpglsl/nestedifs.glsl b/progs/vpglsl/nestedifs.glsl
new file mode 100644
index 00000000000..abb235cd65b
--- /dev/null
+++ b/progs/vpglsl/nestedifs.glsl
@@ -0,0 +1,13 @@
+
+void main() {
+ gl_Position = gl_Vertex;
+ if (gl_Position.x < 0.5) {
+ if (gl_Position.y < 0.20) {
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0);
+ } else {
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ gl_FrontColor.y = 1.0;
+ } else
+ gl_FrontColor = gl_Color;
+}