Undiagnosed Problem with Screenshot

Started by
6 comments, last by ms291052 20 years, 6 months ago
I''ve been having a problem that resembles the buffer fighting when multiple objects occupy the exact same point in 3D space. I have no clue where it''s coming from in my code, or how to fix it. If anyone has any ideas at all, please tell me. Thanks. Screenshot.
Advertisement
Hi, we need some more details. Does the problem only show up when you take a screenshot? Or is it on screen all the time? Post your render code.

Pinz.
Er, if they occupy the exact same spot in 3d space, then you''re going to have this sort of visual artifact.

If you''re trying to do decals (aka overlays), then you should offset the decal''s z-value a certain amount. In OpenGL, you have glPolyOffset that lets you automatically add slight z offsets to the fragment''s final depth buffer value when primitives are sent to the card. I guess DX has something similiar.

---
http://www.gapingwolf.com
--- - 2D/Pixel Artist - 3D Artist - Game Programmer - Ulfr Fenris[[ Gaping Wolf Software ]] [[ GameGenesis Forums ]]
D3D has D3DRS_ZBIAS renderstate for depth bias control.

Niko Suni

Using D3DRS_ZBIAS apparently does not perform the same on all graphics cards. I''ve read that the differences in the values needed for the bias value is so great between different cards that it is not a viable solution if you want your app to behave predictably on all hardware. So how do you do decals properly? I read an article explaining that you can generate predictable results by changing the distance of the far plane. I dont have a link handy but you should be able to find some info on the exact method which btw i have not implemented but it seemed to make sense.

ATS
The DX9 certified drivers treat the z-bias as float, while earlier drivers treat it as integer value.
One could always check the driver version by using D3DXGetDriverLevel(). However, i don''t know if this is a waterproof solution either :/

-Nik

Niko Suni

As far as I know D3DRS_ZBIAS no longer exists. Instead we have D3DRS_DEPTHBIAS and D3DRS_SLOPESCALEDEPTHBIAS.
quote:Original post by treething
As far as I know D3DRS_ZBIAS no longer exists. Instead we have D3DRS_DEPTHBIAS and D3DRS_SLOPESCALEDEPTHBIAS.


Correct. I was stuck on old terminology
D3DRS_DEPTHBIAS has replaced D3DRS_ZBIAS nowadays.

-Nik

Niko Suni

This topic is closed to new replies.

Advertisement