Custom Water Mesh Cull Distance Editing or Disabling

I’m having an issue with not being able to edit or disable the cull distance settings for the Custom Water Mesh. The actual mesh is just a sphere overlapping a planet, which displays just fine without the Unreal Engine 4.26 Custom Water Mesh. As soon as I add the water material it does not display unless I’m extremely close to the planet. Is this culling affect caused by the material’s World Position Offset or some other culling method I’m unaware of?

Described as you have it could be literally anything.

What material are you using exactly?

The material is the Unreal Engine 4.26 Custom Water Mesh material, part of the new water system with 4.26.

Doesn’t even look like the material.
Have you made changes to it?

What else have you tried, also what is the distance, AND
What is the tris count of the scene?

The material could simply not be able to render because the gfx is overloaded by the vertex count.

I’ve tried every setting in the material instance and some of the settings in the material Blueprints.
It’s definitely distance culling.
I have a planet with a diameter of 161 km and it works just fine unless I go a very long distance away from the planet (see attachment).
The planet I’m working on now has a diameter of about 1,230 km. It’s exhibiting the same issue that I saw with the smaller planet. The only difference is that with the smaller planet I had to go a much further distance away (possibly the same distance by scale).

It’s the material for the new water system.

If anyone is familiar with the technical details of the 4.26 water system I’d like to get your take on things.
In the meantime, I’m creating my own water material and it’s showing up just fine. I might have to learn how to create shaders to create my own water for planets.

I looked through all of the C++ code for the plugin, including the Custom Water Body and found nothing concerning culling distance. I also tried the same with the UIWS at planet scale and had similar results. It looks like I’ll have to add the bodies of water individually or through Blueprints. I’m going to use UIWS for now.

You’d need to learn a lot more than just how to make shaders I’m afraid.

I’ll ask again, what is your scene tris count before/after the cull point?
What approximate distance is the issue occurring at?(measure it).

What is the vert count of the Water hull (the sphere) on its own?

The default material packs a rather high tessellation, but it is disrance based.
So your tris count will probably increase beyond the GFX capabilities, particularly if the distance function for it isn’t good enough.

Additionally, you probably need to set up the sphere in slices for culling.
You can read intel docs on best practices for that.

It’s not a solve-all either way, but if the problem is the tris count, proper occlusion would reduce that (theoretically in half or thereabouts, you can only ever see half a sphere, but the slicing will go over 1/2 most time).

Obviously the issue is the material. What I’m getting at is that the default parameters for its tessellationn are what’s causing it to stop rendering rather than a “distance thing”.

I see what you are saying. I’ll do some more research. Thanks for the info.

These are the triangles drawn before and after the water for UE 4.26.
I’ve been studying up on optimization. That’s something I had been putting off.

“You’d need to learn a lot more than just how to make shaders I’m afraid.”
I noticed that when I tried a different water shader.

I’ll look into the vertex count for the water sphere.
I used a sphere that is 100 x 100 x 100 cm. I scaled it by 1,220,000.

“What approximate distance is the issue occurring at?(measure it).”
The vector length in the images is 231,289.
Correction: I’ll need to disable the world origin rebasing and check again.

“You can read intel docs on best practices for that.”
Deferred rendering raised my CPU usage to 100% and the engine tried to bake all of the lighting for the planetary system. UE Editor was locked for 30 minutes as it tried to save over 10,000 shaders, so I had to crash it. But I’m learning about LOD. I’m not sure if LOD will help with the water situation though.

“proper occlusion would reduce that (theoretically in half or thereabouts, you can only ever see half a sphere, but the slicing will go over 1/2 most time)”
That’s something I’ll look into.

“the default parameters for its tessellation are what’s causing it to stop rendering”
I’ll do more research on that as well.


“What approximate distance is the issue occurring at?(measure it).”

I start to see some the water material around 7,634,105 cm (76 km) from the water surface.

Something else I’m thinking of, since a sphere with color or texture material works just fine from any distance, is reverse distance culling. Having textured material at great distances and then the UE 4.26 water material at close distances. But that would be a last resort.

Actually, that would be the “best” solution.

The water shader is really heavy, and should probably be replaced by a simple material at a distance.

Essentially, past 2km you should be panning a normal map to simulate waves rather than using the material’s displacement.

A cost of near 0 VS a high cost and a bad looking result (because potentially tessellation doesn’t offer enough vertex at 2km to make much of a difference).

You may be able to achieve this by forcing LODs into the water mesh.
Essentially, just make the farther distance LOD a completely different material.

Then the LOD will swap out based on size on screen.

I would suggest you create a simple scene with 1 simple 100mx100m plane, to which you assign the water material. Add A light so you can see something, and move at a distance of 75+KM to check if the plane culls or not.

On my end, it doesn’t. But I’m not positive I updated the engine to the latest version, since I don’t even really use .26 given the epic mess that it is.

Regardless of it disappearing or not, now that you have an approx distance you can check the object’s size on screen and/or set yourself at that distance to balance the LOD manually - and just swap to a low cost material for “planetary” view…

Thanks. I think you may be right about it being the best solution.

The material I made does use 2 normals and a panner. The only issue was the reflection of the sun and the other planets wasn’t looking very good with the panning normals, but I’m sure it’s something I can fix.

That’s a really good idea about the LODs. I’ll try that.

Come to think of it, if I use a 3rd material for the LOD, I can use that for the horizon so that there is no panning for the reflecitons.

I turned the LOD 1 material red to distinguish it from the LOD 0 UE 4.26 water material. It now looks fine and I can see it from tens of thousands of kilometers away, from other planets.

The transition to the LOD 0 UE 4.26 water mesh is seamless. I wasn’t able to blend them together for the LOD 1 water to be in the distance/horizon, so I had to make sure the LOD 1 water stopped as soon as the LOD 0 water started.

The LOD 0 water looks fine from the ground. The LOD 1 mesh looked as if the water was going upwards (when I had it on the ground) for some reason. I’m thinking it’s because spheres are actually tetrahedrons and there aren’t enough tessellations to make perfect spheres for oceans in UE. I also had issues with creating a post-process volume for planetary oceans because the there are even fewer tessellations for tetrahedron post-process volumes. I might make a larger sphere with more triangles for the water sphere in Blender.

The view from underwater looks fine also.

I didn’t see a change in performance so I should be able to do this for all of the rocky planets.

I’m going to use all 3–

  • Custom material for LOD 1
  • UE 4.26 custom water material for LOD 0
  • UIWS for rivers, waterfalls, and a few lakes with waves since the other 2 create still lakes.

Thanks again @MostHost_LA .