Mesa (gallium-0.2): vp: add simple vertex transform test
Keith Whitwell
keithw at kemper.freedesktop.org
Wed Oct 15 16:25:20 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: 5548a3072f73b8868746b640535c4774657dc306
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5548a3072f73b8868746b640535c4774657dc306
Author: Keith Whitwell <keith at tungstengraphics.com>
Date: Tue Oct 14 13:52:38 2008 +0100
vp: add simple vertex transform test
---
progs/vp/vp-tris.c | 11 +++++++++++
progs/vp/xform.txt | 11 +++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 3fe35f7..58014dd 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -155,6 +155,17 @@ static void Init( void )
printf("errorpos: %d\n", errorpos);
printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
}
+
+ {
+ const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+ const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+ const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+ const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+ }
}
diff --git a/progs/vp/xform.txt b/progs/vp/xform.txt
new file mode 100644
index 0000000..d1548f1
--- /dev/null
+++ b/progs/vp/xform.txt
@@ -0,0 +1,11 @@
+!!ARBvp1.0
+PARAM Emission = state.material.emission;
+PARAM Ambient = state.material.ambient;
+PARAM Diffuse = state.material.diffuse;
+PARAM Specular = state.material.specular;
+DP4 result.position.x, Ambient, vertex.position;
+DP4 result.position.y, Diffuse, vertex.position;
+DP4 result.position.z, Specular, vertex.position;
+DP4 result.position.w, Emission, vertex.position;
+MOV result.color, vertex.color;
+END
More information about the mesa-commit
mailing list