mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
vp: add simple vertex transform test
This commit is contained in:
parent
568e96b453
commit
5548a3072f
2 changed files with 22 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
11
progs/vp/xform.txt
Normal file
11
progs/vp/xform.txt
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue