Jump to content
  • Advertisement
Sign in to follow this  
MrDoomMaster

Background Images behind 3D Objects

This topic is 4837 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 have 2 3D Dice that I've placed on my scene, very close to the origin. My resolution is 640x480. I have a bitmap that is 640x480 that I want to be blittered across the entire screen, but I want all of my 3D objects to be blittered OVER it. Can anyone tell me how I can do this? I'm trying with textured quads, but it is only configured for blittering sprites in 2D games... I haven't made any changes to it since I had moved onto 3D. Thanks in advance for any assistance!

Share this post


Link to post
Share on other sites
Advertisement
you should list what API you are using but consider this:

disable the depth buffer.
draw the background.
enable the depth buffer.
draw the dice.

since there is no data in the buffer to test against, the dice will always pass the depth test.

Share this post


Link to post
Share on other sites
Not sure about how to do the 2D with 3D, but if you have 3D dice already you might want to look into a sky box.

Share this post


Link to post
Share on other sites
I apologize, I'm using Direct3D 9.0c. Wouldn't enabling/disabling the depth buffer be a time consuming process when executed every frame? Could you possibly provide a code example?

Thank you!

Share this post


Link to post
Share on other sites
Either turn off the ZWRITE render state for drawing the background (it's just a simple state change, not much to worry about) or specify a z coordinate for the 2d stuff. If your 2d functions let you specify a z value use 1.0f (the range for 2d z is usually 0.0f to 1.0f which translates to the z value which is written to the z buffer).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!