Stencil - URP

Introduction

Welcome to the Stencil Shader documentation. This guide will help you understand how to integrate and utilize the Stencil Shader within Unity’s Universal Render Pipeline (URP) to create stunning visual effects such as impossible geometry and portal effects.

Quick Start

Basic Configuration

Applying the Shader

  1. Select the mesh you want to apply the Stencil Shader to.

  2. In the Inspector, locate the material section.

  3. Apply the Stencil Shader to the material of the mesh.

Setting Layer Visibility

  1. Open the URP renderer settings.

  2. Configure the visible layers that the Stencil Shader will interact with.

  3. Ensure only the desired layers are set to be visible through the mesh.

Assigning Unique IDs

  1. In the Inspector, find the Stencil Shader properties.

  2. Assign a unique ID to each material using the shader.

  3. Use these IDs for precise control over the visual effects.