Sun Jan 13 09:51:52 EST 2013

Declarative line rendering

In OpenGL it is quite straightforward to use a 2-step rendering
process.  As opposed to using (straight-line) OpenGL primitives, this
creates a bit more freedom.

1. Create a texture bitmap
2. Render the texture bitmap to screen

Creating texture bitmaps can be an offline process, so is not so much
resource constrained.  The approach I'm using is to create
anti-aliased bitmaps directly from a specification function 

             shape :: coord -> bool

by evaluating it over a supersampled grid and performing an
anti-aliasing averaging step.  In C such a specirication function
would be:

    bool circle(float x, float y) { return x*x + y*y < 1.0; }

This works well, especially since it is not limited to straight lines
as is the direct style OpenGL drawing approach.

However, just like in the direct style, it can be a bit of a pain
because it requires specification of both "edges" of lines.  I want to
just have one equation for a line, and parameterize that with a
thickness.  How to do this?

- Abstract shapes in a function that just parameterizes thickness directly.

- Use some kind of derivative trick to find the curve's normal.