3 way mapping (GLSL)

If you generate some data with the GPU or CPU, for example with the marching cubes algorithm, you don’t have texturecoordinates to texture the generated mesh. To solve this problem I wrote a 3 way mapping shader, which generates texturecoordinates, binormals and tangents only out of the vertex position and vertex normal. This technique was also presented in Nvidia’s “Cascades Demo Secrets” paper. To test the mapping I applied my parallax occlusion mapping shader.

Needed Extensions:

  • EXT_gpu_shader4 – only because of parallax occlusion mapping

Download:

3way-mappping.rfx (RenderMonkey 1.80)

Parallax Occlusion Shader (GLSL)

Sample Picture

I wrote a parallax occlusion Shader in Rendermonkey. Unfortunately due to the fact that the devartives in flow control elements are undefined, the ARB_texture_lod extension would be neccesarry for  this shader in glsl with shadermodel 3.0. Until this extension is released EXT_gpu_shader4 has to be used as replacement. So this shader only runs on gForce 8+ cards. Ati doesn’t support that extension yet.

Needed Extensions:

  • EXT_gpu_shader4

Download:

parallax.rfx (Rendermonkey 1.80)