"Reprint" Notes on RenderTarget

Source: Internet
Author: User

Original: notes on RenderTarget

1. Setting a rendertarget will cause viewport to become as big as rendertarget.

2. The anti-aliasing type must be the same as Depthstencilbuffer

3. The type of rendertarget must be compatible with the Depthstencilbuffer type and can be detected with Idirect3d9::checkdepthstencilmatch

4. The size of the Depthstencilbuffer must be >=rendertarget

5. The No. 0 of Idirect3ddevice9::setrendertarget cannot be null

6. Texture with the usage of d3dusage_rendertarget cannot be anti-aliased and the pool must be d3dpool_default. If you want to use rendertarget as a texture and want anti-aliasing, you can first render the scene to a surface (or backbuffer) created by CreateRenderTarget, and then use the IDirect3DDevice9: StretchRect Copy to Texture

7. D3DX provides a id3dxrendertosurface that simplifies the use of rendertarget. Note that its beginscene with the EndScene and the IDirect3DDevice9 function pair cannot be nested, because inside is actually called IDirect3DDevice9, and the PIX can see what calls it makes. There is also this interface is still not anti-aliasing, and every time to save/restore a bunch of state, always feel uncomfortable

8. RTT can not be as input as the output target, some graphics card may only give a warning, some video cards will be error/black screen/panic and other unpredictable things ... In addition, Depth stencil texture (see Hareware Shadow map) also has the same problem, after use to SetTexture (n, NULL) empty, otherwise a card will be black screen/huaping/depth error, even if you do not use, As long as it is referenced by the register, the video card will still be considered as being used, then it cannot be depth stencil buffer

9. RTT cannot be directly savetotexture if it is to be saved to a file. You need to create a offscreensurface, copy the past, and save it. But n cards do not seem to support the DXT1 format of Offscreensurface, you can create texture, take its level0 surface instead.

n Cards will be anti-aliased after the sawtooth is turned on, or the depth test may fail-_-

One. Intel's graphics cards may fail to draw all depth tests when the RTT is not set Depthbuffer, and you need to close the depth test to draw again.

Srgbwrite does not support RT in float format

At MRT, Alpha Test is done using the alpha of the first Rt.

MRT does not support anti-aliasing, must be the same bitdepth, can be different formats, must be the same size

"Reprint" Notes on RenderTarget

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.