Fragment shader based interior mapping
Published on .
Filed under
glsl
Seems like everybody is excited about the fake interior mapping in Spiderman these days. Here is a Kotaku video showing them off:
Now, the technique itself is nothing new, it’s been proposed by Joost van Dongen who published a paper about it here. The idea is to divide the space into evenly sized “rooms” and then cast a ray in the fragment shader to figure out whether the ceiling/floor or a wall was hit, and then map a texture on top. It’s super cool because it works without requiring extra geometry, the fragment shader is relatively cheap and easy to implement and like the Kotaku reviewer mentioned; The fact that the window is no longer just flat or a mirror adds depth (hah) to the world.
Read post