Basic Design Decisions of Boar

Boar is not a sophisticated piece of software engineering. I am focused on a small area of research, and do not give other parts the attention that they deserve.


Modeling, Trimming

As mentioned in the introduction, quadric surfaces can be infinite, and need to be trimmed somehow. The modeling problem is not solved either, so that does not provide hints what kind of trimming is needed. I implemented Constructive Solid Geometry (CSG). I don't know if that is ultimately the right decision, but it was easy to do and provides quite flexible trimming. In fact, it provides basic modeling capabilities. If you have watched Tron, you have seen the first movie that ever used CSG with quadrics. You have seen the last movie that ever did that, too ...

Boar includes a parser for human readable scene description files, with a syntax heavily inspired by that of Pov-Ray.


Lighting

I am not currently interested in physically correct illumination or sophisticated colour handling. The representation and rendering of geometry is all I care about now, so Whitted style lighting (named after Turner Whitted who first proposed raytracing) will have to suffice.


Coding Style

Boar is a testbed for ideas. Ultimate speed is not yet a goal, in the sense that there is no point in tuning heavily for specific hardware when the algorithms are still somewhat in flux. For the time being, boar is programmed in (a subset of) C++. I make use of language features that are detrimental to performance if I ever try to port it to SIMD hardware. But until I know exactly what functionality I need, it doesn't make much sense to implement my own predicated state machines when I can simply use virtual functions and recursion instead.


Numerics

Quadrics have accuracy issues just like anything that is being computed in finite precision. The quadratic formula is well understood, but there will probably be other sources of error. For the time being, I sidestep the issue by using double precision floating point math. I am also cheating the self intersection problem with the usual FUDGE_CONSTANTs, although much better solutions are described in the literature.