Water Culling or Modified Water Mesh

Feedback on past, current, and future development.
Post Reply
killpixel
Posts: 2
Joined: 21 Dec 2021, 19:05

Water Culling or Modified Water Mesh

Post by killpixel »

Unfortunately, the water mesh is present beneath the entire terrain mesh, which is a huge performance loss since at all times water, reflections, refraction, shadows, etc are being calculated and drawn.

I'm wondering if there is a feasible way to cull occluded portions of the water mesh. If not, maybe a modified, hand-culled mesh could be enabled? Thoughts?
Attachments
screenshot002.png
screenshot001.png
Last edited by killpixel on 22 Dec 2021, 18:50, edited 1 time in total.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Water Culling or Modified Water Mesh

Post by AnyOldName3 »

We actually do cull the water plane and the associated RTTs when we can guarantee there's no water on the screen, but that's surprisingly rare in Morrowind. When none of the visible terrain chunks have any points below the water level, we know it's safe to skip water, but otherwise, it isn't guaranteed. If we did more detailed tracking to work out if all of those low points were hidden behind other things, it would likely get more expensive than just drawing the water, and if we tried to track which parts of the water were hidden so we could skip those parts of the RTT passes, it wouldn't give us any more opportunities to cull things very often as once there are two visible patches of water, lots of object bounding volumes will overlap them. Skipping parts of the water plane itself won't be worthwhile as it's far cheaper than the RTT passes, and modern GPUs are very good at skipping drawing things behind other things, so splitting it into multiple draw calls so we only dispatched some of those draw calls would be more expensive than just having the single draw call.

tl;dr: we already do what we can, within reason. There's other lower-hanging fruit for further optimisation if we're going to be putting work in.
killpixel
Posts: 2
Joined: 21 Dec 2021, 19:05

Re: Water Culling or Modified Water Mesh

Post by killpixel »

AnyOldName3 wrote: 21 Dec 2021, 20:08 tl;dr: we already do what we can, within reason.
That's what I figured :P I haven't modded morrowind, but I think I'll poke around and see if I can simply use the terrain mesh to subtract from the water mesh which would remove all subterranean water. The remaining water would be comprised of many more tris, but I don't think that would be a problem... not sure if the vanilla water mesh is one giant quad or perhaps subdivided.

Anyway, OpenMW is ace - really love it.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Water Culling or Modified Water Mesh

Post by AnyOldName3 »

For future reference, until the forum software trusts that you're a human (based on several posts getting approved), editing your posts hides them and puts them back into the moderation queue, so it's best not to do that for now.

As I said in my last post, actually drawing the water mesh is a tiny fraction of the cost of drawing the water. Modern GPUs are good at skipping bits of a mesh that are behind other meshes. It's the render-to-texture passes that show the objects reflected and refracted by the water that are really expensive, and we don't have much opportunity to cull pieces of those even if we knew which bits we could cull.
Post Reply