#### Archived

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

# What cuases this?

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

## Recommended Posts

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

##### Share on other sites
...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?

##### Share on other sites
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

##### Share on other sites
Did you already try SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ) ? Its the best way to see your actual triangle orientation.

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

Avenger game

##### Share on other sites
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.