Files
OrcaSlicer/resources/shaders
ExPikaPaka 8baeba1341 ChromaStack: the layer card, the swaps and the preview shader
Add layer asks which kind of layer it is making - a relief layer, a height
map pushed into the surface, or a ChromaStack picture - and the layer
keeps the answer, so a card never shows a control that cannot do anything
on it. Depth, Midlevel, Smoothing, Invert, Edge fade, Tile and Blend are
absent from a picture card: each would move the relief's steps off the
print's layer boundaries, or has nothing to act on. Tile size becomes
Picture size. A picture cannot be reordered, since anything printed over
it buries the colours, and an object can hold only one, refused when the
layer is added rather than when its swaps would overwrite the first one's.

The card is the feature in one block: the picture and the predicted print
side by side, how far the prediction lands from the picture, the base
measured from the painted face, a row per band with the filament's name
and an editable TD, and the colours the stack reaches as a ramp - computed
from the stack alone, so it answers whether these filaments can print this
picture before a solve is spent finding out they cannot.

The swaps go onto the object as height ranges with extruder and
layer_height set, so they are object-relative, saved in the project and
visible in the object list; ObjectList::rebuild_layer_ranges() mirrors
them in the tree without touching the selection, which inside a gizmo
would tear the gizmo down.

The colours exist nowhere else - they are blends of translucent filaments,
not filaments, so the scene's per-triangle filament assignment cannot
express them - so the gizmo draws them itself, with a shader that reads
each fragment's own print Z. A swap happens at one Z across the whole
plate, so that is what decides a surface's colour, a band edge lands on
the layer boundary however coarse the mesh is, and it still works after a
bake when the height map is attached to nothing on screen. On top of the
colour it shades like printed plastic: a wrapped terminator and a grazing
glow scaled by the top filament's TD, and layer lines on the walls, all
fading out through fwidth once a pixel covers more than half a layer.
2026-10-16 11:44:33 +02:00
..