Log inGet started
World

First Light: Goura

Branchmain
Branchesmain
Commite917faa950

README.md

fl_frond

The foliage shader of First Light: Goura — fern fronds, palm blades, sapling leaves and the roost tree's crown. Thin geometry that has to read twice over: as a black silhouette against the last of the night, and as a lit, translucent leaf when the first gold arrives low from the side.

A surface() shader with a vertex_clip() hook. Three things it does that the ground shader (fl_surface) does not:

Sway. vertex_clip displaces each vertex by an amount the MESH declares in its vertex alpha — 1 at a frond's tip, 0 where it is rooted — so a frond pivots from its crown instead of sliding whole. The phase is a function of world position, so a stir travels across the lane rather than every copy of the same mesh nodding together. The displacement takes the vertex's own time, so the previous-frame evaluation places the leaf where it was a frame ago and the motion vector carries the movement. sway is the amplitude in metres at a free tip; set it to 0 for geometry that should stand still.

Translucency. subsurface_color, subsurface_amount, subsurface_radius and thickness give the lobe that makes a backlit leaf glow instead of going black — the reason a low dawn sun through a fern bed is worth drawing at all.

A blade read off the UVs. The frond meshes carry uv.x ACROSS the blade (0 at the spine, 1 at the edge) and uv.y ALONG it. rib_width / rib_darkness darken the midrib, edge_color / edge_amount pale the edge, base_tint ages the end nearest the crown, and bow bends the shading normal across the blade so a highlight travels along a frond rather than flashing the whole leaf at once. None of that is in the geometry.

Vertex colours

  • rgb — the leaf's own tone, multiplied over base_color.
  • a — sway freedom, and (through cavity) ambient occlusion, so a fern's crown sits in its own shadow.

Properties

properties.yaml carries the full set. double_sided defaults on: this geometry is meant to be drawn by a material with cull: none.