Solid-wireframe model using OpenGL/Direct3D

Depth bias not be supported on line and point mode. 

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

Popular posts from this blog

董事長您好

After reading Steve Jobs Autobiography

Drawing textured cube with Vulkan on Android