2013年9月5日 星期四

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:


沒有留言:

張貼留言