progs/fp: pass texcoord to triangle, add a test shader
authorKeith Whitwell <keithw@vmware.com>
Mon, 23 Mar 2009 18:37:33 +0000 (18:37 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 23 Mar 2009 18:39:36 +0000 (18:39 +0000)
progs/fp/fp-tri.c
progs/fp/kil-pos.txt [new file with mode: 0644]
progs/fp/kil-texcoord-sgt.txt [new file with mode: 0644]
progs/fp/kill-pos.txt [deleted file]

index bc490c05201f08f32a6b37340959edd6d5be7000..6c15540d38d121fe946e6f8b80f4d194d59ba120 100644 (file)
@@ -210,11 +210,17 @@ static void Display(void)
    glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0);
    glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0);
    glBegin(GL_TRIANGLES);
+
    glColor3f(0,0,1);
+   glTexCoord3f(1,1,0);
    glVertex3f( 0.9, -0.9, -30.0);
+
    glColor3f(1,0,0);
+   glTexCoord3f(1,-1,0);
    glVertex3f( 0.9,  0.9, -30.0);
+
    glColor3f(0,1,0);
+   glTexCoord3f(-1,0,0);
    glVertex3f(-0.9,  0.0, -30.0);
    glEnd();
 
diff --git a/progs/fp/kil-pos.txt b/progs/fp/kil-pos.txt
new file mode 100644 (file)
index 0000000..5ff4f6f
--- /dev/null
@@ -0,0 +1,9 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0.xy, fragment.position, {125}.x;
+MOV R0.zw, {0}.x;
+DP3 R0, R0, R0;
+SUB R0.x, R0, {10000}.x;
+KIL -R0.x;
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/kil-texcoord-sgt.txt b/progs/fp/kil-texcoord-sgt.txt
new file mode 100644 (file)
index 0000000..c74fd10
--- /dev/null
@@ -0,0 +1,8 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0.xy, fragment.texcoord[0], fragment.texcoord[0];
+ADD R0.x, R0.x, R0.y;
+SGE R0.y, R0.x, fragment.texcoord[0].w;
+KIL -R0.y;
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/kill-pos.txt b/progs/fp/kill-pos.txt
deleted file mode 100644 (file)
index 5ff4f6f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-!!ARBfp1.0
-TEMP R0;
-SUB R0.xy, fragment.position, {125}.x;
-MOV R0.zw, {0}.x;
-DP3 R0, R0, R0;
-SUB R0.x, R0, {10000}.x;
-KIL -R0.x;
-MOV result.color, fragment.color;
-END