• Advertisement
Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    423790

Correct Lighting! Huzzah!

Sign in to follow this  

267 views

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement