From 103a4bd71136b14424a4af5a2eadf56c51692115 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 23 Mar 2009 18:37:33 +0000 Subject: [PATCH] progs/fp: pass texcoord to triangle, add a test shader --- progs/fp/fp-tri.c | 6 ++++++ progs/fp/{kill-pos.txt => kil-pos.txt} | 0 progs/fp/kil-texcoord-sgt.txt | 8 ++++++++ 3 files changed, 14 insertions(+) rename progs/fp/{kill-pos.txt => kil-pos.txt} (100%) create mode 100644 progs/fp/kil-texcoord-sgt.txt diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c index bc490c05201..6c15540d38d 100644 --- a/progs/fp/fp-tri.c +++ b/progs/fp/fp-tri.c @@ -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/kill-pos.txt b/progs/fp/kil-pos.txt similarity index 100% rename from progs/fp/kill-pos.txt rename to progs/fp/kil-pos.txt diff --git a/progs/fp/kil-texcoord-sgt.txt b/progs/fp/kil-texcoord-sgt.txt new file mode 100644 index 00000000000..c74fd10dacb --- /dev/null +++ b/progs/fp/kil-texcoord-sgt.txt @@ -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 -- 2.30.2