Spellcaster Studios

Make it happen…

OpenGL Porting – Part 12

More progress done on the OpenGL renderer… Today I managed to make lighting work again…

screen355

Issue was the variable naming… In DirectX, when you have a structure array, there’s a constant binding with that name (for example, “lights”), for the whole array.

OpenGL does it slightly different: it creates different variables for each sub-entry, so we’d have “lights[0].pos”, “lights[0].color”, “lights[2].dir”, etc… Wasn’t expecting it… The DirectX way is better, in my opinion…

Anyway, I had to make a small parser for the variable names to create the bindings, but now the lighting is working… The small dark areas in the screenshot above are due to bad voxel bounding boxes (at least, that’s what I think, although I have no idea why that applies to OpenGL only)… That’s my next job!

Now listening to “Renegade” by “Hammerfall”

Comment