#579 closed defect (fixed)
Water reflections use wrong camera frustum for culling
Reported by: | frapell | Owned by: | philip |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 17 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
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.
http://www.vimeo.com/15241286
Related: #504
Change History (13)
comment:1 by , 14 years ago
comment:3 by , 14 years ago
Milestone: | → Backlog |
---|---|
Priority: | major → minor |
comment:4 by , 11 years ago
Milestone: | Backlog → Alpha 12 |
---|---|
Owner: | set to |
comment:5 by , 11 years ago
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 by , 11 years ago
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 by , 11 years ago
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.
comment:8 by , 11 years ago
Milestone: | Alpha 12 → Backlog |
---|
Moving to backlog. Perhaps myconid's upcoming changes to the renderer will make generating shadows a lot less problematic. We'll wait and see. Refs #504
comment:9 by , 11 years ago
Description: | modified (diff) |
---|---|
Summary: | Water reflections bug → Water reflections use wrong camera frustrum for culling |
comment:10 by , 11 years ago
Summary: | Water reflections use wrong camera frustrum for culling → Water reflections use wrong camera frustum for culling |
---|
comment:11 by , 11 years ago
Owner: | removed |
---|
comment:13 by , 10 years ago
Milestone: | Backlog → Alpha 17 |
---|
This is a roughly similar problem to #504 - it's using the wrong camera frustum for culling.