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.