Depth parallax
Today I implemented depth parallax on a quad with two textures. The algorithm creates the illusion that we have two surfaces instead of one. It’s really cool! Check out the screenshots below. The first one shows the initial multi-textured quad. The blue texture is the outer layer and you can see the inner texture through it.
Now this is the same quad after we rotate the view. The depth parallax algorithm creates the illusion of depth.
The code for doing this is pretty simple; we use a simple pixel shader and an even simpler vertex shader. We don’t even have to enable blending or even multi-texturing! We just pass the textures to the pixel shader and let it compute the final color for us.