Jump to content
  • Advertisement
Sign in to follow this  
WhateverMan

How to get non-planar ground reflections with a realtime cubemap?

This topic is 1001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I recently played NFS U2 and noticed that the road reflections are quite accurate, compared to SSRR methods. It's mighty fast aswell, since I can play the game maxed out on a laptop, while SSRR is quite impossible on a laptop. I'm writing code(C#) and shaders in Unity 5 if thats important to point out.

So here is a video I found on youtube wich describes the reflections quite well:



My personal guess is that there is a small mix of screenspace rendering and a cubemap going on? Because I tryed a mirrored cubemap rendering method and the results were not as good. Infact they were terrible. I had 2 different results, one of where the reflected ground was hanging way beyond the reflection plane and the other had some normal issues, but was more accurate. Both required a cliping point input wich I calculated with a raycast under the camera. Not the best way to do it, but it worked for testing.

Here is a Unity3d link for the mirrored cubemap renderer method (not mine but the basics are the same):
http://twiik.net/projects/realtime-reflection-example-scene

Here are some screenshots I took from the video, on the left is the original and on the right is the mirrored view, for comparsion.
nfsu_mirror_1.jpg

nfsu_mirror_3.jpg

 

Another guess would be that there is some sort of a rendering matrix, and the rendered image is wisely placed along the surface?!

And exucuse me for my bad descriptions, english is not my natural language and my grammar might be of.

Share this post


Link to post
Share on other sites
Advertisement

It's look planar reflection. You just need to aproximate road under the car and 25-50 meter front of it as a single plane. Could this work for you?

Share this post


Link to post
Share on other sites

This is what I did and I got some awkward results, I'm thinking it's because of some normal's are not properly calculated in the shader. This is my result:
Unity_Ground_Reflection.JPG

 

As you can see the reflections are quite messed up by the normals
 

Share this post


Link to post
Share on other sites

And here's a quick example of the "working" method.

As you can see it's far from perfect, the reflections jump from time to time, because of the ray checking for the road beneath. And the main problem with the normals, sometimes the reflections get "cut" from their original reflection direction.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!