I created a simple sprite renderer, niagara system, to create the appearance of water spray as my character moves across water. The particle system works mostly as expected, except periodically the particles will cease to render for a second, only to render thereafter. It appears the particles are there always, but not always rendered.
I checked and the camera height and the particle system height are staying the same (the water is flat), so it isn’t as if the camera is getting too far away so the particles aren’t being rendered due to performance saving.
Alright, so I learned something new about materials, specifically ones with blend mode “translucent”. The water material you see in the video, and the water spray niagara particles following the player, both use translucent materials. Apparently translucent materials do not write to the depth buffer, which is used to determine if an object is in front or behind something else. In this case sometimes the engine is rendering my niagara particles in front of the water (desired) and other times rendering the particles behind the water (undesired).
To solve the problem you have to indicate to the engine the order of rendering when using translucent materials, so they properly appear in front or behind correctly.
In the materials of the water and the one for the niagara particles, you will find a setting “translucency pass” which should be specified. By changing it to either before or after you can change the rendering order. In my case I set the material of the water to “Before DOF”, and the water particle material to “After DOF” and this has so far fixed the problem.
I can’t take credit for discovering this though, as I found the information here:
If anyone has any other insights, please share! For now I’ll make this as solved though.