"Jagged" texture problem

Started by
5 comments, last by IH82W8 20 years ago
Hi folks, I''m experiencing a little problem here - as long as the camera sticks close to objects, everything works just fine. The bigger the distance gets, the more "jagged" the objects look. Here''s an example of it: http://home.arcor.de/jesc/public/jagged.gif (As you can see, the green floor ''overlaps'' the walls and the roof became partially ''transparent'') It seems like there''s something wrong with the z-buffer, but I can''t seem to figure it out. Any ideas of what might be wrong? Any help/ideas would be greatly appreciated! Nescis mi fili, quantilla prudentis mundus regatur
Nescis mi fili, quantilla prudentis mundus regatur
Advertisement
You might check in your video driver settings to make sure the depth is greater than 16bit.

Edit: Z-buffer depth that is

[edited by - Schmedly on March 22, 2004 5:33:23 PM]
I set the clouds in motion, turn up light and sound...Activate the window, and watch the world go 'round
Thanks, I've changed the format to D3DFMT_D24X8 - it now works, but is it really necessary to use a buffer >16 bit?

Nescis mi fili, quantilla prudentis mundus regatur

[edited by - IH82W8 on March 22, 2004 5:35:43 PM]
Nescis mi fili, quantilla prudentis mundus regatur
Depending on a few things, namely your settings for the near and far clip of the view frustum along with the scale of your content... yes it can be necessary to use a higher resolution z-buffer.
I set the clouds in motion, turn up light and sound...Activate the window, and watch the world go 'round
Alright, I now know where to tweak. Thanks again!
Nescis mi fili, quantilla prudentis mundus regatur
As I understand this stuff (which isn''t very well) you should be able to get by with a 16-bit Z buffer as long as you''ve set up your world dimensions correctly.

For example: if you consider each unit of depth to be 1 mm, and you''re looking down on your house from 10 km, then you could run into some serious Z-buffer issues. But if you consider each unit of dimension to be 1 meter and you''re looking at things < 1 Km away you''ll be OK.

In other words, check how much "depth" this particular scene has. Then divide that max_depth by 65536 (max of a 16-bit value). If max_depth/65535 > 1.0 then you''ll probably have problems.

Actually I''m not very experienced so don''t take this as "truth", I''m just thinking out-loud.
"Good code will come and go, but bad code sticks around."
Well, the distance was pretty small. I already experienced this problem when the camera was about 300 units away.
A good way to get rid of it was to set a higher near plane - then a 16 bit z depth buffer works just fine.

So, problem solved =)

Nescis mi fili, quantilla prudentis mundus regatur
Nescis mi fili, quantilla prudentis mundus regatur

This topic is closed to new replies.

Advertisement