wave-harmonic / crest

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

Fix water renderer bounds thrashing in edit mode #1106

Closed daleeidd closed 1 year ago

daleeidd commented 1 year ago

Fixes renderer bounds thrashing in edit mode if using RegisterAnimWavesInput, RegisterHeightInput or Whirlpool.

There was a mismatch in reporting maximum displacement where the OR was clearing reported displacement in EditorApplication.update but these components were reporting in Update. Chunk renderer bounds are updated in Update so it would have alternating reported displacements which caused thrashing. It incurred a performance penalty and incorrect culling.