<p>Usually modern game engines use <a href="https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/ScreenSpaceReflection/" rel="nofollow noreferrer">Screen Space Reflections</a> which is some kind of screen space raymarching.</p>

<p>Basically, a simple way to achieve this is to shoot rays from the G-buffer. This means you use your depth buffer as a height field by raymarching any ray you cast. Then sample the normal at this position and take the final composed lighting from you previous frame and project it.</p>

<p>Although it has the usual drawbacks associated with any screen space method. This means you only have what is visible in front of you (screen space) to compute your reflections, so anything outside the screen would require tricks to have them get reflected on your current frame (e.g. you can combine this with environment mapping reflections and such).</p>

<p>You can find a few <a href="http://casual-effects.blogspot.fr/2014/08/screen-space-ray-tracing.html" rel="nofollow noreferrer">articles</a> about that and <a href="http://www.frostbite.com/2015/08/stochastic-screen-space-reflections/" rel="nofollow noreferrer">presentations</a> on the Internet.</p>

CC BY-SA 3.0
2017-01-29T21:28:52.213Z
I just want to make an addition to this. This article explains ray marching really well, but it uses a function to generate a height map when you give it the x and y value. You can change it so that instead of that function, it reads it from the depth buffer. http://www.iquilezles.org/www/articles/terrainmarching/terrainmarching.htm
bram0101
CC BY-SA 3.0
2017-01-30T12:56:28.400Z
i will keep that in mind. Thank you for taking out some time for answering.
videogamechef
CC BY-SA 3.0
2017-01-29T19:58:21.713Z
2017-01-29T22:14:55.970Z
2017-01-29T22:14:55.970Z
CpCd0y
<p>I want to know about some technique with which i can generate nice reflections on the surface. I know one conventional technique where we invert an object and render it and blend it with the floor but in this technique each object has to be rendered twice which is not good. Is there any other technique to achieve the same result?</p>

CC BY-SA 3.0
2017-01-29T20:12:52.383Z
Very similar question: [Mirror Reflections: Ray Tracing or Rasterisation?](http://computergraphics.stackexchange.com/q/4585/48)
Nathan Reed
<opengl><rendering><real-time><reflection><pixel-graphics>
Which technique is fast to generate real-time reflections?
videogamechef
# Which technique is fast to generate real-time reflections?

(Asked by: username_0 on 2017-01-29)

I want to know about some technique with which i can generate nice reflections on the surface. I know one conventional technique where we invert an object and render it and blend it with the floor but in this technique each object has to be rendered twice which is not good. Is there any other technique to achieve the same result?

**Tags:** opengl, rendering, real-time, reflection, pixel-graphics

> **Comments:**
> **username_1**: Very similar question: [Mirror Reflections: Ray Tracing or Rasterisation?](http://computergraphics.stackexchange.com/q/4585/48)  

---

## 1 answers

### Answer by username_2 on 2017-01-29. Score: 2

Usually modern game engines use [Screen Space Reflections](https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/ScreenSpaceReflection/) which is some kind of screen space raymarching.

Basically, a simple way to achieve this is to shoot rays from the G-buffer. This means you use your depth buffer as a height field by raymarching any ray you cast. Then sample the normal at this position and take the final composed lighting from you previous frame and project it.

Although it has the usual drawbacks associated with any screen space method. This means you only have what is visible in front of you (screen space) to compute your reflections, so anything outside the screen would require tricks to have them get reflected on your current frame (e.g. you can combine this with environment mapping reflections and such).

You can find a few [articles](http://casual-effects.blogspot.fr/2014/08/screen-space-ray-tracing.html) about that and [presentations](http://www.frostbite.com/2015/08/stochastic-screen-space-reflections/) on the Internet.

> **Comments:**
> **username_3**: I just want to make an addition to this. This article explains ray marching really well, but it uses a function to generate a height map when you give it the x and y value. You can change it so that instead of that function, it reads it from the depth buffer. http://www.iquilezles.org/www/articles/terrainmarching/terrainmarching.htm  
> **username_0**: i will keep that in mind. Thank you for taking out some time for answering.  

---

