Search Unity

Stencil Usage with a RenderTexture

Discussion in 'Shaders' started by tlmartin, Jul 30, 2014.

  1. tlmartin

    tlmartin

    Joined:
    Feb 5, 2014
    Posts:
    1
    I'm trying to render into a separate custom RenderTexture using Graphics.Blit(...) calls in order to build up a texture that I'm using later on in rendering.
    I also use Graphics.SetRenderTarget(colorDest, stencilDest) in some cases when setting my render target(s) and manually draw the full screen quad.

    I don't seem to have access to the stencil buffer for this RenderTexture for normal stencil testing on DX9.
    In DX11, my rendering set up works just fine.

    I set up my RenderTexture with the following code:

    Code (CSharp):
    1. rt = new RenderTexture(xdim, ydim, 24, RenderTextureFormat.Depth, RenderTextureReadWrite.Default);
    Is there a different way I'm supposed to set up RenderTextures or set them when I want to use a custom RenderTexture stencil?

    Thanks!