9
\$\begingroup\$

In d3d11, you can bind multiple render targets ID3D11DeviceContext::OMSetRenderTargets. But why would you want to do this?

\$\endgroup\$
14
\$\begingroup\$

When multiple render targets are bound, they can each be written to individually by the pixel shader -- it isn't (necessarily) the case that all render targets will get the same image. You could write only the red component into one output, only the blue into another, et cetera.

This is used when implementing deferred rendering for example: position, normal, color, et cetera information are each written to their own render target.

\$\endgroup\$
  • 4
    \$\begingroup\$ The new use for 3D TVs is to give multiple local players their own full screen view by filtering only a certain set of the frames to each player. This would be another use for multiple targets. \$\endgroup\$ – James Oct 13 '11 at 19:51
  • 1
    \$\begingroup\$ +1 for deferred rendering, thats what I've seen it used most for. MRT is also available in DX9 and 10 btw so it's not a new feature. \$\endgroup\$ – Roy T. Oct 13 '11 at 20:23
  • 2
    \$\begingroup\$ @James about time something useful came from that tech hype. :) \$\endgroup\$ – deceleratedcaviar Oct 14 '11 at 4:31
  • \$\begingroup\$ Back in the day it was also used for cube/environment mapping/reflections - there are better ways now though. \$\endgroup\$ – Jonathan Dickinson Oct 14 '11 at 8:07
  • \$\begingroup\$ @Daniel singularityhub.com/2010/07/26/… \$\endgroup\$ – James Oct 14 '11 at 16:25
2
\$\begingroup\$

The added benefit to using multiple render targets, as in deferred rendering like Josh mentioned, is that you send the scene's geometry to the vertex shader only once and apply it to different pixel shader outputs, instead of re-sending the geometry for every output you need. This saves a lot of computation time for the GPU. The trade-off for faster GPU performance is higher consumption of frame buffer memory.

\$\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.