• Advertisement


This topic is now archived and is closed to further replies.

zbias and zbuffer question

This topic is 5697 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to render a solid mesh with a wireframe overlay, so that all the edges of the mesh are black. To do this, I render the mesh once with fillmode=solid and zbias=0, and then again with fillmode=wireframe and zbias=1. It was my expectation that zbias would help prevent z-fighting artefacts. It works to a degree, however the lines are not completely solid (some z-fighting remains) and worse yet, some edges _behind_ the solid tris are rendered, intermittently popping through. A larger difference in zbias improves the line z-fighting, but also worsens the popping effect. I''m using a 24bit zbuffer (32bit is not supported on my hardware) and my perspective near and far clip planes are 1.0 and 100.0, so it doesn''t seem likely that this is a typical zbuffer precision issue. Any ideas of how I can achieve the effect I want, without these graphical artefacts? The final effect I''m striving for is to have only certain edges of the mesh highlighted in black (stored in a separate index buffer, sharing the same vertex buffer, for cel shading). Thanks for any help, ideas, or tips

Share this post

Link to post
Share on other sites

  • Advertisement