Builtin Library
- ..
- .metadata56 B
- README.md1.2 KB
- properties.yaml664 B
- shader.wgsl2.6 KB
README.md
flipbook (shader)
Plays a texture sheet on a card. The card's shader_data lanes say which cells of the sheet to show: lane 0 holds (frame, next frame, how far between them) and lane 1 holds (columns, rows) - the lanes sim.flipbook writes onto particle points as data0 and data1. Frames count row by row from the top-left cell. When how far between them is above 0 the two frames are blended by it; a card whose lanes are zero shows the first cell of a 1 by 1 sheet, the whole texture.
The base_color_texture is the sheet and base_color times the vertex colour tints it; emission (0 to 64, default 1) scales the colour for an additive, bloom-fed look. With face_camera on (above 0.5, default 1) the card turns to face whichever camera draws it, keeping its own width and height; off, it keeps the pose the instance stands at. vertexBoundsDilation (metres, default 4.1) is how far that turn can carry a card's corners, which the cull allows for. The fragment is unlit and returns the sheet's alpha times the tint's, discarding a fragment whose alpha is below 0.001, so the material's blend state (alpha, additive, premultiplied) says how it combines with what is behind it.