# osgSlug osgSlug is a frontend for the [slughorn](https://github.com/AlphaPixel/slughorn) library, simplifying the usage of the recent OSS release of the [Slug](https://sluglibrary.com/) technique by Eric Lengyel in OpenSceneGraph. # Overview This project is currently a rapid testing frontend, visualizer, and "proof-of-concept" demo for **slughorn** (where most of the critical, generic C++ code lives). As of **mid-April, 2026**, *both projects* are currently under very active development. Check back regularly to follow our progress, as we have some really great ideas moving forward! # Demos
| Preview | Description |
|---|---|
|  | **Emoji** Demonstrates loading **COLRv0** and **COLRv1** emojis using the `slughorn/freetype.hpp` backend. Each layer of the emoji is composited into its own quad and positioned relative to the base. slughorn supports all of the advanced **COLRv1** features, including gradients and transforms. |
| [](https://slughorn.io/github/pbr-ibl.webm) | **PBR/IBL** Full PBR (Physics Based Rendering) and IBL (Image Based Lighting) can be applied to any shape. This video shows the standard `chromatic.hdr` file (converted to KTX2) applied to a text scene using high metallic/low roughness settings. |
| [](https://slughorn.io/github/glyph-animate.webm) | **Animated Glyphs** Simple, shader-driven animation applied to Slug-rendered glyph geometry, accomplished by adjusting the output positions in the vertex shader. |
| [](https://slughorn.io/github/logo.webm) | **Layer Effects** Shows how individual layers in a `CompositeShape` can not only be distinguished in the shader pipeline, but also how each layer can have its own unique fragment output. From left to right: basic fill, two GLSL algorithmic fills, traditional texture lookup, and finally an animated GLSL algorithmic fill. |
| [](https://slughorn.io/github/morph.webm) | **Morphing** Similar to the animated glyphs demo, this example shows both the shape, a simple triangle, and the debugging bounding box using the `OSGSLUG_DEBUG=3` environment variable. |
|  | **2D Projection** The standard orthographic-style 2D placement/rendering. |
|  | **3D Projection** The same scene as the 2D Projection above, but with a traditional perspective-style view. |
|  | **Gradients** The FreeType, NanoSVG and Canvas backends all fully support linear, radial and sweep gradient fills/strokes. Gradients can also be dynamically transformed by the GPU during rendering (though their "color stop" values are static). |
|  | **Masking** Every `CompositeShape` supports its own `slughorn::Mask`, which can be either a procedurally generated shape or any arbitrary `slughorn::Shape`. Mask "inversion" is also supported. |
|  | **HUD** slughorn is perfect for HUD elements of any kind in 2D, 3D, or somewhere dynamically in between. |
| [](https://slughorn.io/github/animated-hud.webm) | **Animated HUD** Every `Layer` instance within a `CompositeShape` can be individually accessed and dynamically modified. When using the *GL4/SSBO* path, updates only require changing a small subset of the total GPU memory. |
|  | **Shapes/CompositeShapes** Each backend has its own examples of how to create both simple `Shape` and `CompositeShape` objects, groups of `Shape` instances layered together. The last screenshot demonstrates the `slughorn/canvas.hpp` backend, in addition to showing how the traditional punch-out effect can be achieved by manually using opposite winding directions in order to cut out one closed path from another. |
| [](https://slughorn.io/github/shapes-compositeshapes-mixed.webm) | **Mixed Scenes** `Shape` instances from different backends can be mixed together in the same `CompositeShape`; for example, fonts from the FreeType backend mixed with hand-authored content from the native Canvas (to create an animated "card" mockup, seen here). |
| [](https://slughorn.io/github/shapes-compositeshapes-animation.webm) | **Animated Scenes** A `CompositeShape` scene can reference and animate any of the participating `Shape` instances within it. In this example, a single "pill" shape is repeated 12 times, each being animated using a different time offset. |
| [](https://slughorn.io/github/sphere3d.webm) | **3D Objects** Slug is not restricted to simple quads; any 3D object or mesh can be assigned compatible `slughorn` coordinate mappings, such as spheres, cubes, curved surfaces, etc. |
|  | **SVG** SVG content fits easily within the `slughorn` ecosystem via the `slughorn/nanosvg.hpp` backend. *NOTE*: Some SVG features (strokes, text) are **possible**, but have not yet been implemented. |
| [](https://slughorn.io/github/text.webm) | **Text** Text was the original inspiration for Slug, and will always be incredibly well-supported. As mentioned above, each glyph in a text layout is nothing more than an instance of `Shape`, and can be manipulated in any way you can imagine. :) |
| [](https://slughorn.io/github/text-mix.webm) | **Mixed Text** Text glyphs are simply an instance of `Shape`, and can be freely mixed with any **other** `Shape` or `CompositeShape` object. This example demonstrates replacing the character `F` with a simple triangle, which fits seamlessly into the layout process. |
|  | **Text Effects** Emphasizing that glyphs truly **are** "just another `Shape`", this example demonstrates using "inside" *and* "outside" coverage effects (using MSDF sidecar data), stroking instead of filling, as well a using procedural GLSL to actively remove sections of a normal glyph fills! |
|  | **Text Along Path** Individual glyphs can be easily positioned along existing `Path` instances. The `slughorn::canvas::Path` object can `sample` at **any position** within a supported `Shape` instance. |
| [](https://slughorn.io/github/compute.webm) | **Compute Shaders** Not only can compute shaders animate/manipulate `slughorn` state, they can also act as a `fill()` source for other content. This demonstrates two stacked, blended shapes each using different compute shader output. |