Jump to content
  • Advertisement
Sign in to follow this  
ekhall

Mixing Direct3D and 2D

This topic is 4818 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 want to mix 2D graphics (using Direct3D sprites) with 3D graphics. I set the viewport so that the 3D graphics gets painted on one part of the screen. On the other part I want 2D graphics. But I can only render sprites in the same viewport! What is the proper way to render both 2D and 3D graphics? Do I have to set up another viewport and switch between them? Do I need several BeginScene calls?

Share this post


Link to post
Share on other sites
Advertisement
What I'm doing is a menu system... It's not part of the scene.
So the 2D graphics should not be in front of any 3D, hence the viewport thing.
Or am I thinking incorrectly?

Share this post


Link to post
Share on other sites
You can also go for pretransformed vertices. These get fed the screens coordinates and aren't transformed nor affected by lighting. Z buffering applies though.

You can vary the z position of the vertices with the z value which ranges from 0.0 to 1.0 (pretransformed only!).

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!