1
$\begingroup$

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?

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
  • $\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$ – bram0101 Jan 29 '17 at 21:28
  • $\begingroup$ i will keep that in mind. Thank you for taking out some time for answering. $\endgroup$ – Ankit singh kushwah Jan 30 '17 at 12:56
  • $\begingroup$ No problem. If the answer did satisfy you, don't forget to accept the answer. Otherwise, we can try to discuss further the question ;) $\endgroup$ – CpCd0y Jan 31 '17 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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