Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Haruma-K/URPGrabPass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.