• This repository has been archived on 27/Jul/2023
  • Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Replacement for GrabPass in Unity's Universal Render Pipeline (URP).

URP Grab Pass

license

ๆ—ฅๆœฌ่ชžใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆ(Japanese Documents Available)

Replacement for GrabPass in Unity's Universal Render Pipeline (URP).

Demo

Features

  • You can get the camera's color texture at the following timings.
    • After drawing opaque objects
    • After drawing transparent objects
  • Then you can use it in your shader.
  • In contrast to URP's _CameraOpaqueTexture, you can also get the color texture after drawing semi-transparent objects.

Requirement

Universal RP 10.2.0 or higher.
Unity2020.2.3f1 or higher.
VR is not supported.

Usage

Setup Universal Render Pipeline

Install URP Grab Pass

  1. Open the Package Manager from Window > Package Manager
  2. "+" button > Add package from git URL
  3. Enter the following

Package Manager

Or, open Packages/manifest.json and add the following to the dependencies block.

{
    "dependencies": {
        "com.harumak.urpgrabpass": "https://github.com/Haruma-K/URPGrabPass.git?path=/Assets/URPGrabPass"
    }
}

If you want to set the target version, specify it like follow.

Setup Renderer Feature

  • Add the Grab Pass Renderer Feature from the inspector of the Forward Renderer Data.

Add Renderer Feature

  • Change the properties of the Renderer Feature if necessary.

Set up Renderer Feature

Property Name Description
Name Name of the Renderer Feature.
Timing When to get and use the camera's color texture.
Grabbed Texture Name Name of the grabbed texture when it is used in the shader.
Shader Light Modes LightModes for shaders that use the texture.
Sorting Criteria How to sort objects during rendering.

Write and use the shader

Demo

  1. Clone this repository.
  2. Open the following scene.

License

This software is released under the MIT License.
You are free to use it within the scope of the license.
However, the following copyright and license notices are required for use.