Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

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:
    233
    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:
    517
    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.