Skip to content

Ollin 0.18.0

Latest

Choose a tag to compare

@eaviles eaviles released this 14 Nov 21:25
· 18 commits to main since this release
0.18.0
d503df7

This release adds a pen and lines drawn by hand, soft bodies that touch what is around them, a layer a sketch can read back, and a sketch that floats over the desktop. Small dots and thin lines now lay exactly their own ink, and lit 3D that traces nothing is about ten times faster on an M1 or M2. A few looks and defaults moved, so read Changed before you update.

Added

Drawing

  • A pen. strokeMedium(.ink(feather:pooling:amount:speed:seed:)) draws ink from a nib. It feathers into the paper where the hand slows, pools at each end, skips when the pen hurries, and darkens where strokes cross. A recorded mark keeps each point's pace in StrokeMark.Sample.speed. Marks
  • Lines drawn by hand. handDrawn(wobble:bow:overshoot:seed:) on a Contour, a Shape, or a StrokeMark returns the same line with a hand's wobble, bow, and uneven ends. It is seeded, so a line that moves keeps its character. Marks
  • A layer read back. RenderTarget.snapshot() returns a layer's pixels as an Image, one frame late. Anything that reads a picture can now read what the sketch draws. Effects
  • A slit scan on the GPU. makeLayerHistory(capacity:) keeps a layer's last frames, and Filter.slitScan(_:delay:) builds each pixel from the frame its delay names. Effects
  • A glyph mosaic of a layer. drawGlyphMosaic and glyphMosaic(of:) take a layer's image, so a moving drawing can be set as text. Glyph mosaic
  • An accumulator in single precision. makeAccumulator(precision: .float32) keeps the very faint marks a half-float pass drops, at twice the memory. Accumulation

3D

  • A camera for each layer. A camera set inside a layer's withTarget block belongs to that layer, so one frame can show a 3D world from several places. 3D
  • Finishes keep their look in a path-traced export. --path-traced now draws the stylized finishes as the window does: .toon, .gooch, .iridescent, .glitter, .jade, .velvet, .hologram, and the standard highlights. The clearcoat, the fabric sheen, the brushed streak, and scattering under the surface still trace as their base. Path-traced export
  • Maps show in a traced reflection. With rayTracedReflections() on, a mirror shows a surface's normal, roughness, and occlusion maps, and a fine picture seen small in a mirror no longer shimmers. 3D
  • Light that bounces inside a volume. Medium.bounce, from 0 to 1, lets a thick cloud glow from inside and shine through at its thin edges. Volumes
  • Fog veils volumes. Under fog or aerialPerspective, a volume is fogged like the solids around it. Volumes
  • A flat field stood up. extruded(depth:) turns any 2D SDF composition into an SDF3D slab that joins other 3D fields, casts shadows, and voxelizes. Combinators
  • Gesture marks in space. GestureMark.tube(sides:wobble:wavelength:) turns a drawn gesture into a mesh, and GestureMark.solids(spacing:seed:) strings instances along it. Gesture marks
  • A layer as an environment. A RenderTarget is a VideoFeed, so environment(.feed(layer)) lights a scene with the sketch's own drawing. 3D
  • A sample 3D model. import OllinSampleModels, and SampleModel.duck.load() gives a sketch a model to try materials, lights, and camera moves on. Sample models

Geometry and simulation

  • Finding boxes. BoundsIndex answers which of thousands of rectangles hold a point, overlap a rectangle, or overlap each other. Rectangle gains intersects(_:), intersection(_:), and union(_:), and Box3 gains intersects(_:). Bounds index
  • Neighbors in space. SpatialIndex3D is SpatialIndex for Vector3: the nearest point, the k nearest, everything within a radius, and everything inside a Box3. Spatial index
  • Matching two sets at the least total cost. Matching.optimal(_:_:cost:) pairs two sets so the costs add up to the least possible. A cloud of dots gathers into letters along paths that never cross. Matching.greedy is the quick comparison. Matching
  • Soft bodies that rub, meet rigid bodies, and fold. A 2D SoftBody has friction, and it pushes and is pushed by a rigid Body. With collidesWithItself: true, a long outline folds onto itself and no longer passes through. Physics

Sound

  • An echo long enough to be a loop. Delay.time runs to sixty seconds (Delay.maxTime). Each repeat lands on its exact sample, and turning time while the echo sounds no longer clicks. Synthesis
  • The sketch's sound as a file of its own. --export-sequence writes soundtrack.wav beside its frames, and --export-audio FILE (OllinApp.exportAudio) writes the sound alone. A --skip stretch is now dropped from the sound too. Synthesis

Windows

  • A sketch over the desktop. --overlay, or OllinApp.runAsOverlay { MySketch() }, floats a sketch above every window. Where the canvas is clear (background(.clear)) the desktop shows through, and a click there goes to whatever is underneath. Overlay
  • A second window for a layer. makeWindow(showing:title:) gives a layer a window of its own: the piece on the projector and the controls on the laptop. The returned SketchWindow reports its own pointer. Windows

Parameters and the live window

  • Undo in the inspector. ⌘Z puts back a parameter you turned by hand and ⇧⌘Z brings it forward, in every host. One gesture is one step, and a reset is one step. Parameters
  • Long menus fold into submenus. A ParamChoices type that declares paramChoiceGroups gets a submenu for each group. Easing declares its families, so a curve's menu is twelve rows instead of thirty-two. Parameters
  • A description on a parameter. help: on any @Param is a sentence about it. The inspector shows it on hover and --list-params prints it. Parameters
  • The rest of a package in the live window. A sketch that imports a library target of its own package, or another Swift package, now runs under ollin, OllinLive, and OllinLiveCoding. Saving the library rebuilds it and reloads the sketch. A target with C code, a macro, or a binary is refused by name. Single-file sketches
  • A failed frame names its pass. When the GPU throws a frame away, the error now ends with the pass the failure began in.
  • Traced shadows can be switched off on one Mac. With OLLIN_NO_TRACED_SHADOWS=1 in the environment, point lights and panels cast through shadow maps. It is for a Mac whose GPU misbehaves on traced shadows. 3D

Connections

  • A listener says why its port would not open. lastError on OSCReceiver, TUIOReceiver, DMXReceiver, and EtherDreamFinder names the port another program holds. isRunning turns false, where such a receiver used to read as running, and start() tries again.
  • A publisher says where it is in its life. phase on SyphonServer, VirtualCameraServer, and PhoneScreen is one PublisherPhase: .waiting, .publishing, .unavailable, or .stopped. SessionRecorder.lastError says why a take's file could not be finished.

Examples

  • Carlos Cruz-Diez joins the recreations. Examples/Recreations/CarlosCruzDiez has Physichromie, a panel of blades whose picture depends on where the pointer stands, and Chromosaturation, three rooms of colored light the eye adapts to.
  • Eduardo Terrazas joins the recreations. Examples/Recreations/EduardoTerrazas has Cosmos, his structure laid as a tabla of wool yarn, and Posibilidades, a sheet of small drawings that each change the same diagram one way.
  • A second visit to Hiroshi Kawano. Examples/Recreations/HiroshiKawano gains SimulatedColorMosaic and Flow. Both follow the procedure he described: a chain counts how the cells of a few hand-drawn pictures sit together, then writes more like them.
  • Ten examples for the features above. Shapes/InkPen, Effects/ScannedByItself, Patterns/GatherIntoLetters, Physics/SoftBodiesMeet, 3D/Raymarching/StandingField, 3D/Geometry/GestureMarks3D, Audio/Loop, Audio/Drive, Installation/OverDesktop, and Installation/SecondView.

Changed

Each of these can change what a sketch draws, sounds like, or accepts.

  • Small dots and thin lines are a little lighter. A dot a few pixels across or a line under a pixel wide used to lay more ink than its size, and now lays exactly its own. If a sketch looks thinner, raise the size or the strokeWeight slightly. Such marks take 7 to 18% more GPU time. Drawing
  • A simulation seeded by drawing runs to a different picture. A shape drawn into a field covers its edge a little differently now, so a rule that amplifies its start (Lenia, reaction-diffusion, a sandpile) ends up somewhere else. The same sketch still repeats from run to run.
  • Blend modes keep alpha as coverage. .add no longer pushes a layer's alpha past 1, so added lights drawn back over a picture do not turn it black. .multiply, .darkest, and .subtract add no coverage, so in an empty layer they leave nothing. To darken the canvas with a layer, set the mode when drawing it back. Drawing
  • A see-through background is weighted by its alpha. A window shows a clear canvas over black, so such a background is darker there than it was. For trails, keep the canvas with noClear() and paint a see-through rectangle each frame.
  • The five distortion characters do what their names say. .softClip, .overdrive, .bitCrush, .ring, and .squeeze were presets of the system's unit, and none matched its name. Each is now a curve of Ollin's own and sounds different. If you used .softClip for its echo, add a Delay(time: 0.357) beside it. Synthesis
  • A camera set inside a layer stays in the layer. camera(_:) inside withTarget used to replace the canvas's camera too. If a sketch relied on that, set the camera on the canvas as well.
  • Volumes glow from inside by default. bounce is on, so every medium is brighter in its depths. Set bounce: 0 for the old picture.
  • The ground under a sun-lit sky is lit by the sun. Below the horizon of a .sky whose sun lights the scene, faces turned down are brighter, and the scene reads a little darker overall because the exposure counts that ground. 3D
  • The sun's light follows the clouds. Under a cloudscape the scene gets the whole beam while the sun stands in a gap and next to nothing behind a thick cloud. 3D
  • A 2D soft body rubs and stops rigid bodies by default. friction is 0.3 unless you give one, so pass friction: 0 for the old slide. Rigid bodies no longer pass through.
  • --param refuses a value the parameter cannot hold. A value past the range or off the step used to land silently on the nearest one. The run now stops and names the nearest value. Export
  • The live hosts' status chip says what stopped the sketch. It reads "Compile error", "setup() failed", or "Shader error", and "Plain build" when the optimized build failed behind the plain one. Live coding
  • ollin api <Type> prints each case's comment. The members of an enum now carry their documentation in the list. The reference offline
  • Molnár's Interruptions is redrawn from a plate. The recreation's numbers are now measured off the plotter drawing the Victoria and Albert Museum holds (E.269-2011): 56 lines a side, a lean toward the vertical, and small patches of missing lines. Examples/Recreations/VeraMolnar/Interruptions

Fixed

Drawing

  • Tiny moving dots no longer flicker. A dot under a few pixels across laid ink that depended on where it fell on the pixel grid, and none at all near a pixel's corner. Its ink is now its area wherever it lands, for GPU particles too. Drawing
  • A diagonal hatch reads one even tone. A line's ink changed with its angle and its place on the grid, which showed as bands. It is now the line's width everywhere. The outline of a built-in shape (the stroke on a drawCircle or a drawRect) is unchanged for now.
  • A line drawn into a coarse layer keeps its ink. A hatch of thin lines drawn into a half-scale layer or a simulation field came out as broken dashes.
  • See-through shapes blend by their alpha under .multiply, .screen, .lightest, and .darkest. These four took a shape's color whole, so a half-clear multiply read too bright and a soft edge left a ring.
  • A transparent PNG of added light matches the window. A pile of .add marks over a clear canvas stored one mark's color. An EXR still keeps light and coverage apart.
  • A folded outline never takes the window down. A closed curveThrough ring that crossed itself hundreds of times hit an assertion in the fill and ended the window. It now returns a fill.
  • A chamfer, stairs, or columns scope holds a negative radius at zero. chamferUnion(radius:) and its eight siblings now draw what the same operators on an SDF value draw.
  • SlitScan names its own method. The note it prints for a skipped frame said push, and the method is append.

3D

  • Lit 3D is about ten times faster on an M1 or M2. Every lit shader carried the ray tracer, whether the frame traced or not. A lit mesh filling the frame took 43 ms on an M2 and takes 3.9. A frame that does trace is as slow as before. Combinators
  • A traced shadow or a field of blocks could restart the GPU. On a Mac that traces rays in software, a shadow from a point light or a panel, or a voxelized field, could freeze the screen. Both causes are fixed, though a heavy field under a traced shadow can still fail there.
  • The live window carries on after a GPU hang. It used to show its last finished frame for good. The frame loop also holds while the Mac sleeps.
  • A glowing surface glows in a traced reflection. A mirror showed a surface with an emissiveColor or Mesh.glowing(_:) as its unlit body.
  • A marched field drawn in a layer showed on the canvas too. It happened when the canvas marched its own drawSDF3D fields at reduced resolution. The canvas now draws its own fields alone.
  • A mesh field in a layer is culled through the layer's own view. A MeshField in a layer of another shape lost copies at its sides. Instancing
  • A textured OBJ drew its texture upside down. The reader now flips vt as it reads, as the USD reader already did. 3D

Sound and simulation

  • A blown tube holds its pitch however hard it is blown. Near the top of its range the breath pulled the pitch up to 36 cents sharp. Every preset now stays within five cents from A2 to C7, and the highest notes are a little purer. Synthesis
  • A simulation takes a negative seed. makeEvolution, makeParticleLife, and makeParticleLenia crashed on any seed below zero.
  • A face's strongest expressions come in one order in every run. PhoneFace.strongestBlendShapes() listed two shapes at the same value in a different order from run to run.

Parameters and the live hosts

  • A stepped parameter holds the decimal its step names. Declared 0.1...2, step: 0.01, a parameter showing 1.5 held 1.5000000000000002, so --param zoom=1.5 was refused. A sketch that amplifies tiny differences can draw a different picture for the same seed.
  • --list-params says the step of a whole-number parameter. 8...128, step: 8 now prints 8...128, by 8.
  • The Colors panel no longer opens over the inspector. When it comes up over the parameters list it is moved beside the window.
  • A reset under a held clock shows. With the timeline holding the clock, putting a parameter back changed the value and drew nothing.
  • A package's sketch compiles every file of its target in the live window. A manifest that excluded one file made the live compile skip the files after it. A target that uses the package access level compiles there too.
  • OllinLive keeps a shader error up until the shader is fixed. Saving a .metal file with the same mistake cleared the error and never brought it back.
  • A recovery offer in OllinLiveCoding could be lost, or restored into the wrong sketch. The offer now survives the launch, and opening another document withdraws it. Live coding
  • Letting go of Command during a drag on the stage left the editor ignoring clicks. The drag now stands down when it ends.

Connections and installations

  • A piece with opening hours kept the display awake all night. Two holds on the display were taken and only one released. There is one hold now, and the dark hours release it. Installation
  • A take started right after stop() can be stopped. A second take begun before the last file closed ran on with isRecording true. Each take is its own file now. Recording
  • A stopped Syphon server or virtual camera stays stopped. stop() released the server and the next frame stood it back up.
  • An MQTT client with reconnects: false can connect again. After a drop, connect() returned without dialing. MQTT
  • A laser whose interlock tripped can be armed again. It used to stay dark until a restart. hasStopCondition and lastError say the DAC is stopped. Nothing restarts by itself: arm() clears the stop, through EtherDreamDAC.clearStopCondition(). Laser
  • A web socket a server closes says so. PushFeed.problem now reads the close code and the server's reason. Live data
  • A rebuilt Ollin Camera replaces the installed one. The app's version lives in one place now, and its README says when to raise it. Virtual camera