PDA

View Full Version : GLSL Tangent Space Bump Mapping Demo



dpoon
11-17-2006, 05:59 AM
Hi All,

I've been investigating tangent space bump mapping lately and I have put together a demo showing how it's done. I have included shaders for all 3 light types: directional, point, and spot lights. I have also included code to calculate the tangent, bitangent, and normal vectors.

For further details and download links please visit www.dhpoware.com (http://www.dhpoware.com)

Komat
11-17-2006, 01:03 PM
It is error to normalize the lightDir and viewDir vectors within the vertex shader. If you do that, the interpolated direction will be incorrect. Additionally you are calculating attenuation from the normalized lightDir which is not correct.

dpoon
11-17-2006, 05:17 PM
@Komat: thanks for spotting these errors. I've uploaded a new version of the demo with fixes to these errors.