From a3ed21da365d2d1a53f7613ea42f4f8d417e112e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 21 Jan 2005 06:14:20 +0000 Subject: [PATCH] turn off sphere mapping on tex unit 0 after rendering --- stepmania/src/Model.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 11d84f3702..9fa1c4cdb6 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -352,14 +352,14 @@ void Model::DrawPrimitives() { // render the diffuse texture DISPLAY->SetTexture( 0, mat.diffuse.GetCurrentTexture() ); - DISPLAY->SetSphereEnironmentMapping( mat.diffuse.m_bSphereMapped ); + DISPLAY->SetSphereEnivronmentMapping( mat.diffuse.m_bSphereMapped ); DrawMesh( i ); // render the additive texture if( mat.alpha.GetCurrentTexture() ) { DISPLAY->SetTexture( 0, mat.alpha.GetCurrentTexture() ); - DISPLAY->SetSphereEnironmentMapping( mat.alpha.m_bSphereMapped ); + DISPLAY->SetSphereEnivronmentMapping( mat.alpha.m_bSphereMapped ); // UGLY: This overrides the Actor's BlendMode DISPLAY->SetBlendMode( BLEND_ADD ); DISPLAY->SetTextureFiltering( true ); @@ -370,19 +370,23 @@ void Model::DrawPrimitives() { // render the diffuse texture with texture unit 1 DISPLAY->SetTexture( 0, mat.diffuse.GetCurrentTexture() ); - DISPLAY->SetSphereEnironmentMapping( mat.diffuse.m_bSphereMapped ); + DISPLAY->SetSphereEnivronmentMapping( mat.diffuse.m_bSphereMapped ); // render the additive texture with texture unit 2 if( mat.alpha.GetCurrentTexture() ) { DISPLAY->SetTexture( 1, mat.alpha.GetCurrentTexture() ); - DISPLAY->SetSphereEnironmentMapping( mat.alpha.m_bSphereMapped ); + DISPLAY->SetSphereEnivronmentMapping( mat.alpha.m_bSphereMapped ); DISPLAY->SetTextureModeAdd(); DISPLAY->SetTextureFiltering( true ); } /* go */ DrawMesh( i ); + + // Turn off Environment mapping on tex unit 0. Is there a better way to reset? + DISPLAY->SetTexture( 0, NULL ); + DISPLAY->SetSphereEnivronmentMapping( 0 ); } } else @@ -394,11 +398,11 @@ void Model::DrawPrimitives() static const float shininess = 1; DISPLAY->SetMaterial( emissive, ambient, diffuse, specular, shininess ); DISPLAY->ClearAllTextures(); - DISPLAY->SetSphereEnironmentMapping( false ); + DISPLAY->SetSphereEnivronmentMapping( false ); DrawMesh( i ); } - DISPLAY->SetSphereEnironmentMapping( false ); + DISPLAY->SetSphereEnivronmentMapping( false ); DISPLAY->SetBlendMode( BLEND_NORMAL ); DISPLAY->TexturePopMatrix(); }