/* ============= R_ShadowPassSetupGL ============= */ static void R_ShadowPassSetupGL( const plight_t *pl ) { // matrices already computed RI.worldviewMatrix = pl->modelviewMatrix; RI.projectionMatrix = pl->projectionMatrix; RI.worldviewProjectionMatrix = RI.projectionMatrix.Concat( RI.worldviewMatrix ); GLfloat dest[16]; // tell engine about worldviewprojection matrix so TriWorldToScreen and TriScreenToWorld // will be working properly RI.worldviewProjectionMatrix.CopyToArray( dest ); SET_ENGINE_WORLDVIEW_MATRIX( dest ); pglScissor( RI.scissor[0], RI.scissor[1], RI.scissor[2], RI.scissor[3] ); pglViewport( RI.viewport[0], RI.viewport[1], RI.viewport[2], RI.viewport[3] ); pglMatrixMode( GL_PROJECTION ); GL_LoadMatrix( RI.projectionMatrix ); pglMatrixMode( GL_MODELVIEW ); GL_LoadMatrix( RI.worldviewMatrix ); GL_Cull( GL_FRONT ); pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); pglColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ); pglEnable( GL_POLYGON_OFFSET_FILL ); pglDisable( GL_TEXTURE_2D ); pglDepthMask( GL_TRUE ); pglPolygonOffset( 8, 30 ); pglEnable( GL_DEPTH_TEST ); pglDisable( GL_ALPHA_TEST ); pglDisable( GL_BLEND ); }
/* ============= R_ShadowPassEndGL ============= */ static void R_ShadowPassEndGL( void ) { pglColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); pglDisable( GL_POLYGON_OFFSET_FILL ); pglEnable( GL_TEXTURE_2D ); pglPolygonOffset( -1, -2 ); }
static void ogl_DisableDepthBias(void) { ASSERT( _pGfx->gl_eCurrentAPI==GAT_OGL); _sfStats.StartTimer(CStatForm::STI_GFXAPI); pglDisable( GL_POLYGON_OFFSET_POINT); pglDisable( GL_POLYGON_OFFSET_LINE); pglDisable( GL_POLYGON_OFFSET_FILL); pglPolygonOffset( 0.0f, 0.0f); OGL_CHECKERROR; _sfStats.StopTimer(CStatForm::STI_GFXAPI); }