Character Shading
So the shaders on the character model previously has been just a basic shader that handled diffuse & specular lighting in tangent space of a normal mapped GPU skinned character. There was no self-shadowing on the character model [ ex: the arm didn't cast a shadow onto the body ]...also there was only support for a single directional light source. Also there was no consideration for the goggles on the character models, or reflective surfaces.
All that has been updated. There is now full self shadowing on all parts of the models, 'fake-indirect-lighting' [ through support for up to 3 light sources at once on each model ], and there is shader code for the goggles [ modulated by alpha channel in specular map texture ]. Also there is support for general surface-reflectivity on the skinned character models [ modulated by alpha channel in normal map texture ].
Here is a debug output of the new shadowing/shading.
Obviously self shadowing plays a huge role in the appearence of a character model - I'd say that was the most bang for the buck. This is an image of just self-shadowing added, and no other modifications to the old character shader.
Here is an image showing one layer of the 'goggle effect', I basically take the inverse of the dot product of the eye-vector and the surface normal and raise it to a power ... then I layer several of these multiplied by various colors. As well as cube-map-reflections on the goggle glass.
One other thing I did to increase the quality of the rendering was to calculate the shading for a second directional light which would simulate some sort of fake indirect lighting. Here is a debug screenshot of the lighting system - the red indicates the second light source...
Here are various screenshots of the new system - I'll be improving it over the next few days.
I also wrote a new shader for the team shields / forcefields...it is based off inverse eye-normal dot product as well to achieve the halo [ lol ] effect.
I'll keep you guys updated!
- Dan
The character shading also looks great. Keep up the good work!