wave-harmonic / crest

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

Distant Reflection Flickering #111

Closed GeorgeDziov closed 5 years ago

GeorgeDziov commented 5 years ago

https://www.youtube.com/watch?v=8QnS05wTjTc&feature=youtu.be

While reflection looks perfect up close it gives some flickering as if geometry going nuts on large distance. I checked reflection camera and it seems to be exactly same as main camera. I tried playing with clipping plane but no luck so far, the only thing I can do now is decrease "Far" till distant objects are invisible.

100% sure I'm missing something, can't get what though.

Branch: Feature Underwater Skirt, downloaded on 28.10.2018

huwb commented 5 years ago

Hm thats weird. It might be because the reflections were catching underwater skirt stuff. I just pushed a speculative fix, could you try on latest from master?

GeorgeDziov commented 5 years ago

Nope, still flickering. I'll also try creating an empty project and try putting Crest and moving stuff there just to make sure it's not my project's fault.

GeorgeDziov commented 5 years ago

Created a new project - no flickering, even imported my meshes and moved them far away. Also no flickering in new scenes so turns out it's scene specific issue.

For now I'm closing the issue if you don't mind but I'll let you know if I face flickering again.

huwb commented 5 years ago

Sure. The flickering almost looked like z fighting to me but I'm not sure. What are your near/far plane distances?

GeorgeDziov commented 5 years ago

At first it was from 0.01 to 100 000 which worked fine in any case with any ocean, then after getting this flickering I tried rising "near" to 100 and lowering far to 2000 but that didn't help, only "far" 1000 worked but that doesn't look fancy to me. In the new scene or in Crest example, however, even setting "far" to 100 000 works fine.

Indeed it looks like z fight but I can't understand why does that happen so close, can't even tune "far" higher than 1000. But there's no flicker on the main cam. Is there something I can do about reflection cam parameters? There's also something with dynamic occlusion (I don't bake standard occlusion atm) but I better post a separate issue about that.