6
$\begingroup$

I'm working on my own engine and I'm struggling to find any techniques that give okay-ish reflections in realtime on dynamic scene. So far the only technique I found that work in real time on dynamic scene is SSR but it's really heavy and have a lot of bias.

The idea of having multiple cubemaps and updating them in real time crossed my mind but because that mean re-rasterising the scene that also mean that every cubemap updated in realtime is a shadow casting that I can't do.

So my question is: is there another technique other than reflection probe (cubemap) or Screen Space Reflections ?

The artstyle of the game where the engine will be used is based on a lot of "almost mirror" reflections and it's not PBR.

[Edit] To be a bit more precise with what I'm searching:

  • I do not need more than one bounce.
  • I do not want any baking that cannot be done at "loading time".
  • I prefer if the technique work with a per-pixel normal but if you know a technique that work with a per-vertex normal I am also open.
  • I am open to techniques that only work in specific cases (like tiny scene, deferred rendering only etc...) as long as it meet other requirements.
  • If your technique is a feature of a global illumination technique I am also open but I would prefer if it work stand alone.
  • If it can easily support GGX it's better but not required.
  • Inaccuracy is not a problem as long as it is predictable by the artist
$\endgroup$

2 Answers 2

3
$\begingroup$

If there is only a few flat mirrored surfaces the solution is to render the scene again for each mirror, once normally. Afterwards you use stencils to mark the area where the mirror is visible.

Then only drawing into that area you render the scene again for each mirror but mirror it around the mirror's plane and cull any geometry on the wrong side of the mirror.

$\endgroup$
3
  • $\begingroup$ I will keep that in mind but I was talking about generalised methods $\endgroup$
    – newin
    Commented Mar 20, 2017 at 12:36
  • $\begingroup$ @newin When you say generalised, do you mean non-flat surfaces, or multiple flat surfaces? Do you require distortion of the reflections? Multiple reflections of mirrors in other mirrors? It would help to edit the question to specify what you do need and what you don't need, then answers can take that into account and focus on just what is necessary. $\endgroup$ Commented Mar 20, 2017 at 20:49
  • 1
    $\begingroup$ @trichoplax I edited my question with much more precisions I hope that's enough. $\endgroup$
    – newin
    Commented Mar 20, 2017 at 22:13
2
$\begingroup$

If you want a real-time solution (no baking), and only need one reflection bounce, you can try to generate (or update) a cubemap of the scene every frame, as described in this graphics study of GTA5 .

This solution should work in general cases (be sure to handle cases when the cubemap probe would be in an object of the scene).

If rendering the six faces of the cube every frame seems too heavy, you can try for example to update only one face at a time. You can then use some kind of average function when updating the faces so that the change between each frame looks smoother.

It is only an idea, there are many other solutions that one can think of.

$\endgroup$
1
  • 1
    $\begingroup$ It can also be done as a single camera placed in the scene at the correct angle and location to capture what the "mirror" would see given the current main camera's position. Render and lookup in a fashion similar to shadow maps, but this time get actual colors, transparency becomes a function of the normal for the triangle being rendered. This works for basic mirrors/windows/water. The rendering is done at a low resolution (half or 1/4) this gives blurry reflections, if the scene allows the size can be increased and clear reflections can be done. $\endgroup$
    – pmw1234
    Commented Aug 24 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.