Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Correct Lighting! Huzzah!

Sign in to follow this  


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

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  


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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!