โจ Depth-To-Particle Unity Renderer Feature
April 28, 2025 ยท View on GitHub
A custom rendering feature based on URP in Unity that converts a custom-rendered depth map into particle effects.
๐ Project Info
- Unity Version:
2022.3.53f1c1 - Render Pipeline: Universal Render Pipeline (URP)
- Demo Scene:
Assets/Scenes/0.a.unity
๐ฏ Project Overview
This project demonstrates a technique for generating particles based on depth information. By adding a custom Pass to target objects, it renders only the depth of specific areas. Combined with a Renderer Feature and a Compute Shader, these pixels are converted into particles for visual effects.
๐ง Implementation Overview
-
Custom Shader Pass
- Adds an extra Pass to the dissolving object.
- This Pass renders only the depth information of the dissolving area, discarding other pixels.
-
ScriptableRendererFeature to Capture Render Target
- A custom Renderer Feature is added in URP.
- Specifies the Pass name and render Layer, writing the result to an RTHandle.
-
Compute Shader for Pixel Processing
- Samples the render texture in the Compute Shader.
- Filters pixels and computes world space coordinates.
- Outputs valid coordinates to a buffer.
-
Particle Generation
- Retrieves particle vertex data asynchronously on the CPU.
- Procedurally renders particles based on the data.
๐งช Effect Preview
