Skip to content

Instantly share code, notes, and snippets.

@SanderMertens
Created February 5, 2026 08:57
Show Gist options
  • Select an option

  • Save SanderMertens/50df35e66304038f03ac1c580aeffe70 to your computer and use it in GitHub Desktop.

Select an option

Save SanderMertens/50df35e66304038f03ac1c580aeffe70 to your computer and use it in GitHub Desktop.
using flecs.components.*
using flecs.script.*
const Size = 100
const Res = 200
const Scale = 10
const P = Size / Res
const M = Size / Scale / P
for x in 0..Res {
for y in 0..Res {
const p = 10 * abs(
perlin2(x / M, y / M) *
perlin2(x / (M * 5), y / (M * 0.2))
)
const h = 1 * p + 1
{
Position3: {x * P, h / 2, y * P}
Box: {P, h, P}
Rgb: {p / 3, 0}
Specular: {0.5, 2}
Emissive: {1 * smoothstep(0.5, 1.0, p)}
}
}
}
ground_plane {
Rgb:{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment