Search Unity

Question How to blit a rendertexture with stencil buffer?

Discussion in 'Universal Render Pipeline' started by ununion, Mar 18, 2023.

  1. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    I have already created a custom render pass,but in my blit shader i cannot get stencil buffer value,why?
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Hi, the default blit shader doesn't keep stencil, so you need to create a custom blit shader to do the blit operation with keeping stencil.
    URP_Stencil.jpg

    I've never tried using stencil, so sorry that I cannot help you to create the custom blit shader.