Jump to content
Site Stability Read more... ×
  • Advertisement

DX11 Direct2D but generate background from 3D Model

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

So the application itself is 2D and layered but I want to build the background bitmap from a Blender 3D model.

When I make an appeal to Saint Google there seem to be an awful lot of ways of getting to the desired result.

The process I have in mind is to do the following. Please comment on the practicality or otherwise of this approach.

Use a background thread to:

  • Load the model
  • Create a 3D buffer for rendering into
  • Render into the buffer
  • Copy the 3D buffer to a 2D buffer somewhere

The main loop will

  • Blit? copy the 2D background to the backbuffer of the swap chain
  • Overlay the background with various sprites
  • Swap buffers

Which leads to the following questions.

What is the best option for exporting a Blender model for use by DirectX.

Which API should I use to create a 3D buffer for rendering the model into? As it only gets rendered on scene changes, every 10-20 seconds, am I correct in assuming it shouldn't be part of the swap chain? In managing the background buffer is it best to, or must I, use a "dummy" device of some kind?

How do I turn a 3D buffer into a 2D bitmap for load into the 2D swap chain?

What is the best way to set up the 2D buffer  so asto minimise the cost of the copy for every frame by the main loop?

Edited by timjohnarm

Share this post

Link to post
Share on other sites


Does the background move ? I'm not familiar with Direct2D. You can always just go full D3D and render quads for the 2D stuff, it will certainly be very fast.

As for loading models from Blender (or any other program) you'll need a loader. It's not that hard to code an .obj loader yourself, otherwise you can probably find some code. It depends on the format your game engines uses so I would just make it myself if I were you, it basically comes down to parsing a text file (for .obj).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!