All examples · Shaders · As Markdown, for AIs

Carry

What this example shows

Four numbers a material's vertex hook works out at each corner and hands to its colour hook, smeared across the triangle the way the light is. In the shader composer, carry on compileShader, read with composerCarry(); by hand, the vertex hook writes carry = vec4<f32>(...) and the colour hook reads ctx.carry.

The sea carries how high each wave lifted a corner, so its crests foam. The block carries where each corner is in its own space, so its bands stay on it as it turns, cut out, shadow and all. The crystal carries a number of each corner's own, so it glints corner by corner, the glint running across its facets.

Starting
Starting
—