At one point Andrew, my course leader type, who watches over this module, said to me 'I assume you've got your TLM simulation work with some nice output?'.
There was a pause where I weighted up my two options;
1 - 'no, not as yet'
2 - 'yeah, it's no problem...'
Now, 1 would have earned me a disappointed look and some comments about not much time left, 2 on the other hand gets me off free and I just have to fake it a bit if questions are asked... [grin]
So, I totally went for option 2, bluffed it and came home thinking 'ah poo, I should really get this done'.
Sunday rolls around, I figure it's this or the 2D game thing and as I didn't fancy the Java I hit the code at about 3pm or so.
The code infact compiled and ran first time, huzzah!
And I thought I'd pulled it off, sure no driving data, but with a stable TLM simulation it was maintaining zero state...
Turns out I was wrong, once I did some minor debug to get something on screen I noticed it was wrong, plotting it to the colour channel showed that I had half a quad of red and half of black; it should have been all black.
The next 4h or so is spent trying to track the problem down, everything is tried from default init-ing things to 1.0f, checking clamp values, not running the sim and even removing the copy as I thought that was going wrong and I was only getting half the data or something.
Having confirmed all my textures were blank and I was definately setting a VBO to 1.0f and STILL seeing the same pattern I decided the data can't be getting into the shader right, and while I knew my attribute indices were sane at resource gathering I couldn't confirm at render time, so I went to check... and that's when I noticed IT.
A game of spot the difference follows;
if(heightStream_ > -1)
if(heightStream_ > -1)
The second snippet it right. [tears]
Yes, FOUR hours of debug work all because I'd used the wrong bloody var.
To quote my most recent SVN commit comment;
TLMFullShader sequence works without driving data. Remind me to use better names than 'buffer' and 'map' in future for things, apprently my brain isn't good enuff to notice the difference :(
However, the good news is that, pending any other stupidness, the TLM sim should now work properly once I give it some driving data.
Right now however, I'm going to go shoot myself a few times as I deserve it.