{"id":"recipe--surface","name":"Start with one material","owner":"dolphin","package":"dolphin.spatial3d","kind":"recipe","signature":"start.yh","description":"Describe a Dolphin surface as a small Yeho function.","context":"A surface function answers: what material should be here? It receives a position and returns color, roughness, metallic response, and emission. We can begin with the same answer everywhere. This example uses the Dolphin materials, math, and spatial3d packages. It prints a sampled material value in the console. To see the material on a sphere, use the Atlas surface workshop and its compiled CPU reference preview.","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, compare roughness 0.8 with 0.2 while keeping color, metal, emission, and lighting unchanged."],"examples":[{"id":"program","title":"Start with one material","description":"Describe a Dolphin surface as a small Yeho function.","code":"using dolphin.materials\nusing dolphin.math\nusing dolphin.spatial3d\n\nSurface(Vector3 position) -> dolphinSurface\n{\n    return DolphinSurface(Vector3(0.08, 0.7, 0.6), 0.8, 0.0, 0.0)\n}\n\ndolphinSurface material = Surface(Vector3(0.0, 0.0, 0.0))\nConsole.Log(Text.From(material.roughness))","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__surface\"\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.8","verification":"type checked","sha256":"42cf0c42f06848ee3fb6a2ec4a8ab54f34dcaa8926c5c55b2b24fb128161dd30","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--surface","json":"https://demonhunterlabs.com/reference/items/recipe--surface.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--surface.md"}
