Techniques for rendering texture from Direct3D

Source: Internet
Author: User
In Direct3D development, multiple passes are often required in HLSL files, which requires texture rendering. Currently, in a D3D system developed, an Effect file has three technique files, with a total of 10 passes, that is, it needs to be rendered to the texture nine times. You need to apply for multiple Texture2D files, renderTargetView and ShaderResourceView

In Direct3D development, multiple passes are often required in HLSL files, which requires texture rendering. Currently, in a D3D system developed, an Effect file has three technique files, with a total of 10 passes, that is, it needs to be rendered to the texture nine times. You need to apply for multiple Texture2D files, renderTargetView and ShaderResourceView

In Direct3D development, multiple passes are often required in HLSL files, which requires texture rendering. Currently, in a D3D system developed, an Effect file has three technique files, with a total of 10 passes, that is, it needs to be rendered to the texture nine times. You need to apply for multiple Texture2D files, renderTargetView and ShaderResourceView are rendered nine times. Nine texture resources are required for each of the preceding three types. Many resources are requested, and each texture is in the RGBA format, occupying a large amount of video memory. Later, after testing, I learned some techniques for rendering textures, which can reduce the number of applied textures, that is, texture reuse. Three points can be summarized as follows:

1. In a pass, the texture used cannot be used as the rendering texture;

2. The texture variables in the Effect file are bound to the textures in the application. The textures in the application are changed, and those in the Effect file are also changed.
3. rendered textures,Not used in current and future passThe texture resource can be used for rendering. You do not need to apply for new texture resources to save resources.

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.