0
\$\begingroup\$

I would like to implement render scaling that could render a scene at a certain % of the window resolution. How would I do this? I've tried resizing a number of things, then resizing them up or down to match the window size but I've never gotten it to work.

\$\endgroup\$
  • \$\begingroup\$ With DirectX 11.1 or later (Windows 7 SP1 with KB 2670838 or Windows 8+) you can use DXGI_SCALING_STRETCH and set your backbuffer to a smaller size than the actual window/display you are using. With UWP or Windows 10 DX12, you can use DXGI_SCALING_ASPECT_RATIO_STRETCH which gives you better behavior that preserves the aspect-ratio of the backbuffer when doing the upscale. \$\endgroup\$ – Chuck Walbourn Aug 16 '18 at 23:27
1
\$\begingroup\$

The most obvious one and probably most hacky is to:

1 - Create your rendertarget at the % of the screen size (MSAA or NON MSAA)

2 - Create a transition Rendertarget at the windowsize (NON MSAA) I advise NON MSAA as you then don't have to use the more expensive ResolveSubResource call.

3 - Upon completion of your rendering to your rendertarget, use this as a source texture for your rendering to a fullscreen quad into your NON MSAA transition target.

4 - Copy the resource into your swap buffer.

You could do a fullscreen quad straight to the swap buffer, but I cant remember if that means you can not utilise SWAP_SEQUENTIAL or SWAP_DISCARD.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.