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:
1.Operation process
1.1 First, take the UE4 little white man as an example. Make a copy and add the only_Depth suffix:
1.2 Create a new material and name it DepthMat to draw depth. Check Allow Custom Depth Writes. :
1.3 Give material to the Deep Little White Man
1.4 Find Render in Main Pass in the Detail of the Deep Little White Man blueprint and remove the check
1.5 Find Render in Depth Pass in the Depth Little White Blueprint Detail and remove the check
1.6 Find Render CustomDepth Pass in Deepin Little White Man and check it
1.7 Create a new translucent shader ball and name it TestMat
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)
1.10 Completed:
Another test, put a translucent object in front of the little white person: