More intelligent culling/triangulation for fluid side texture planes
muzikbike opened this issue ยท 1 comments
Request Description
This probably wouldn't improve performance but is something to consider when fixing other reported issues with the fluid renderer (#1210, #1211, #1212, #2470, #2471, etc.)
Here's a simple setup with water and slabs:
The shallower sections are correctly culled by the sides of the slabs. However, for the deeper region, since some of the water level is above the slabs, the game does not cull them at all. This looks fine in most situations, but when you look under the surface, this means that a dark water texture occludes the slab, which does not happen for the shallower sections, and there is a hard line between where this is the case and where it is not.
It would probably look considerably better in this section to take a middle ground and only render the side of the water over the area not occluded by the slab, and render nothing on the occluded area.
Here's another case with farmland as the occluding block. At normal height, the water's inner planes aren't rendered against the farmland as the water level is lower than the height of the farmland. Raising the height of the water to a full block will cause those planes to render. The ideal case would be for the side textures to only render one pixel high at the very top, which would look much better.
The problem with fixing this is that you'd need to "mask" out the part of the water that is occluded by the neighboring block, which may be arbitrarily complex. If the block is a stair, it's basically impossible to mask out just part of the water quad to only render it where it doesn't overlap with the stair. I'm not sure if it's even possible to extract a "height" with which we can crop the water quad from the neighboring block's shape.