Tesselation of water surface

Hallo.

So I’ve made my own FluidSim (as described here) using well known ping-pong fluid maps that works well with the unreal Water Plugin’s custom water body (a single quad tesselated down to useful detail).

I’m using a terrain depth cam that moves with the player (in FluidSim resolution increments) and a trigger box per water body in order to disable FluidSim if the player isn’t in water (also used to to tell FluidSim about the water-body, or more specific terrain depth cam Z position).

The FluidSim adds to water body gerstner waves.

Now this a bit disappointing:

Nothing I’ve tried seems to have any influence on finest tesselation of water surface. It’s always these 20cm or so quads. With gerstner wave amplitude of 1m or so, it starts appearing as if the main FluidSim effect would be to add Quad-appearance to the water body. Not nice.

Scaling the water body down to 1m lor up to something like 200m dimensions doesn’t seem to have any effect on this tesselation in game, only for edit mode in the editor. The water-zone has a tesselation setting, but no effect here. Changing FluidSim resolution doesn’t change a thing (tried, just to make sure I didn’t get something wrong with that) also no effect on the quads. Even tried using the lake water body (this weird thing that modifies terrain to match the water), but no luck with the quads, only added a few more problems.

One thing that I haven’t tried so far is completely throwing out water plugin and use pre tesselated planes with WPO material applied and explicit LOD. Obviously, I’d have to care about the gerstner waves and rendering techniques on my own, then. Also, using multiple tiles might be less friendly in editor usage.

But why should I do that? Isn’t it only the max tesselation slider of the water zone that doesn’t work as specified here for me? What could be wrong?

Are you sure the appearance is being caused by the mesh tessellation?

The water zone tessellation factor setting works for me, you can also use r.Water.WaterMesh.TessFactorBias to bias it.


To be honest it looks kind of like there is bilinear filtering happening in your screenshots, which would indicate it’s the resolution of your render target that is the issue.

1 Like

Hey, thanks for having a look.

Well, yes I’m sure about it’s a MAX-Tesselation issue that comes into play with small detail in cm scale. The FluidSim is currently running at 4cm for a total of 2048cm centered on the player. Changing that resolution doesn’t have any effect on the scale of the quads.

But you’re correct, the water zone tesselation (just like r.Water.WaterMesh.TessFactorBias) appears to be not completely defunct, It has some influence on fps, even if there’s currently no water body on screen.

The water zone has an additional resolution setting I don’t understand. It is currently set to 2048x2048.

Edit: No, it’s different. Changing the fluidsim res/size now has to do with the quad appearence. Heavily reducing the size makes many smaller quads appear, but that seems to be without geometry updates. I’ll have to investigate about that new finding.

Edit2:
Here’s an example. SimSize reduced to 512cm, and SimRes=512, so 1cm texels simulated. Also changed “Fluid Displacement Multiplier” in the water material instance from 1.0 to 7, and the FluidSim didn’t get any more time per tick (so appears much too slow), the shot shows the situation about 1s after a jump.


And it shows both, artifacts that look like it could be 1cm as well als obviously tesselation related artifacts.

Edit3:
Ideally, of course, surface would be sampled exactly at FluidSim texels, or even ineger mutiples of that (in terms of resolution, like 1cm for the 4cm sim example). But I do not even know how to make the surface be sampled at some other, rough resolution, so forget about exact scale or even correct offsets. There’s at least no obvious visual difference from setting water zone tesselation slider to min=1 or max=12 for the “water body custom”, directly from the water plugin, only scaled to roughly match some lake size.

Here’s a walkthrough to show what I mean… maybe too simple to really do…

Create a blank BP project, enable water plugin. Duplicate

[/Engine/Plugins]/Water/Materials/WaterSurface/Water_Material_CustomMesh.Water_Material_CustomMesh

move that to project content and make a material instance from it.

Place a “Water Body Custom” at 0/0/0 with scale 10.24/10.24/1

Import a texture like this,

FluidSim_presentation_512.DDS (512.1 KB)

open the material instance and set the “NormalAndHeight” Texture under “Global Texture Paramers” to the texture just imported. Furthermore, set “Fluid Displacement Multiplier” to 10.

(Edit: also set the water’s surface material to the material instance created)

Finally, make+place some actor blueprint with code like:

This appears all relativlely good:

It’s however difficult to say wether the geometry of the water now more matches the texture or it’s thumbnail.

Doubling the scale (in the blueprint actor) makes it look greater, and better for me.

The scale of the water body seems to have some influence on the geometry, it cannot be set to 100 without dropping more detail. That might be my problem. I used scales >100.

The water zone’s tesselation slider doesn’t have any influence on all that.

Didn’t get very different results with an explicitly tesselated plane using an WPO material. No idea how that could happen, however.

Back to the quads, @Arkiras was completely right, those quads come from the nearest point sampling that signed float point textures require. Maybe my present-to-surface tex was at low res.