Jump to content
  • Advertisement

Archived

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

Joe Forhens

Making sure it's rendered behind everything

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

Hey How can i make sure something will never be infront of anything else . I don''t want any hacks here , i guess it''s a zbuffer state thx

Share this post


Link to post
Share on other sites
Advertisement
Z-buffer IS enabled , if i do this and another object is further then it will be drawn behind what i want to be rendered last . The solution should be fairly easy to implement if i''m not mistaken it has to do with ZENABLE and ZBIAS render states . I just want to be sure .

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
1) Disable z-testing/z-writing.
2) Render background object(s).
3) Enable z-testing/z-writing.
4) Render foreground object(s).

Z-bias is something different. It''s used to prevent ''z-buffer fighting'' when rendering (nearly) co-planar polygons.

Share this post


Link to post
Share on other sites
You could also implement your own sorting routine and then have complete control over your render order. the advantage is that once you code it you can use it in several other portions of your engine. This will also allow for a bunch of cool effects with alpha''d billboards and point sprites later down the road.

Dreddnafious Maelstrom

"If I have seen further, it was by standing on the shoulders of Giants"

Sir Isaac Newton

Share this post


Link to post
Share on other sites
Does not sound efficient.

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!