Unity HDRP Custom Pass achieves scene snow effects

First use Shader Graph to connect a shader that uses model normals to add snow, and assign it to a material.

1.1 First get the vertex normals in the model world coordinates, process them briefly, and give them transparency.
Please add image description

Add a Custom Pass to the scene and remove unnecessary layers.

1. In the Hierarchy interface, right-click to create Volume -> Custom Pass
Please add image description
2. Add Draw Renderers Custom Pass to Custom Pass Volume
Please add image description
3. Attach material, adjust rendering to All Opaque, Forward, depth test can test Equal, Greater, Always ,.

Please add image description

4.Always effect:
Please add image description

解决报错(Your HDRP setting do not support Forwardonly, some objects might not renderer)。

1. To solve this error, you need to adjust the lighting rendering mode of the currently used HDRP Asset to ForwardOnly
2. The currently used HDRP Asset can be viewed in Edit -> Project setting -> Quality -> Rendering -> Render Pipeline Asset.
Please add image description

Optimize Shader Graph.

1. You can view the rendering queue of the current Custom Pass in the Frame Debugger.
Please add image description
The material mounted by the Custom Pass only adds a layer to the original material. If we need the transition of the snow, we need to remove the transparency obtained by using the normal line. The main thing is to operate on normal lines.
Please add image description

Effect:Please add image description

Please add image description

Guess you like

Origin blog.csdn.net/blastospore/article/details/133350302