3D Shaders
A 3D Shader uses the same Shader Kit logic you learned in the Shaders chapter, but extends it into 3D space.
In a 2D Shader, the Shader provides an XY position for each screen pixel. A Mask uses that XY position to generate a value, and a Color module turns the result into color.
Unlike 2D Shaders and Processor Shaders, a 3D Shader cannot be extended by placing Shader Kit modules before it in the main rack. 3D Shader Kit modules are used only inside the 3D Shader’s internal rack.
3D Shader can be GPU-intensive. For best results, build scenes gradually and use the Raymarcher Quality and 3D Shader Quality on Screen settings carefully. While working, you may often need to lower the 3D Shader module’s Quality parameter to keep the preview responsive. During export, quality is automatically raised to the maximum setting.
A 3D Shader is not a traditional 3D editor or mesh modeller. Recreating detailed real-world objects can be difficult, because the scene is built from procedural distance fields rather than editable polygon meshes. It is better to think of it as a generative 3D playground.
A 3D Shader adds one new coordinate type:
XYZ — a position in 3D space.
It also adds two important Shader Kit modules:
- 3D Mask — a 3D version of the Mask module (XYZ->V)
- XYZ Transform— a 3D Version of XY Transform module
And renderer configuration modules:
- 3D Camera — defines how the 3D scene is viewed.
- 3D Raymarcher — renders the 3D distance field into an image.
A useful base:
2D Shader: XY → Mask value → Color → Texture
3D Shader: XYZ → distance field → Raymarcher → Color → Texture
What a 3D Shader does
A 3D Shader is a procedural 3D renderer built from modules inside its own rack.
It creates 3D visuals from:
- XYZ Transforms that shape the 3D coordinate space,
- 3D Masks that define surfaces,
- Color modules that define material color,
- 3D Camera modules that define the view,
- 3D Raymarcher modules that draw the final image.
A useful way to think about it:
XYZ Transforms shape the space.
3D Masks define the surfaces.
Color modules define the material.
Camera modules define the view.
Raymarcher modules draw the image.
From pixels to rays
A normal 2D Shader evaluates one XY position for each screen pixel.
A 3D Shader works differently. For each screen pixel, it sends a virtual ray from the camera into 3D space.
Along that ray, the Raymarcher samples many XYZ positions and asks the internal 3D rack:
“How far is this point from the nearest surface?”
The answer comes from 3D Masks.
This rendering technique is called raymarching.

The basic 3D Shader path
A typical 3D Shader path works like this:

- The 3D Camera defines the view.
- The 3D Raymarcher sends a ray through each screen pixel.
- Along the ray, the Raymarcher samples an XYZ position.
- Optional XYZ Transform modules modify that position.
- A 3D Mask returns the distance to a surface.
- The Raymarcher uses that distance to move along the ray.
- When the ray reaches a surface, the Shader uses Color to shade it.
- The 3D Shader outputs the final Texture.
The most important idea:
A 3D Shader does not draw polygon meshes.
It searches for surfaces inside a distance field.
3D Camera and 3D Raymarcher modules are optional. If they are not present, the 3D Shader uses default camera and raymarcher settings.
XYZ
XYZ is a 3D position.
It has three coordinates:
- X — left/right,
- Y — up/down,
- Z — forward/back.
During raymarching, the 3D Shader evaluates many XYZ positions in space. Each 3D Mask receives the current XYZ position and calculates what exists there.
If a 3D module has an XYZ input and no other XYZ signal is connected, it uses the current XYZ position from the 3D Shader.
3D Masks and SDF
A 3D Mask defines a 3D form.
3D Masks define the actual forms: spheres, boxes, torus shapes, planes, tunnels, fractals and fields.
A 3D Mask receives an XYZ position and outputs a distance value.
This distance value is usually called an SDF, or Signed Distance Field.
You can think of an SDF as a 3D field of numbers around a shape. For any point in space, the SDF answers:
“How far is this point from the surface?”
For a typical SDF:
- 0 means the point is on the surface,
- a positive value means the point is outside the shape,
- a negative value means the point is inside the shape.
For example, 3D Mask / Sphere does not directly draw a sphere. It calculates the distance from the current XYZ position to the surface of a sphere.
The Raymarcher uses this distance to decide how far it can safely move forward along the ray.
If the distance is large, the ray can take a large step.
If the distance is small, the ray is close to a surface.
When the distance is near zero, the Raymarcher treats it as a surface hit.
Why distance fields are powerful
Because 3D Masks output distance fields, they can be combined and transformed before they are rendered.
This makes it possible to build complex procedural shapes from simple parts.
For example:
- a sphere can be repeated into many spheres,
- a box can be subtracted from a sphere,
- two shapes can be smoothly blended together,
- a tunnel can be twisted or folded,
- noise can disturb the surface,
- a field can modulate the radius of another shape.
The result is still a distance field, so it can continue through more processing or be rendered by the Raymarcher.
XYZ Transform
XYZ Transform modules modify 3D coordinate space before it reaches a 3D Mask.
This is similar to using XY Transform modules before 2D Masks, but in XYZ space.
XYZ Transforms can: move, rotate, repeat, fold, wrap, bend, twist, distort (noise, sine ...)

The 3D Mask still calculates the same shape, but it receives transformed coordinates.
For example:
XYZ Transform / Repeat → 3D Mask / Sphere
The Sphere Mask still describes one sphere in its own space. But because the XYZ position has been repeated before reaching it, the result becomes many spheres.
Combining 3D Masks
Multiple 3D Masks can be combined with SDF operations and Mask Processor module.
Common operations include:
- Union — join shapes together.
- Subtraction — cut one shape out of another.
- Intersection — keep only the overlapping part.
- Smooth Union — blend shapes smoothly.
- Smooth Subtraction — cut with a softened transition.
- Smooth Intersection — intersect with a softened transition.
To combine 3D Masks, use a Mask Processor module and choose one of the presets from the Mask Combine folder, such as union, subtraction, intersection, or smooth combine variants.

The output of a combine operation is still a distance field.
That combined distance field can be transformed, combined again, modulated, or sent to the Raymarcher.
This is one of the main strengths of 3D Shaders: complex objects can be built by combining simple distance fields.
Per-3D-point modulation
3D Shader supports modulation at each sampled point in 3D space.
This is similar to per-pixel modulation in 2D Shader Kit, but it happens inside the 3D scene while the Raymarcher is sampling the distance field.
A 3D Mask, field, coordinate output, repeat index, or utility output can modulate another module’s parameters differently across the object.
For example:
- a 3D field can change the radius of a sphere depending on position,
- a repeat index can change the color of each repeated copy,
- noise can modulate surface displacement,
- distance can control glow or alpha,
- XYZ coordinates can create spatial color gradients.
The important idea:
Modulation can vary across the 3D object, not only over time.
Mask repeat
Work in progress ...
Color and material
Color is handled through the 3D Shader rack’s Color input. This defines the material color for the rendered 3D surface.
The 3D Shader also has a Bkg input for background color. This input is not connected automatically by default, so connect a Color module to Bkg when you want to define the background inside the 3D Shader rack.
A Color module can define the material color for the 3D surface.
Color can also be modulated by 3D information.
For example:
- repeat index can modulate Hue,
- another 3D Mask or field can modulate brightness,
- noise can create organic color variation.

Depending on the Raymarcher preset, the final look may be solid, glowing, glass-like, clay-like, wireframe, holographic, volumetric, or more stylized.
3D Camera
A 3D Camera module controls how the scene is viewed.
It is optional. If no 3D Camera module is used, the 3D Shader uses its default camera settings. When a 3D Camera module is present, it overrides the default camera behavior.
The 3D Camera module is codeable, and several presets are available, including presets that animate the camera automatically.
3D Raymarcher
The 3D Raymarcher renders the distance field.
It sends rays into the 3D scene, samples the internal rack, finds surfaces, and draws the final image.
Different Raymarcher presets can create different looks, such as:
- solid surfaces,
- glass,
- glow,
- wireframes,
- holograms,
- clay-like material,
- volumetric looks,
- robust tracing for difficult distance fields.
[image: Same 3D Mask rendered with several Raymarcher presets: solid, glow, wireframe, glass, hologram.]
The Raymarcher is also where quality and performance are balanced.
Higher quality can improve stability and surface detail, but it may reduce frame rate.
Raymarching accuracy
Raymarching is powerful, but it is an approximation.
It works best when the 3D Mask returns a smooth and reliable distance field.
Some operations can make the distance estimate less accurate:
- strong warping,
- heavy noise,
- folds,
- discontinuous transforms,
- very complex SDF combinations,
- extreme repetition,
- sharp displacement.
When the distance field becomes difficult, you may see:
- gaps,
- flickering,
- surface noise,
- missed details,
- unexpected edges,
- unstable intersections.
Sometimes these artifacts are useful and become part of the visual style. Other times, they are a sign that the scene needs a more robust setup.
Stability and performance tips
If the scene becomes unstable:
- increase the 3D Raymarcher Quality parameter,
- try a more robust Raymarcher preset,
- reduce warp or displacement amount,
- simplify the SDF chain,
- use smoother combine operations,
- avoid very sharp or discontinuous distance changes.
If performance drops:
- lower the 3D Shader Quality on Screen parameter while working,
- reduce Raymarcher quality,
- reduce the number of repeated shapes,
- simplify heavy noise or field modulation,
- bypass modules to find the expensive part,
- increase quality again only for the final result.
Summary
A 3D Shader is Shader Kit extended into 3D space.
The core roles are:
- XYZ is the current 3D position.
- XYZ Transform changes 3D space.
- 3D Mask outputs an SDF distance value.
- SDF Combine modules join, cut, or blend distance fields.
- Color defines the material color.
- 3D Camera defines the view.
- 3D Raymarcher renders the distance field into a Texture.
Start simple: one Camera, one Raymarcher, one 3D Mask, and one Color module. Then add transforms, combines, modulation, and repeats step by step.