Character shading update, and more.

Published February 20, 2010
Advertisement
I just put some advanced shading on the new soldier/character model [ self-shadowing, indirect lighting, goggle shader, etc ]. In addition I've been working on the random map generator stuff [ fractal mountains, l-systems, erosion simulation, etc ]...so errr, ignore the flat/empty terrain in the background of the below images ;-) I also coded a new shield shader for the team bases. All while slowly improving most other aspects of the game, and actually increasing the frame-rates through a lot of optimization on old-rendering systems in the engine.

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
0 likes 6 comments

Comments

Jason Z
I like the force shield shader - I did something similar a while back where I used a factor similar to the halo to distort a texture lookup of the backbuffer itself. This produced a warping effect that I used as a shockwave from an explosion (expanding outward in a sphere).

The character shading also looks great. Keep up the good work!
February 20, 2010 10:24 AM
dgreen02
Quote:Original post by Jason Z
I like the force shield shader - I did something similar a while back where I used a factor similar to the halo to distort a texture lookup of the backbuffer itself. This produced a warping effect that I used as a shockwave from an explosion (expanding outward in a sphere).

The character shading also looks great. Keep up the good work!


Thanks! Yup, I have heat haze/distortion effects in the game on fire/explosions.

The original plan was to apply the distortion/haze effect to the forcefield...but it didn't end up looking as good as I planned. :-/

I'm happy with how it's looking with this technique though...I have some more ideas I will implement after a short rest.

- Dan
February 20, 2010 10:32 AM
mikeman
Very nice!

I kinda have a question though...I played the demo and liked it, but all those dozens of identical soldiers running around seemed more like an engine stress test than actual game situation...was it just a test or it's gonna be like that in the final game?
February 20, 2010 06:06 PM
dgreen02
Quote:Original post by mikeman
Very nice!

I kinda have a question though...I played the demo and liked it, but all those dozens of identical soldiers running around seemed more like an engine stress test than actual game situation...was it just a test or it's gonna be like that in the final game?


Thanks.

Yea, that was an engine stress test. There were 6000 soldiers per battlefield back then. It's been reduced to the final 1024. It's already a different game then that 6 month old BETA v1.0 I hope to release a new test version - but I'm trying to secure a publisher to help me out.

- Dan
February 20, 2010 11:08 PM
Gylis
Just wanted to jump in and give another vote for Forcefield looking amazing. Any chance of seeing the thing in action? ;)
February 21, 2010 07:52 AM
dgreen02
Quote:Original post by Gylis
Just wanted to jump in and give another vote for Forcefield looking amazing. Any chance of seeing the thing in action? ;)


Yup, soon as I finish this latest iteration of work on the terrain system I'll hopefully have some new videos to show :-D Thanks.
February 21, 2010 11:39 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement