Coldwave Read the docs

Engine effects: cards, flipbooks and blend modes#

Note. The command is ven in today's builds and becomes frost at launch, and so do the names built from it.

Coming next. This feature is not in frost yet. The page is written ahead so you can plan for it; until it ships, nothing here works in the frost you have.

Fire, smoke, sparks and glows made from pictures on cards, without writing a shader. Three components and two fields of Mesh, in every 3D game.

Cards#

Billboard = { picture = "art/flame.png", facing = "up", blend = "additive" } is a picture on a card turned to the eye. Every card of one picture is one draw, however many there are.

Flipbook = { cols = 4, rows = 4, fps = 12 } beside a Billboard (or a Mesh) plays a grid of frames from its picture; which frame a card shows is a number of its own, so a hundred flames need not flicker together.

Stretch lengthens a card along its thing's motion: a spark that streaks.

Blend modes on a mesh#

Mesh.blend takes "alpha" (the same as today's "blend"), and three new ones: "additive", "multiply" and "premultiplied". Those three are drawn among the see-through things, the farthest first, write no depth and cast no shadow; what an additive one writes into a blooming frame blooms.

Mesh.shadows = false makes a thing cast no shadow: a glow, a ghost, a light's bulb.

Materials get time and pictures#

A material's functions may read time (the game's steps, in seconds: still the simulation's clock, so a frame put back is the same picture) and call picture(uv) and second(uv). And the alpha a material's fragment returns is honoured: it cuts a masked part and covers by a see-through one.

If you already have a game#

  • A game's own component named Billboard, Flipbook or Stretch must be renamed.
  • A material that named its own time, picture, second, or anything beginning fx_ or FX_, must rename it.
  • A fragment that returns an alpha other than color.a on a masked or see-through part draws differently: return color.a there for the old picture.
  • A [stream] game's checksum moves once, as its kept rows leave out a field the engine added later: play it, then frost test --write.

No other game behaves differently and no other checksum moves. When it ships, a campfire sample shows it and 3D rendering gets a section on it.