Bakes a list of line styles into a small RGBA32F lookup texture. More...
| Import Statement: | import Clayground.Canvas3D |
LineStyleTextureData turns the declarative styles list into a one-pixel-tall RGBA32F texture, one texel column per style. LineBatch3D's fragment shader samples the column selected by a line's styleId (carried in the instance table) and decodes it. The texture is kTableRows RGBA32F rows tall (a versioned constant, so adding a row is a non-breaking format bump); the rows are:
R dash length (0 = solid), G gap length, B round-cap flag (1 = round, 0 = square), A opacity multiplier. This is the frozen v1 layout: a bare { dash, capRound, opacity } style leaves rows 1 and 2 all-zero and renders exactly as before.R pattern glyph id (0 dash, 1 dot, 2 chevron, 3 triangle; bit 8 set means the pattern period is measured in screen pixels instead of world units), G triangle base-width fraction (0 = full ribbon width), B generic per-glyph param (reserved), A flow speed.R glow edge softness, G pulse depth, B arrowhead length, A arrowhead width (both in line-width units).There is always at least one style: index 0 defaults to a solid, round-capped, fully opaque line, so styleId 0 works without configuring any styles.
This type is used internally by LineBatch3D.
See also LineBatch3D.
styleCount : int |
The number of style columns in the texture (always at least 1).
styles : list |
The declarative list of line styles baked into the texture.
Each element is an object { dash: [dashLen, gapLen], capRound: <bool>, opacity: <real>, pattern: <string>, patternUnits: <string>, flow: <real>, glow: <real>, pulse: <real>, head: [length, width] }. All keys past opacity are optional and default to the plain solid/dashed v1 behaviour.