{"id":"recipe--shader-rings","name":"Example · Ripples around a point","owner":"dolphin","package":"dolphin.spatial3d","kind":"recipe","signature":"start.yh · Dolphin material example","description":"Feed distance into a wave to make rings.","context":"Stripes vary along one coordinate. Rings vary with distance from a center. We can reuse the same wave and blend helpers by changing the value we feed into them. The square root of x*x + y*y gives distance in the X/Y plane. Points at the same distance receive the same blend weight. This is why the pattern forms rings.","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":["Lower frequency from 24.0 to 12.0, then shift the center by subtracting 0.3 from X before squaring it."],"examples":[{"id":"program","title":"Example · Ripples around a point","description":"Feed distance into a wave to make rings.","code":"using dolphin.materials\nusing dolphin.math\nusing dolphin.spatial3d\n\nSurface(Vector3 position) -> dolphinSurface\n{\n    float radius = Math.SqrtFloat(position.x * position.x + position.y * position.y)\n    float ripple = DolphinSurfaceWave(radius, 24.0)\n    Vector3 deep = Vector3(0.02, 0.05, 0.2)\n    Vector3 foam = Vector3(0.1, 0.8, 1.0)\n    return DolphinSurface(DolphinSurfaceMix(deep, foam, ripple), 0.4, 0.1, 0.0)\n}\n\ndolphinSurface center = Surface(Vector3(0.0, 0.0, 0.0))\nConsole.Log(Text.Format(\"{0}, {1}, {2}\", center.color.x, center.color.y, center.color.z))","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__shader_rings\"\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.06, 0.425, 0.6","verification":"type checked","sha256":"c1e96891d66e6966cbabb2054040741b0ee19827388d4a3334a2383a190de0fe","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--shader-rings","json":"https://demonhunterlabs.com/reference/items/recipe--shader-rings.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--shader-rings.md"}
