wave-harmonic / crest

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

Premature tile culling during extreme camera maneuvers above the ocean #1148

Closed Revmatek closed 3 months ago

Revmatek commented 3 months ago

Is there an existing issue for this?

Have you checked the documentation to resolve your problem?

Current Behavior

Depending on settings you will see tiles disappear in the air due to being interpreted as culled/not visible by the Renderer (at least that is what it seems like is going on).

Expected Behavior

Tiles should always be visible when visible on screen.

Steps To Reproduce

  1. Open main.unity
  2. Increase the camera Lin Speed to 100 on Cam Controller
  3. Decrease the Far Plane Multiplier to something small like 0.1 (you may wish to play around with that) on Underwater Renderer
  4. Possibly needed, decrease the Near clipping plane to 0.1f on the Camera
  5. Increase the Far clipping plane to 100000 or 500000 on the Camera
  6. Jerk the camera around wildly changing rotations like you are in a fast moving jet or something
  7. Observe tiles being culled on left and right edges of the screen

Video (ignore white line recording artifacts on edges)

https://github.com/wave-harmonic/crest/assets/114962753/a316960e-ef51-45af-b284-b0df0b09965f

Screenshots from video frames

Right side: image image Left side: image image

Unity Version

2021.3.26

Crest Version

4.19

Render Pipeline

Built-In

Editor or Standalone

Editor (Edit Mode), Editor (Play Mode), Standalone

Environment

No response

Anything else?

This has something to do with the extents in OceanChunkRenderer->ExpandBoundsForDisplacements and Unity (perhaps because of the extreme camera settings) culling the tile renderer prematurely. I have been working around / ignoring this by arbitrarily increasing the size of the extents:

bounds.size *= 2;
daleeidd commented 3 months ago

Thanks. Fixed for 4.20.