mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
ref: gl: don't touch polygon offset when not drawing debug hulls as it breaks decals with VBO
Also correctly restore polygon offset state so decals gets drawn even with VBO
This commit is contained in:
@@ -1746,10 +1746,20 @@ void R_DrawBrushModel( cl_entity_t *e )
|
||||
pglDisable( GL_BLEND );
|
||||
pglDepthMask( GL_TRUE );
|
||||
|
||||
pglPolygonOffset( 1.0f, 2.0f );
|
||||
pglEnable( GL_POLYGON_OFFSET_FILL );
|
||||
gEngfuncs.R_DrawModelHull( clmodel ); // draw before restore
|
||||
pglDisable( GL_POLYGON_OFFSET_FILL );
|
||||
if( r_showhull->value > 0.0f )
|
||||
{
|
||||
GLfloat factor, units;
|
||||
|
||||
pglGetFloatv( GL_POLYGON_OFFSET_FACTOR, &factor );
|
||||
pglGetFloatv( GL_POLYGON_OFFSET_UNITS, &units );
|
||||
|
||||
pglPolygonOffset( 1.0f, 2.0f );
|
||||
pglEnable( GL_POLYGON_OFFSET_FILL );
|
||||
gEngfuncs.R_DrawModelHull( clmodel ); // draw before restore
|
||||
pglDisable( GL_POLYGON_OFFSET_FILL );
|
||||
|
||||
pglPolygonOffset( factor, units );
|
||||
}
|
||||
|
||||
R_LoadIdentity(); // restore worldmatrix
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user