Steady progress

· by Steve · Read in about 2 min · (248 Words)

I’m making steady progress on shadow support, not as fast as I’d like but that’s nothing new 😉

I’ve recently cleaned up the stencil creation code in all the rendering systems, added support for representing all types of lights as a 4D homogenous vector, which makes many of the calculations a lot easier, added software mesh extrusion and shadow volume construction code, added detection of the cases where you need to use zfail instead of zpass (this is where the shadow volume intersect the viewport; you only want to use zfail when you have to though because it requires the use of light and dark caps), and basically lots of infrastructural bits and pieces. I want to make sure I get all the structure right so that when I put it all together, it is not cumbersome and has plenty of optimisation routes because shadow volumes can be a serious CPU bottleneck.

On another note, I started using CppUnit to write tests for some of the new backend things; it’s going to be useful to be able to re-run tests before a release or after changes. It only works for non-visual things, but it will come in handy for the edge builder, the extruder / light case detection code and many other places. I just have to get into the discipline of writing them, it’s bit hard to take time to do it when you’re already short of time, but it is worth it in the long run.