The Dreaded OSX Bug (or F&#% nVidia). Also Hi!

Heya, I’m HACKhalo2, the on again/off again secondary coder for Voxel (mostly due to real life issues sapping any energy I have). I’m going to be around doing things and stuff behind the scenes, helping Guerra as much as I can and trying to make Voxel the best it can be. Anyways, to the good bits of this Post.

Over the last couple of days, Guerra and I were banging our heads together trying to figure out why in the everloving hell Voxel was working flawlessly on his computer, but wasn’t working at all on mine. We both have different OS’s and hardware, which is great when developing a game. It also sucks a whole lot of golf balls through garden hoses when a bug like this pops up. And it was literally the dumbest bug there could be, that shouldn’t of broken everything, but it did.

In the F_Tessellator shader file, line 26, is a vec3. That vec3 used to be a vec4, and that vec4 broke the Tessellator for literally every system and every OS, except systems using nVidia GPUs. Why was nVidia spared from this horridly stupid bug, you might ask? There are two ‘theories’:

  • nVidia is lax on it’s GLSL spec compliance. It allowed a vec4 to be incorrectly used as a vec3.
  • nVidia is lazy as the Duck Hunt Dog and just likes to laugh at you while you waste hours tracking down stupid bugs that should be throwing parser errors anyways.

There was also an GLSL extension Voxel was using that was nVidia specific (or at least only currently implemented on the GeForce drivers), ARB_shading_language_include, that loved to completely crash the JVM if used outside it’s little safe space. I wrote a co-preprocessor, the ISL (Includes Shading Language), to mimic and extend this behaviour for Voxel so all platforms can benefit from it. There are plans to extend the ISL farther to make Voxel’s GLSL shaders more dynamic, but that’s down the line. I’ll make a blog post about the ISL next week sometime.

That’s all for today! Until next time.