Jump to content
  • Advertisement

Archived

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

mdias

Mesh Inside Mesh Artifacts

This topic is 5773 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'm rendering a scene with 2 cubes and when I put the small cube partially inside the big one I can see some artifacts, here's a screenshot: (I Painted the artifacts in red so you can see them) When I put the camera closer to the meshes the artifacts slowly disapears. How can I get rid of these artifacts? Is there any renderstate that hides them? thanx
KaMiKaZe [edited by - Kamikaze15 on January 23, 2003 1:53:23 PM]

Share this post


Link to post
Share on other sites
Advertisement
Those look like Z buffer artifacts.

Make the near clipping plane in your projection as high as possible (i.e. as far away from the camera as possible). How high you can go depends on your app.

Then make sure that the distance between the far clipping plane and the near clipping plane isn''t too big.

A Z buffer only has a limited amount of precision (typically 16-32 bits) which isn''t nearly enough to store the entire Z range, so the more you spread the range, the more you spread that precision out and the more likely two different Z values are going to have the same value in the Z buffer.

Up to 90% of the precision in the Z buffer is bunched up in the first 10% of the Z range between far and near which is why the artifact reduces as the cube gets nearer.

The other thing to do is increase the number of bits used by your depth buffer. If you''re currently using D3DFMT_D16, try using a higher bit depth such as 24 or 32 (depending on what your hardware supports and in what combinations with the frame buffer).


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
hmm, I understand those artifacts now, thanks

[Edit] BTW, p_D3Ddevice->SetRenderState( D3DRS_ZENABLE, D3DZB_USEW )
also solved my problem.


KaMiKaZe

[edited by - Kamikaze15 on January 23, 2003 2:50:09 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
this happens to me in 3d studio max.

what i do is cut out the area from the bigger box where the smaller box is.

next you cut the bottom off the smaller box and weld the vertices together.

then it makes it look smooth like one object.

Share this post


Link to post
Share on other sites

  • 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!