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

Horrible Moment Number 28

Sign in to follow this  


So, there I was, making screen shots for More OpenGL Game Programming when it occurs to me that, while I trust my formulas to be right I should probaly compare the per-vertex and per-fragment lighting to what OpenGL throws out.

So, a few extra lines added, two commented out and a program run later and I was crying into my drink as the two images didnt look at the same and as its unlikely that OpenGL is calculating the lighting wrong that means that I screwed up somewhere... oh joy [sad]

I then spent ages checking and yes, everything looked right and I couldnt understand what was wrong, so I did one last compare between my code and someone elses and finally the answer hit me, I was dropping infomation too early in the process, instead of maintain a vec4 for the eye coordinate position of the vertex I was chopping it to a vec3, this then seemed to muck up the vector to the vertex from the light which was shafting my lighting... a quick fix and a pray to the gods of Gamedev.net and lo! it did work and I was a slightly happier phantom [grin]

So, I'm pretty much ready to send Dave the stuff, I just need to produce a couple of diagrams and then re-read everything to make it reads right and doesnt look like I've just copied and pasted huge chunks from the GLSL spec (the only problem with trying to explain a language is that there are only so many ways to explain it and my own language sounds a bit like the spec... meh...).. which ofcourse I havent done [grin]
Sign in to follow this  

1 Comment

Recommended Comments

WTH? I don't recall getting any prayer forms from you...that must mean... YOU HEATHEN! How dare you worship another GameDev God!

Share this comment

Link to comment

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!