Ticket #579 (new defect)

Opened 3 years ago

Last modified 6 months ago

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.

http://www.vimeo.com/15241286

Change History

comment:1 Changed 3 years ago by Philip

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

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.

Last edited 6 months ago by wraitii (previous) (diff)

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.

Last edited 6 months ago by historic_bruno (previous) (diff)

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.

comment:8 Changed 6 months ago by k776

  • Milestone changed from Alpha 12 to 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

Last edited 6 months ago by k776 (previous) (diff)
Note: See TracTickets for help on using tickets.