summaryrefslogtreecommitdiff
path: root/progs/vp
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-10-15 17:20:30 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-10-15 17:20:30 +0100
commitcf85e413ad7672c1cef73215222ca1caa8e48b30 (patch)
treef6c22fe6664f2512a06653768ca27b17d2294134 /progs/vp
parentd533a5d00ae2d0669e9da41718ee847de0c343aa (diff)
parent055d986efefa310d6ffd1106e565ca2f5964159a (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts: src/mesa/main/context.c
Diffstat (limited to 'progs/vp')
-rw-r--r--progs/vp/vp-tris.c11
-rw-r--r--progs/vp/xform.txt11
2 files changed, 22 insertions, 0 deletions
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 3fe35f7e3e..58014dd48d 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 0000000000..d1548f1f10
--- /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