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?
1 Answer
Usually modern game engines use Screen Space Reflections 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 about that and presentations on the Internet.
-
$\begingroup$ 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. iquilezles.org/www/articles/terrainmarching/terrainmarching.htm $\endgroup$– bram0101Commented Jan 29, 2017 at 21:28
-
$\begingroup$ i will keep that in mind. Thank you for taking out some time for answering. $\endgroup$ Commented Jan 30, 2017 at 12:56