Sign in to follow this  
Dmnbp7ip

Aliasing for 3D modeler

Recommended Posts

Dmnbp7ip    122
Hi, I am programming a 3D modeler (http://www.macrocosm.0rg.fr), and I meet a little problem with rendering the edges. I render them with : DrawIndexedPrimitive(D3DPT_LINELIST , 0, 0, NVertex, 0, NEdgeSelected); The lines are very aliased... look at the following picture : http://www.macrocosm.0rg.fr/aliasing.png I have to say that I use the same vertex buffer for rendering faces, vertex and edges. Do you have an idea about how I could do to make edges cleaner ? Like on the following picture (from 3DSmax) : http://www.macrocosm.0rg.fr/max.png Thanks !

Share this post


Link to post
Share on other sites
Sneftel    1788
It looks like the faces are partially overlapping the lines, due to Z-fighting. To fix this, you can use the DepthBias render state to artificially push the lines "forward" a little bit (although they'll appear in the same place on the screen.)

Share this post


Link to post
Share on other sites
Dmnbp7ip    122
It seems that depth bias do not affect the lines... here is an extract of the DXSDK documentation :

"The bias is not applied to any line and point primitive. However, this bias needs to be applied to triangles drawn in wireframe mode."

:(

Share this post


Link to post
Share on other sites
Sneftel    1788
Right. So all you need to do is draw the triangles in wireframe mode, and the bias will be applied. (alternatively, you could just bias the faces backwards.)

Share this post


Link to post
Share on other sites
Sneftel    1788
When they say "triangles" they mean "polygons of any number of sides". Polygons, you see, are drawn by DirectX as a series of coplanar triangles.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this