This is a parallax occlusion mapped cube, with the gridlines added programmatically in the pixel shader. It's a nice cue about where the surface is being distorted based on the parallax effects. The code is relatively simple as well, as shown in the following listing:
// Define the 'GRIDLINES' preprocessor directive to draw the gridlines// on the texture surface. This helps visualization of the simulated surface//#define GRIDLINES#ifdef GRIDLINES float2 vGridCoords = frac( vFinalCoords * 10.0f ); if ( ( vGridCoords.x < 0.025f ) || ( vGridCoords.x > 0.975f ) ) OUT.color = float4( 1.0f, 1.0f, 1.0f, 1.0f ); if ( ( vGridCoords.y < 0.025f ) || ( vGridCoords.y > 0.975f ) ) OUT.color = float4( 1.0f, 1.0f, 1.0f, 1.0f );#endif
The idea is to multiply the current texture coordinates by the number of gridlines desired per wrapping of the texture. Then take the fractional portion of the result and compare it to a lower and upper limit, coloring if it falls outside of the given range. When working with POM it seems to help out quite a bit and it looks cool too!
What does the overall effect look like if you get the textures to match-up seamlessly on the edges of the cube? Looks to me like the only thing that breaks the illusion...
Jack