dolphin.spatial3d · recipe ·
Start with one material
Describe a Dolphin surface as a small Yeho function.
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.
start.yhStatus: complete-program
Start with one material
Describe a Dolphin surface as a small Yeho function.
cpu · type checked
using dolphin.materials
using dolphin.math
using dolphin.spatial3d
Surface(Vector3 position) -> dolphinSurface
{
return DolphinSurface(Vector3(0.08, 0.7, 0.6), 0.8, 0.0, 0.0)
}
dolphinSurface material = Surface(Vector3(0.0, 0.0, 0.0))
Console.Log(Text.From(material.roughness))project.mech
manifestVersion = "2"
package = "api.example.recipe__surface"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
[[dependencies]]
package = "dolphin.materials"
version = "0.1.0"
path = "../../../dolphin/packages/materials"
[[dependencies]]
package = "dolphin.math"
version = "0.1.0"
path = "../../../dolphin/packages/math"
[[dependencies]]
package = "dolphin.spatial3d"
version = "0.1.0"
path = "../../../dolphin/packages/spatial3d"
Expected output
0.8
Notes and source
In the Atlas surface example, compare roughness 0.8 with 0.2 while keeping color, metal, emission, and lighting unchanged.
demonhunterlabs/app/lib/yeho-walkthrough.ts