Skip to content

OSL Mesher

Converts SDF shaders, OSL primitives and Octane Vectrons into meshes

Works in
You need
Cinema 4D 2023.2.2 to 2027 (exact versions below), on Windows 10 or 11 (64-bit).
OSL Mesher trailer: a tiny planet and a voxel world built through the Cinema 4D MCP Server, a Vectron fractal changing live beside its Octane render, a Klein spiral fractal meshed, an Octane Vectron meshed, Octane Scatter on the mesh, a region meshed and UVs from the shader

Overview

Optimized meshes from SDF shaders

A Klein spiral fractal meshed by OSL Mesher in Cinema 4D, 12.5 million polygons, beside its Octane render in orange and white

OSL Mesher converts SDF shaders into optimized polygon meshes inside Cinema 4D. The shader can be your own OSL code, an OSL primitive, an Octane Vectron or any other OSL shader that returns a signed distance. Its parameters become sliders, and the mesher bakes the result into clean geometry.

SDF shaders and Vectrons are drawn at render time and leave no geometry in the scene. OSL Mesher gives them a real mesh that works with every renderer, deformer, simulation and export. OSL is built into the plugin, so your own shaders need nothing else. Octane is needed only to mesh an Octane Vectron, and the renders on this page are made with Octane.

  • Your own OSL code, a .osl file, OSL primitives or an Octane Vectron.
  • Shader parameters become sliders, with a live preview before you bake.
  • Polygon Reduction keeps the meshes light, with far fewer polygons on flat areas.
  • UVs can come from the shader itself.
  • Animated shaders baked frame by frame or exported to Alembic.

Uses

What you can do with the meshes

Once a shader is a mesh, Cinema 4D's tools and any other 3D app can use it.

  • Scatter and clone

    Octane Scatter and MoGraph cloners need a surface to work on. A Vectron on its own has none, but its mesh does.
  • Simulate

    Use the mesh as a collider or a body in dynamics, cloth and particle setups.
  • 3D print

    Export the mesh from Cinema 4D, as STL or OBJ for example, and print your fractals.
  • Sell it as an asset

    Turn your own shaders into 3D models for asset stores, or deliver them to clients.
  • Export

    Use the mesh in other renderers, in game engines and in any app that reads FBX, OBJ or Alembic.
  • Mesh a Shadertoy project

    Port a Shadertoy SDF from GLSL to OSL, by hand or with an AI assistant, and mesh it. Check its licence before you sell the result.

OSL Mesher + C4D MCP

Works with the Cinema 4D MCP Server

Cinema 4D 2027 has Maxon's MCP Server built in (since 2026.4). Switch it on and an AI assistant, such as Claude Desktop or ChatGPT Desktop, can work in your scene. Because OSL Mesher runs on shader code, the assistant can write the SDF shader, set its sliders and bake the mesh while you describe what you want.

The two scenes below are only examples. We asked an AI assistant to build them in Cinema 4D through the MCP Server, starting from an empty scene. It wrote every shader itself and turned each one into a mesh with OSL Mesher. You can build any other scene with OSL Mesher, with an assistant or by writing the shaders yourself.

A tiny planet built with OSL Mesher through the Cinema 4D MCP Server: land, sea and a forest, a ring of clouds and an asteroid belt, in the Cinema 4D 2027 viewport

Example: a tiny planet

The land, a forest zone, the clouds and an asteroid each come from a shader the assistant wrote. The forest zone is a mesh, so a cloner can place the trees on it, and another cloner copies the asteroid into a belt.

A voxel world built with OSL Mesher through the Cinema 4D MCP Server: a lagoon ringed by blocky cliffs under a giant arch, in the Cinema 4D 2027 viewport

Example: a voxel world

The whole world is one shader written by the assistant. Its sliders set the block size, water level, cliff height, overhangs, floating islands and a giant arch.

Octane Vectron

Compatible with Octane Vectron

An Octane Vectron's Boxelbrot fractal under OSL Mesher, meshed at resolution 800 (8.7 million polygons) in the viewport, beside its Octane render

Put an Octane Vectron under the mesher and it is meshed exactly where it sits, with its position, rotation and scale. The fractals of our Vectron packs become real polygons for Octane and other renderers, for physics, simulations and export.

  • Mesh Region meshes just the part of the fractal your shot needs, at any position and scale.
  • Bake to Object turns the result into a normal, editable polygon object with its material.

Workflow

How to use it with Octane Scatter

  1. Put an Octane Vectron under OSL Mesher. The mesh follows its position, rotation and scale.
  2. Set the detail the scatter needs with Resolution for the whole fractal, or with Mesh Region around the part in your shot.
  3. Use the mesh as a reference in the viewport and as the surface for Octane Scatter, for trees, rocks or buildings.
  4. Render with Octane. Set OSL Mesher's render dot to off (red) and the Vectron's to on (green), as in the screenshots below. The Vectron renders the fractal at full detail, with the scattered objects on it.
A Vectron fractal city meshed at resolution 1500 (33.5 million polygons) in the viewport, and in the Octane render with a forest scattered over it by Octane Scatter

A forest on a fractal city

The Vectron fractal is meshed at resolution 1500 (33.5 million polygons), and Octane Scatter places a forest on it.

A Vectron fractal tower meshed inside a region cube at resolution 512 (3.9 million polygons), textured with green patches and scattered with red spheres by Octane Scatter

Mesh just the part you scatter on

Here only the part inside a region cube is meshed. At resolution 512 that is 3.9 million polygons, baked in about six seconds, and Octane Scatter places red spheres on it.

Our projects · 2021

How our fractal environments were made

An Octane Vectron is drawn at render time, so on its own it gives Octane Scatter, cloners and simulations nothing to work on. For these environments we made a light mesh of each fractal. We used it as a guide in the viewport and scattered the trees and buildings on it, while the Vectron rendered the fractal at full detail. OSL Mesher does this step inside Cinema 4D. You put the Vectron under the mesher and bake a light mesh.

Below are the three steps for Sierpiński Utopia. Ancient Fractal City and Fractal Pyramids were made the same way.

Sierpiński Utopia: the towers and bridges of a fractal city above the clouds, with balloons and trees, rendered with Octane
3 · Trees and buildings scattered on the mesh, with the Vectron rendering the fractal

OSL code

Write your own SDF shaders

Write OSL code in Cinema 4D or load a .osl file. Fractals, terrains, lattices, gyroids and hard-surface models built from booleans, blends and repeats all work, as long as the shader returns a signed distance. A new mesher starts with a Mandelbulb.

  • Parameters with OSL metadata become sliders, checkboxes and menus in the Attribute Manager.
  • Cinema 4D's code editor with line numbers. A compile error jumps to its line.
  • A Log with the compiler messages and the result of the last bake.
  • A shader stuck in an endless loop doesn't freeze Cinema 4D. The bake can be abandoned and the preview stops by itself.
  • Values that are not a number count as empty space, so they never break the geometry.

Shading

UVs from the shader

A Vectron fractal meshed with UVs from the shader, its orbit traps shown as rainbow colours in the viewport, beside its Octane render in blue and white

The shader can write its own UV values, for example orbit traps on a fractal or altitude and slope on a terrain. A single gradient or palette image then colours the whole surface.

Features

Meshing, preview and animation

Resolution uses cubic voxels, so detail is even in every direction, whatever the proportions of the box. Before baking you see the voxel count, the memory needed against the memory free, and the expected polygons and time. Large bakes ask before starting, and a bake that can't fit in memory is refused with a suggested resolution, so Cinema 4D stays stable.

A fast raymarched preview is drawn straight from the shader, on the GPU (OpenGL 3.3) or the CPU, with its own region, detail and ray steps. Renders and exports always use the real mesh.

  • Background baking with a progress bar. Auto Bake rebakes when something changes, and Cancel stops it.
  • Polygon Reduction puts far fewer polygons on flat areas and keeps the outline.
  • Surface Offset grows the surface outward.
  • Mesh Region meshes only the inside of a box, with clean cut faces. Use any object's box, or Create Region Cube and move it in the viewport.
  • Points Only outputs just the vertices, for scattering and particle setups.
  • Animation Mode bakes every frame as you play or step through the timeline, for animated shader parameters.
  • Export Animation bakes a frame range to an Alembic file, with a progress window and Cancel, then offers to import it.
  • Team Render works when the plugin is installed on every render machine.

Requirements

Compatibility and installation

Copy the folder for your Cinema 4D version into a Cinema 4D plugins folder, restart Cinema 4D and open OSL Mesher from Extensions > Machina Infinitum. Questions? Write to us.

  • Cinema 4D 2023 (2023.2.2 and later), 2024 (2024.0.2 to 2024.5), 2025 (2025.1 and later), 2026 (2026.1 and later) or 2027.
  • Windows 10 or 11, 64-bit. There is no macOS version.
  • Microsoft Visual C++ Redistributable 2015–2022 (x64), version 14.40 or newer. Most computers have it already, and the plugin tells you if it's missing.
  • A graphics card with OpenGL 3.3 for the GPU preview. Without one, the preview runs on the processor.
  • For the AI workflow, Cinema 4D 2026.4 or later with its MCP Server switched on, and an MCP-capable assistant.

Octane and Vectron are trademarks of OTOY Inc. Cinema 4D is a trademark of Maxon Computer GmbH. OSL Mesher is an independent product and is not affiliated with or endorsed by OTOY or Maxon. It uses Open Shading Language and other open-source libraries, whose licences are in THIRD_PARTY_LICENSES.txt next to the plugin.

Cinema 4D · Plugin

Buy OSL Mesher

For artists who work with SDF shaders or Octane Vectron and need real geometry to scatter on, simulate, export, 3D print or sell.

Machina Infinitum is a studio of developers and artists. We build 3D tools and plugins for Unreal Engine 5, Octane Render, Cinema 4D and Blender, and use them to create music videos, films and VJ loops.

Keep exploring

More for Cinema 4D

All tools for Cinema 4D