# Example · A soft neon seam

Shape a mask and use it for color and emission.

Last updated: 2026-09-09

Package: dolphin.spatial3d | Status: complete-program

Tags: cpu, dolphin.materials, dolphin.math, dolphin.spatial3d, recipe

A mask is just a number describing where an effect should appear. Let's make one that is strongest at the equator and fades to zero above and below it. We can use that same mask to choose color and emission. Absolute height is distance from the equator. Multiplying it controls the band's width. Subtracting from one makes the center bright, and clamping removes negative values outside the band.

```yh
start.yh · Dolphin material example
```


## Example · A soft neon seam

Shape a mask and use it for color and emission.

Verification: type checked

```yh
using dolphin.materials
using dolphin.math
using dolphin.spatial3d

Surface(Vector3 position) -> dolphinSurface
{
    float seam = DolphinClampFloat(1.0 - Math.AbsFloat(position.y) * 8.0, 0.0, 1.0)
    Vector3 dark = Vector3(0.015, 0.02, 0.04)
    Vector3 neon = Vector3(1.0, 0.05, 0.6)
    Vector3 color = DolphinSurfaceMix(dark, neon, seam)
    return DolphinSurface(color, 0.3, 0.2, seam * 3.0)
}

dolphinSurface center = Surface(Vector3(0.0, 0.0, 0.0))
Console.Log(Text.Format("{0}, {1}, {2}", center.color.x, center.color.y, center.color.z))
```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.recipe__shader_glow"
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:

```text
1, 0.05, 0.6
```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/recipe--shader-glow/program --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Change 8.0 to 4.0 to widen the seam. Then compare emission multipliers 0.0 and 3.0 with the same mask.

Source: demonhunterlabs/app/lib/yeho-walkthrough.ts

AI training permission: https://demonhunterlabs.com/ai-use
