Hey everyone! I thought that since a lot of people seems to have grasped the workings of shader effects, I'd release my modified shader as well, which I've tinkered with on and off for some time. It's from nVidia's FX Composer library (originally called phong/bump/relfect or something alike) but
heavily modified, and I've been granted permission from a guy over at nVidia to release it to you guys. I was even encouraged to do so.
It works sort of like the bumpcubereflectalpha-shader from the FPSC library, but even better, if I may say so myself. It uses phong-shading and has specular reflection, although the specular reflecivity (strength of the relection) is currently a fixed value (can be changed through some haxxoring with the shader file
), I'm working on implementing support for using specular maps, so far it only works with character entities.
The specularity reflects in the direction of the light, like the previously mentioned FPSC shader, and the color of the light is also reflected correctly with this shader. Keep in mind though that FPSC does not support reflection of multiple lights natively. If your shaded object is in between two differently colored lights, FPSC will calculate an approximate 'mix' of the two light colors and pass to the shader.
Another thing that I'm working on is support for alpha maps for transparency, which currently
doesn't work.
Everyone knows that pictures can speak louder than words, so here are some screens of it in action.
Aiko walking around in a very well-decorated room I made. Please note that the level of irony in that sentence was extremly high. xD
Here's a shaded Conker, complete with working specular map, as you might see from close inspection.
And here's a quick example of colored lights working. As you can see, the middle barrel reflects a slightly purple-ish light, since it's between red and blue.
The shader, or one of it's many variations I've made (this one works best though), is attached to this post. Just use the usual D/D2 and N suffixes, and things should work fine. S for specular maps for characters should work as well. Anyhow, enough talk, enjoy!