Archived

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

Undiagnosed Problem with Screenshot

This topic is 5173 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

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites