Loading in the smoothing group info was a small mission in itself, one which began with trying to find info on how to get it out of a .3DS file. Implementing this actually spurred a revolution in my coding for being very specific about my longs (`32 or 64 bit?'), which seems to have somehow increased the frame rate of Synergy's various demos by up to 6Hz?!
Building upon the code from that tutorial I linked to in the previous post, the code for reading smoothing groups is about as simple as it gets.
I pondered for most of the day on how the process would actually work, sewing threads of ideas through the problem in my head, considering different approaches. What I finally ended up with was a brute-force algorithm with slight optimisations.
The road to reach this code was treacherous, though, with some interesting results along the way:
A World With 1 Normal
This problem was isolated and corrected relatively quickly, basically I didn't have the indices' blank normals initialised to be blank normals. So fixing that brought me to this:
Revenge Of The Cubes
Great. So some things looking lovely, others looking completely screwed. This proved to be part of a bigger problem, it also created seams:
Almost Anatomically Correct!
And generally just lead to strange lighting behaviour on flat surfaces:
Colt 1911s Never Looked So... Jaded
Although for the most part that Colt 1911 model (made by Dylan) looks very very sexy, one can quickly pick out areas which are rendered incorrectly.
I found the problem to be that the first index in a smoothing group wasn't included in part of the normal calculation! So, fixing that Synergy could now do the Colts justice:
I found the problem to be that the first index in a smoothing group wasn't included in part of the normal calculation! So, fixing that Synergy could now do the Colts justice:
Mission: Accomplished
So, what's next? Study! It's time to stop getting sucked into my projects and turn my attention towards trying to get HDs for my end of semester exams. So, until next week I guess Synergy will have to wait.
No comments:
Post a Comment