🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untitled

posted in DruinkJournal
Published November 29, 2007
Advertisement
Captain retard strikes again.

I couldn't figure out what was going wrong with my refraction code (It was broken in another way that I fixed, then this bug shows up). Then I suddenly realised that the normals were all screwy and there was "weird stuff" happening. So, after going through the debugger, I noticed this gem:
// If first intersection distance is < 0, ray starts inside usif(fInDist < 0){   // Does the intersection occur within the ray length?   if(fOutDist > fLength)      return false;   // In primitive   info.fIntersectPos = -1;   info.fDist = fOutDist;}else{   // Does the intersection occur within the ray length?   if(fInDist > fLength)      return false;   // Hit   info.fIntersectPos = 1;   info.fDist = fInDist;}info.fIntersectPos = 0;info.vNormal = (ray.vPos + info.fDist * ray.vDir) - m_vPos;info.vNormal.Normalise();return true;

And guess what value is multiplied by the normal when the function returns true? [sad]

Anyway, here's the current image:


It seems to be working correctly. I'll have to run a few more tests to actually check that though.

Anyway. End of lunch, back to work, etc.
Previous Entry Untitled
Next Entry Untitled
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
Advertisement