{"id":"recipe--bands","name":"Let position paint a pattern","owner":"dolphin","package":"dolphin.spatial3d","kind":"recipe","signature":"start.yh","description":"Turn a wave into stripes on a surface.","context":"A constant blend gives one color everywhere. A changing blend gives a pattern. DolphinSurfaceWave converts a coordinate and frequency into a smooth repeating value around the zero-to-one range. Using position.y makes the blend vary with height. Using position.x changes which direction the pattern follows. The function still returns an ordinary Dolphin surface value.","parameters":[],"returns":"","members":[],"tags":["cpu","dolphin.materials","dolphin.math","dolphin.spatial3d","recipe"],"updated":"2026-09-09","source":{"repository":"demonhunterlabs","path":"app/lib/yeho-walkthrough.ts"},"status":"complete-program","notes":["In the Atlas surface example, change frequency from 14.0 to 7.0. Then restore it and change position.y to position.x."],"examples":[{"id":"program","title":"Let position paint a pattern","description":"Turn a wave into stripes on a surface.","code":"using dolphin.materials\nusing dolphin.math\nusing dolphin.spatial3d\n\nSurface(Vector3 position) -> dolphinSurface\n{\n    float bands = DolphinSurfaceWave(position.y, 14.0)\n    Vector3 teal = Vector3(0.08, 0.7, 0.6)\n    Vector3 violet = Vector3(0.6, 0.12, 0.95)\n    Vector3 color = DolphinSurfaceMix(teal, violet, bands)\n    return DolphinSurface(color, 0.32, 0.55, 0.0)\n}\n\nConsole.Log(Text.From(Surface(Vector3(0.0, 0.0, 0.0)).roughness))","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__bands\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"dolphin.materials\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/materials\"\n\n[[dependencies]]\npackage = \"dolphin.math\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/math\"\n\n[[dependencies]]\npackage = \"dolphin.spatial3d\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/spatial3d\"\n","tags":["cpu"],"run":"cpu-oracle","expected":"0.32","verification":"type checked","sha256":"7f11e31d146dadf10e0c3ae0774650b6c5f4c4a656c014664eb5919931643d2c","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--bands","json":"https://demonhunterlabs.com/reference/items/recipe--bands.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--bands.md"}
