Jump to content
  • entries
  • comments
  • views

A great start to the week

Sign in to follow this  


So I took a brief trip to Wales on Sunday. Been in bed ill for most of the time since then. Wonder if there's any connection...

Because of that I've done very little except manage to break yet more things. I'm contemplating changing my software development strategy - if I intend to break things then maybe they'll automagically start fixing themselves. Call it reverse psychology I suppose.

You know you're onto an absolute winner when you hard-crash your computer several times and eventually see this:

Doesn't strike me as a particularly good sign [headshake]

I've also been scratching my head over my blinn-phong lighting model. I was pretty sure it was correct, but a new model that I dropped in generated some odd results that's made me question it.

Given how simple the Blinn-Phong specular term is, and the fact that I can't find any resources online or in my books that don't agree, it's definitely something silly with my implementation. I'm thinking some input data is getting mangled somewhere - but I haven't been able to find it so far.

Admittedly, it looks pretty in a mathematical sort of way, but it's not the desired results..

Sign in to follow this  


Recommended Comments

a) Sure the light's on the right side?
b) The normals are correct I assume?
c) Copy FX file into here?

Share this comment

Link to comment
What is the wireframe stuff down below? I think Cypher is right, render the same scene and output the normals (scaled and biased) to check for obvious model errors.

Share this comment

Link to comment
Thanks for the comments!

The wireframe parts are just a debugging aid - they're drawing the normals/tangents/binormals at each vertex. They aren't directly "involved" in the actual rendering.

I've got a fun day of debugging, so I'll probably post back here when I've either found the problem or run out of ideas [grin]


Share this comment

Link to comment
* grumbles *

Still can't find anything wrong with my implementation. Everything is the same as what everyone else has done.

I think it might be me thats broken [headshake]


Share this comment

Link to comment
So, that screenshot is output (N.H)^s ?

Try to output N as the color. Does it make these weird patterns too ? Unlikely..

Are you reading N from a normal map ? Make sure it's converted back to the [-1;1] range (pointing out the obvious, but i guess your error *is* obvious, these are the most insidious).

If not, then it's coming from your H term. Output H into the color value to confirm that. How do you calculate H ? Normally, from 2 vectors: the to-light vector, and the to-viewer vector. Output each of these separately. Do they look good (no weird pattern) ? Then it's your H vector calculation that is at fault. Maybe one of the vectors isn't normalized..?

Share this comment

Link to comment
Thanks for the suggestions Ysaneya... I think it is the HALF vector that is wrong. I've not got it in front of me now, but I was getting some similar patterns from outputting just that vector...


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!