May 18 2008
Animating Brushes
I have been spending time making a realtime brushing engine. It uses CG shaders to do the rendering and can be driven by scripts or a joystick.
The interesting thing when running in real time is that the brushes fade out and move around. It means that often, it is much harder to understand what the underlying picture is (not that the fish or crabs in the previous videos were easy to understand).
The entire engine is a multithreaded render which builds a command buffer in the simulation thread, while drawing the previous frame’s command buffer in the render thread. The synchronization is always tricky, but I have a number of debugging rendering modes which make it easier to figure out what is going on. At compile time, I can select:
- Multithreaded double-buffer
- Single threaded double-buffer
- Single threaded single-buffer
- Single threaded immediate