« Sponsored Feature: Intel Calls All Game Companies as Partners | Main | Adding YouTube Integration to Games »

Simulating Reflections For Wet Asphalt

reflection.jpgThe C0de517e blog, written by a game rendering engineer, has an in-depth post up entitled "Impossible is approximatively possible," dealing with simulating realistic reflections on wet asphalt -- in particular with filling in the gaps of what data is impossible to conclusively simulate with approximations that can be generated by the GPU.

As the author describes:

"We have two things that we don't know, the reflection direction and the travelled light ray distance between the track and the bike, and those are possible to compute only using raytracing... Let's try now to fill the holes using some approximations that we can easily compute on a GPU.

"First of all we need the direction, that's easy, if we consider our reflections to be perfectly specular, the BRDF will be a dirac impulse, it will have only one direction for which it's non zero, and that is the reflected direction of the view ray (camera to track) around the (track) normal.

"The second thing that we don't know is the distance it travelled, we can't compute that, it would require raytracing. In general reflections would require that, why are the planar mirror ones an exception? Because in that case the reflection rays are coherent, visibility can be computed per each point on the mirror using a projection matrix, but that's what rasterization is able to do!

"If we can render planar mirrors, we can also compute the distance of each reflected object to the reflection plane. In fact it's really easy! So we do have a measure of the distance, but not the one that we want, the distance our reflected rays travels according to the rough asphalt normals, but the one it travels according to a smooth, marble-like surface. It's still something!"

The author includes a few code examples, based on previous R&D work he did on a shipped racing title, and has even posted a followup blog entry that delves deeper into his blurring algorithm.

About

This specially written weblog combines Gamasutra and Intel knowhow to present and deconstruct the latest happenings in visual computing and game technology.

Editor: Eric Caoili

Recent Comments