Ticket #579 (new defect)
Water reflections bug
| Reported by: | frapell | Owned by: | wraitii |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | Backlog |
| Component: | Core engine | Keywords: | |
| Cc: |
Description
When watching an object through a water reflection, but this object is outside the camera, unwanted behaviour is observed. I uploaded a video to show the bug.
Change History
comment:2 Changed 3 years ago by anonymous
- Milestone Unclassified deleted
Milestone Unclassified deleted
comment:3 Changed 3 years ago by wacko
- Priority changed from major to minor
- Milestone set to Backlog
comment:4 Changed 7 months ago by k776
- Owner set to wraitii
- Milestone changed from Backlog to Alpha 12
comment:5 Changed 6 months ago by wraitii
Okay, so this is actually sort of a duplicate to #504 (which I sadly noticed after 3 hours of tinkering.)
Basically everything works properly, the trouble is that objects too far-away get culled in the pre-rendering phase, and thus pop up suddenly. Mostly trees, since they are tall. Namely, there is a call to CGameView::BeginFrame? which updates the cull-camera, and then Crenderer::RenderScene? culls the models too far away (I believe it's enumerateobjects() that does it).
Information can be found through CRenderer::DisplayFrustum?().
The easy way out is pushing CGameView::GetCullFOV() higher, right now it adds 6 degrees. Adding about 15/20 mostly solves the issue for trees, however it comes at a semi-serious rendering cost. It could perhaps be made "setting dependent", ie if reflections are wanted push it above, if not don't.
Linked to #504 because it's sort of the same issue, though it's worse for #504 as shadows might require an even bigger FOV change, and obviously that's just out of the question. However, fixing #504 properly could fix #579, or perhaps the same method could be used to fix both.
I'm waiting on your opinions, but I don't really have time (must do AI work) or skill to fix that particular problem.
Edit: I believe Philip's last comment on #504 is still mostly relevant and mostly right.
comment:6 Changed 6 months ago by historic_bruno
As I understand it, the only way to do #504 properly is to determine exactly which objects cast shadows falling into the camera view (similar for reflections). If we have a solution for #504, then we have a solution for this ticket, albeit slightly different. What we have now is already a hack that expands the culling FOV a bit, with side effects like worse performance (as you mentioned), decreased shadow map detail, and it still won't work with combinations of arbitrarily tall objects, low sun angles and camera views. So yeah, simply expanding it more as a hack would be worse.
If I remember correctly a past discussion with Philip, there are actually at least three cases to consider: shadows, reflections, and refractions.
comment:7 Changed 6 months ago by wraitii
Refraction seem like less of a problem. First, the water is often fairly murky, so you usually couldn't see any object that could be culled. Furthermore, there rarely are any object underwater that would cause the issue. But I guess it could happen.
So yes, this is basically unfixable unless it's really tackled thoroughly.

This is a roughly similar problem to #504 - it's using the wrong camera frustum for culling.