Jump to content
  • Advertisement
Sign in to follow this  
Dmnbp7ip

Aliasing for 3D modeler

This topic is 4235 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

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
Advertisement
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
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
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

Yes, but I do not want to draw triangles, I want to draw the edges around a polygon : they may have more than 3 sides...

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!