Correct Lighting! Huzzah!

posted in Not dead...
Published January 23, 2005
Advertisement
About a month ago I got distracted by something and decided that working out how to display Doom3 MD5Mesh models, complete with diffuse, normal and specular maps.

After a few issues with my maths being a tad tits up (and mucho thnaks again to joanusdmentia for helpping me sort out my stupidness) I finally got model loading and displaying with a diffuse map up and going towards the end of last month.

Since then I fiddled with the normal mapping, and I thought for a while I had it right but it always bugged me that something wasnt quite right and finally today I worked it out, stupid light position wasnt in the same space as the EyeDir, so the LightDirection vector wasnt remotely sane, so while lighting mostly worked it was a tad flakey.

Before I worked that out I added the specular parts to it as well, closely matching the Doom3 system (it currently lack light fall off values, chances are I'll use maths to work that out however).

Next on my list, animations, first in software then in a vertex shader (however, this could depend on ATI fixing their GLSL compiler as atm it has issues when you try to make a skinning shader).

So images for you...
Image 1
Image 2
Image 3
Image 4
Image 5
Image 6 (taken from behind the model)
Image 7

Edit:
Model ad texutres from Doom3 ofcourse.
The white thing is the light position.
the blue, green and red lines are the normal, tangent and bi-tangent at each vertex.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement