wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.46k stars 476 forks source link

Improve culling by reducing displacement over-reporting #1108

Closed daleeidd closed 1 year ago

daleeidd commented 1 year ago

This is a significant improvement to the displacement reporting mechanism which expands the water tile bounds to prevent culling. In many cases these were being expanded much larger than they needed to be.

Height is now reported separately and takes the minimum and maximum as it was additive before. Bounds also have an offset applied instead of expanding on both sides of the sea level to encompass varying heights.

Both height and displacement that come from a local input (renderer, spline, etc) are bounds tested against each water tile so that only the applicable inputs are included when reporting.

The end result is a significant improvement to culling of water tiles.