What cuases this?

Started by
4 comments, last by sQuid 20 years, 11 months ago
This is just a simple model of a garden wall done with Direct 3D 8.1 (or http://www.physics.uq.edu.au/people/dawson/yuk.png if the image doesn''t display. I seem to lose trinagles on the foreground wall as I move around the scene, displaying the wall in the background. I''ve tried playing around with the triangle orientation and depth testing with SetRenderState with no effect. thanking you ...
Advertisement
...sorry, haven''t actually done any D3D yet..but...

...is it possible that you get such display errors if you have some nonplanar polygons maybe?.....or maybe more than 1 polygon on the same place?
Although the picture is extremely dark (viewed in a bright office environment during summer daylight)...

1) Could be Z buffer artifacts
a. Try changing the depth buffer type to 24 or 32 bit (on nVidia chips you''ll also need to change the frame buffer to the same for it to have an affect).

b. Check the ratio between the near and far clipping planes used to set up your projection matrix - if it''s massive, (e.g. 0.001 to 1000000.0) then you''re effectively killing the resolution of the depth buffer and scrunching it all up into the few units nearest the camera. First reduce the far clip plane, then move the near clip plane as far from the camera as you can bear (i.e. increase the value, helps make the Z buffer space more linear), then increase the far clip plane to a point where there aren''t artifacts, but most of the scene is in view.


2) Or have you been playing with the ZBIAS renderstate? - don''t, it''s horribly inconsistent across hardware and causes all sorts of nasties like the above if set past certain values.

a. To bias, move the clip planes by the bias amount to achieve the same effect.

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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Did you already try SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ) ? It`s the best way to see your actual triangle orientation.

From the picture I`d guess that there is some blending going on. If so, you might need to render more distant triangles before nearer ones.

VladR
Avenger game

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

thanks for that, it was the clipping planes. I had the near plane distance set to 0 so the ratio between them couldn''t have been worse.

I thought the depth buffer value was just a linear scaling between the near and far planes. I guess not.

thanks again.
I use OGL (it''s all the same in hardware though) but I find that setting the near clipping plane to at least one usually fixes most problems.

-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-

This topic is closed to new replies.

Advertisement