fix D3D lighting

This commit is contained in:
Chris Danford
2003-09-21 18:54:54 +00:00
parent eebb417840
commit babe533a9e
2 changed files with 5 additions and 6 deletions
-1
View File
@@ -182,7 +182,6 @@ public:
RageColor specular,
RageVector3 dir ) = 0;
void DrawQuad( const RageSpriteVertex v[] ) { DrawQuads(v,4); } /* alias. upper-left, upper-right, lower-left, lower-right */
virtual void DrawQuads( const RageSpriteVertex v[], int iNumVerts ) = 0;
virtual void DrawFan( const RageSpriteVertex v[], int iNumVerts ) = 0;
+5 -5
View File
@@ -906,11 +906,11 @@ void RageDisplay_D3D::SetLightDirectional(
ZERO( light );
light.Type = D3DLIGHT_DIRECTIONAL;
/* Without this, characters are lit from behind, so the directional light can
* barely be seen. I'm not sure that this is generally correct, since I don't
* know how the coordinate systems are different, but it works for
* DancingCharacters::DrawPrimitives. XXX: figure out exactly why this is needed */
float position[] = { -dir.x, -dir.y, -dir.z };
/* Z for lighting is flipped for D3D compared to OpenGL.
* XXX: figure out exactly why this is needed. Our transforms
* are probably goofed up, but the Z test is the same for both
* API's, so I'm not sure why we don't see other weirdness. -Chris */
float position[] = { dir.x, dir.y, -dir.z };
memcpy( &light.Direction, position, sizeof(position) );
memcpy( &light.Diffuse, diffuse, sizeof(diffuse) );
memcpy( &light.Ambient, ambient, sizeof(ambient) );