Solid-wireframe model using OpenGL/Direct3D
Depth bias not be supported on line and point mode.
OpenGL:
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( bias, 1 );
glDisable( GL_POLYGON_OFFSET_FILL );
D3D:
device->SetRenderState( D3DRS_DEPTHBIAS, (DWORD)bias );
device->SetRenderState( D3DRS_DEPTHBIAS, (DWORD)0 );
Reference:
In solid wireframe , we should enable polygon offset on solid model first, and then disable polygon offset on wireframe model.
OpenGL:
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( bias, 1 );
glDisable( GL_POLYGON_OFFSET_FILL );
D3D:
device->SetRenderState( D3DRS_DEPTHBIAS, (DWORD)bias );
device->SetRenderState( D3DRS_DEPTHBIAS, (DWORD)0 );
Reference:
Comments
Post a Comment