Double pass in UE5 solves the problem of translucent material disorder

The problem of transparency material disorder has always been a common problem encountered in translucent effects. The multi-pass solution can only be solved to a certain extent. When encountering situations such as multiple translucent objects interspersed, it is still not perfect. solve.
The dual-pass solution Unity is more commonly used because Unity supports multiple pass drawing. In UE, we can simulate multi-pass drawing by copying multiple objects and assigning them to different material balls. One material can draw depth, and one material can draw translucency.

The final effect is as follows:
Insert image description here

1.Operation process

1.1 First, take the UE4 little white man as an example. Make a copy and add the only_Depth suffix:
Insert image description here
1.2 Create a new material and name it DepthMat to draw depth. Check Allow Custom Depth Writes. :
Insert image description here
1.3 Give material to the Deep Little White Man
Insert image description here
1.4 Find Render in Main Pass in the Detail of the Deep Little White Man blueprint and remove the check
Insert image description here
1.5 Find Render in Depth Pass in the Depth Little White Blueprint Detail and remove the check
Insert image description here

1.6 Find Render CustomDepth Pass in Deepin Little White Man and check it
Insert image description here

1.7 Create a new translucent shader ball and name it TestMat
Insert image description here
1.8 Add this shader for the translucent little white person. It can be seen that there is a problem now< a i=2> 1.9 The most important step is to add depth processing (Allow Custom Depth Write must also be checked in the shader) (Note: The source of the earliest version is https://www.cnblogs. com/sevenyuan/p/7813527.html)
Insert image description here

Insert image description here

1.10 Completed:
Insert image description here

Another test, put a translucent object in front of the little white person:
Insert image description here

Guess you like

Origin blog.csdn.net/grayrail/article/details/133803390