This update to GLTools adds a couple new patches, and adds support for proper alpha blending (as found in GLTools v0.4).
The new patches:
- Kineme GL Polygon Offset -- useful for creating wireframe overlays (example composition included)
- Kineme GL Torus -- a new primitive that renders a torus.
Updates:
- The Triangle and Quad Structure patches now have position and rotation inputs, allowing for easier positioning.
A word about blending:
In Quartz Composer, blending is typically controlled by an input port called "Blending", which traditionally has the following values: Replace (no blending), Over (pre-multiplied overlay), and Add (Source + Destination). In GLTools 1.0, we transitioned from using our own manual blending to using QC's built-in ones. This meant less code, and more consistent behaviour with other QC patches. Unfortunately, as many have noted, the Over blend mode simply wasn't useful with line and point antialiasing, because it expects pre-multiplied colors, which OpenGL doesn't naturally provide when performing antialiasing. This lead to the ugly halos around objects, and improper transparency, especially around splines. (Secret: The built-in line patch doesn't have a Blending input for exactly this reason -- it manually controls blending itself to work around QC's limited implementation, just like we did on a much larger scale in GLTools 0.4)
This put us in a difficult position -- on the one hand, relying on QC's built-in functionality means less code for us, more reliability, and seamless feature compatabilty. On the other hand, having beautiful output is important, and having happy users is even more important.
Thus, we worked some more kineme magic, and Modified QC's Blending Port to add proper Alpha-blending support to anything with a Blending Port. Along with the standard Replace, Over, and Add inputs, you'll now see a fourth option, called "Alpha". This sets the blend mode to a proper unpremultiplied alpha blend, as found in GLTools v0.4. To enable pretty blending for your compositions, you simply have to locate your renderers, and change their blend input to "Alpha".