Script Dock & Advanced Scripting |
← Animation & Video · Contents · Library, Presets & Saving Your Work →
For expert users, the Script dock provides a powerful GLSL code editor to bypass the standard equations and directly program the GPU for surfaces, textures, and sounds.
Script Directives |
Variables such as u_min, A, B declared at the top of a script set the matching fields and sliders every time the script is Run, overwriting what they held. Opening a saved preset keeps the saved values instead: the directives apply again at the next Run. Metric scripts (return mat3(...)) are the exception: there the directives only fill limits that are still empty (see Geodesic Flow). The steps directive is never applied: resolution always follows the Steps slider.
One surface, one dock |
A surface whose shape is defined by a script is defined either there or in the Equations dock — not by both at once. The two are alternative sources for the same geometry, and this holds in Ray Marching exactly as it does for parametric surfaces: an implicit surface can come from the Equation field or from a script returning a distance function, but only one of them is in force.
So if the surface on screen comes from one dock and you start typing in the other, the two do not combine. To start clean, click the tab of the current mode (Parametric or Implicit) to get the default surface back, or press NEW to leave the scene empty.
Metric-tensor scripts are the exception: a script ending in return mat3(...) defines the metric gij, while the chart and the initial conditions of the geodesic flow live in the Equations dock, so the two panels describe one geometry together. The rule deciding which panel wins when they disagree is in Geodesic Flow.
Script Language Reference |
Scripts are GLSL code pre-processed by the application's internal translator, which adds math
shorthand (^ powers, % modulo, pi/tau constants),
UI directives (u_min := -3.0;) and a few strict rules (such as automatic integer-to-float
conversion). For the complete syntax, available variables, helper functions and examples,
read the dedicated guide: GLSL Script Writing Guide.
← Animation & Video · Contents · Library, Presets & Saving Your Work →