September 17th, 2003 - Time Passer 2.0
Whew, where do the days go? Better start from the beginning.
First of all, I decided to start messing around with more extensions. Currently - vertex programs, aka, vertex shaders. Boy, those can do some nifty things. I finally understood the difference between per-vertex lighting and per-pixel lighting last night, not to mention exactly how each worked, as I stared at the vertex shader version of OpenGL's rendering code. It is fascinating to know this stuff after so long thinking I should never understand it. Here is a screenshot of the fruits of my labors:

I know it is hard to tell from that pic, but effectively the VP acts as a simple diffuse light. I still havent tried it on a high poly count (to test the speed of these things), mostly because of a reasons I shall outline further in this post. I think the best purposes for VPs will come with things like camera effects. First of all, you are controlling geometric position, texture coordinates, and vertex color, which lacks the precision of some of the cooler effects. But I bet with a little clever thinking, you could come up with some real cool stuff. Also, the universiality of it (it is inside OpenGL's rendering pipeline) means that if I want everything to turn blood red all of the sudden, I just have to put a vertex program into place that will change all of the vertices' colors to red. Essentially, it allows me to be lazy with my rendering pipeline, knowing that I can just mess with OpenGL's further down the line ;).
Now, why haven't I tried a high-poly VP test yet? Well the most despicable of bugs surfaced to me, of the crashing variation. A bug that not only refused to reveal the offending code to me, but was occuring in OpenGL's code. I had no idea what was causing that bug. The only clue I had was that it happened when I tried to render the world. It is like a puzzle, you know? So I uncomment the world rendering code... and still a crash, just as cryptic, just somewhere else. WTF?
I had really thrown myself for a loop on this one. Turns out that there were not one, but two different bugs. Of course, what I immediately thought had happened is that in my previous night's ventures, I had edited some code that was fatally affecting mine. Enabling/Disabling some state in OpenGL, something like that. Turns out that the VP tests had nothing to do with it. The problem with the world rendering happened to be with my VBO code. I didn't know it (since I worked from documentation, not example), but I needed to get OpenGL to give me a valid handle for my VBO. I had previously just been using constants - 0 for vertices, 1 for texture coordinates, 2 for normals. So eventually I found that out and fixed it. The other problem was with something in the UI I had put in the night before I started messing with VPs, that I never got to test. It was by some amazing coincidence that both of those bugs surfaced at the time they did, and it is certainly one to go in the record books.
Now I am off to test the shader on my world! Aie!