Jump to content
  • Advertisement
Sign in to follow this  
judeclarke

DX11 [DX11]

This topic is 2604 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 am working on a level editor and I would like to render my viewports (ranging from one to four) at different sizes. However, while thinking of an efficient way to do this I have ran into a wall. From what I can determine the best way to do this wold be

Set D3DContext's D3D11_VIEWPORT to be the size of the "Render View Port One"'s size
Render the first viewport

Set D3DContext's D3D11_VIEWPORT to be the size of the "Render View Port Two"'s size
Render the second viewport

Set D3DContext's D3D11_VIEWPORT to be the size of the "Render View Port Three"'s size
Render the third viewport

Set D3DContext's D3D11_VIEWPORT to be the size of the "Render View Port Fours"'s size
Render the fourth viewport

This seems rather inefficient though. Does anyone have any better suggestions?

Share this post


Link to post
Share on other sites
Advertisement
In D3D11 you can have multiple viewports (and render targets) bound simultaneously, and in a geometry shader you can replicate your triangle to each viewport using SV_ViewportArrayIndex and SV_RenderTargetArrayIndex. However this typically only ends up saving you CPU time, and not GPU tiime. So I would not bother implementing that unless CPU performance becomes an issue.

Share this post


Link to post
Share on other sites
I would say 'no' to the original question - it doesn't sound inefficient to me. There really is no way to get around it, and I am sure that a change to the view port is not that big of a deal. Building on the technique that Matt mentioned, you could use an array of viewports, and then have multiple copies of your geometry which each have the corresponding viewport index specified as a vertex attribute.

That would eliminate the need to reset your view ports, but honestly that would be a colossal waste of memory. After you spend some time on the API, you will see that those four calls will be the least of your problems :)

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!