The first screenshot shows the code to render the blue starfield with my library, the seconds screenshot shows the code for the same image in @ProcessingOrg . Results look the same. Third screenshot shows a draft for the new API that I haven't implemented yet.
What I find curious: The order in which I intuitively put transformations is reverse to how Processing expects them. Probably comes from the declarative, assumption-loaded nature of my approach? Plus me having no idea about conventions.
The first screenshot shows the code to render the blue starfield with my library, the seconds screenshot shows the code for the same image in @ProcessingOrg . Results look the same. Third screenshot shows a draft for the new API that I haven't implemented yet.
What I like about my approach and want to keep:
- no classic for-loops
- resolution independent image description
- no pushMatrix, popMatrix
- stronger connection between masks, fillings and transformations
Turned out there was a subtle bug in the alpha blending algorithm that caused some color values to exceed the 8bit range and overflow into the next channel.
Some of the prettier bugs I encountered so far. The second was an error in the anti-aliasing code, the fourth had to do with rotations. The other ones I haven't solved yet, but it's something with transparency.
Implemented simple anti-aliasing. It's about as slow as rendering at 4x the resolution and downsampling, which is basically what it's doing, but it looks nice. (Images are showing a detail)
Had to restructure the code quite a bit for this to work. A good coding exercise, but I'm not sure if there's a real benefit to using this DSL over a state machine like syntax with simple loops like the ones implemented by OpenGL or @ProcessingOrg
While trying to speed up rendering I realized two basic things about CG: Why there is a need for specialized graphics hardware and why in fast rendering most things are made up of triangles. It's just the shape that we have the best optimizations for.