Tuesday, July 19, 2005

Additions to Normal Map Shader

Some of the guys over on the Polycount board have been asking for some additional features to my normal map specular shader (the one with support for three lights) so I updated the shader to add them. Here's what I changed:

The shader will now work on ATi cards! Instead of doing all three lights in one pass and blowing the instruction count budget, I split it up so that each light gets its own pass.

I added a color specular mask texture. This means that you can control the color of the specular highlight per-pixel with a texture map. Before I was just using the alpha channel of the diffuse texture as the specular mask - so per-pixel color adjustments weren't possible. Now they are.

I added a check box that allows you to quickly switch back and forth between the ATi and Nvidia formated normal maps (negative and positive Y). This makes working with both formats more convenient. Right now it's happening in the pixel shader - but I may try to switch that so it happens in the vertex shader for better performance.

I'm happy with the way this one turned out. With these changes, it should be a useful tool for working with normal mapped models in 3ds Max. You can get the updated version of this shader here:


Also available on that page is a new version of the shader that uses the alpha channel of the diffuse texture for transparency. I think I'm going to work on this version of the shader a bit more and then maybe I'll add these features and updates to all of the other shaders - where they apply.


Post a Comment

<< Home