Use MRT (multiple render targets) in d3d)

Source: Internet
Author: User

Multi-render target (MRT) can be usedProgramWrite Data to multiple render targets simultaneously in one rendering. This feature is useful in post effect. For example, if you need to write depth, normal, and Geometry Data to RT, you can use MRT to reduce the pass for generating the data. The main steps for using MRT are as follows:

    1. The use of MRT requires hardware support. You can query the hardware support capability before using it.
    2. After the hardware supports MRT, the use of MRT is similar to the use of a single common render target, except that the corresponding RT index can be specified when the RT is bound, setrendertarget (rtindex ,...). Note: During the RT binding process, you also need to create some temporary surfaces to store the default RT information on the corresponding layer for subsequent restoration.
    3. After the MRT is successfully bound, you can identify color0, color1,… in pixel shader ,... To write the content to the corresponding RT. After the pass is generated, rT is used.

Of course, there are still some restrictions in the use of MRT, mainly including

    • The configured RT must have the same width and height.
    • The Set RT usually requires the same bit width, for example, 16bits or 32 bits.

More details are provided in the d3d SDK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.