wave-harmonic / crest

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

Massive performance issues at certain locations #661

Open dkyeck opened 3 years ago

dkyeck commented 3 years ago

Describe the bug we have a large island of 4x4km surrounded by a crest ocean. running around on the surface of the terrain we have noticed some really dramatic performance issues (fps going down from 38 to 4) only at a few and rather small locations (like 8 square meters). we tracked it down and actually disabling the ocean fixed all performance issues. so le me describe the situations i which it happens: the locations where these drops happen are in the middle of the terrain where there is no single pixel of the ocean actually visible on screen as it is all covered by the terrain. if the camera is at certain locations (like -1004 107 80 or -613 173 81) the frames just drop based on the view direction. nothing special here and as i wrote: disabling the ocean just fix all issue.

using the unity profiler both cpu and gpu go crazy here. using renderdoc however gpu timings look close to normal. so i assume it be a problem with the cpu side. uniy profiler could not produce any more valuable output than the on i have attached: "ExtractRenderNodeQueue" goes crazy here stalling the entire cpu. this is the closest i could get. using deep profiling just noised the entire picture. cputimes

any bell ringing?

Versions Which render pipeline? HDRP 9, unity 2020.2.0b2

Platform

huwb commented 3 years ago

Thanks for reporting, that sounds quite bizarre.

If you have the example content scenes could you try reproducing it there?

Are there any errors or warnings in the log?

dkyeck commented 3 years ago

thanks for coming back to me. i have been able to fix it meanwhile. the issue was caused by the fact that we enabled probe blending on the ocean tiles... as we use the "Indirect Diffuse Intensity" override in our post processing stack to control ambient lighting and create a day night cycle we cannot simply use the ambient light as coming from the physically based sky but actually have to pick it up from our light probes in order to prevent foam from getting pitch black at night. when using blended probes unity seems to have a hard job doing so if there are objects who's bounding box centers are not enclosed by light probes.

providing an anchor override fixed it.