Code

Code & Libraries

Open-source implementations of the Mixwell brushes and Reverse-Drift Functions, released under the MIT license and free to use, including commercially. Every file below can be read here with syntax highlighting, downloaded directly, or browsed on GitHub.

Mixwell GLSL

GLSL
Browse on GitHub ↗

GLSL implementations of the Mixwell brushes and Reverse-Drift Functions, for WebGL and OpenGL shader environments. Two variants are provided: the full library, and a much lighter brush-only build for when you do not need the Newton solver.

Mixwell HLSL

HLSL
Browse on GitHub ↗

HLSL implementations of the Mixwell brushes and Reverse-Drift Functions, for real-time engines and shader toolchains. Two variants are provided: the full library, and a much lighter brush-only build for when you do not need the Newton solver.

An application demonstrating periodicity-exploiting evaluation with these shaders is coming soon.

Mixwell OpenCL for Houdini

OpenCL
Browse on GitHub ↗

The Mixwell function library in OpenCL, for GPU evaluation inside Houdini Copernicus. It provides the brush, particle-drift, and Reverse-Drift Function routines (plus the math helpers they rely on) that the Houdini project below uses to build its patterns. Two variants are provided: the full library, and a much lighter brush-only build for when you do not need the Newton solver.

Houdini scene

A Houdini project containing worked examples for many of the patterns and figures from the paper. Each example is a COP network built with Houdini Copernicus, with the OpenCL node that runs the Mixwell kernels sitting inside the COP network.

Houdini network

The node network inside the project file, showing the Copernicus COP networks and the OpenCL node that evaluates the Mixwell kernels. Click to view it full size.

  • hmarbleWeb.hipnc node network node graph

    hmarbleWeb.hipnc node network

Mixwell OSL for Houdini and Redshift

OSL
Browse on GitHub ↗

An Open Shading Language implementation of the Mixwell brushes and Reverse-Drift Functions, used to render the paper's marbling results in Houdini with Redshift. Wire the nodes up in a Redshift Material Builder: a UV-to-position node produces the 2D Mixwell position, one or more RDF passes reverse-drift that position, and a color-map node samples the paint pattern at the end. RDF passes compose, so stacking them builds up complex patterns without any intermediate texture resampling.

Houdini scene

The teaser render: three marbled scarves on mannequins
The teaser render. (Left) Bouquet, (Middle) GelgitNonpareil, (Right) Feather.

The Houdini scene used to stage the teaser render, showing how the shot was assembled and how the Mixwell OSL materials are applied.

The artist's scarf models are not included in this public release, so the scene will not render as-is. The models used in the paper are available separately: Russian Scarves (TurboSquid) ↗

Redshift Material Builder graphs

These are the shader graphs behind the three scarves in the teaser image, left to right. Each one wires the OSL nodes above into a Redshift Material Builder: a UV-to-position node feeds one or more RDF passes, and a color-map node samples the paint pattern at the end. Click a graph to view it full size.

  • Bouquet node graph

    Bouquet

  • GelgitNonpareil node graph

    GelgitNonpareil

  • Feather node graph

    Feather