Skip to main content

Module material

Module material 

Source
Expand description

What fills a shape.

A material is the paint as a backend sees it: fully resolved, in clip space, and packed into the layout the shader expects. Resolving happens above, because gradient geometry has to travel through the same transform the shape did.

Modules§

filter
Filter selector shared with the shader.
kind
Kind selector shared with the shader.
layout
Offsets into the packed layout, matching the shader’s declaration.
sampling
Sampling selector shared with the shader.
tile
Tile mode selector shared with the shader.

Structs§

Stop
A color stop.

Enums§

ColorFilter
A function applied to a material’s color, after the material and before the blend.
ColorForm
What space a color filter’s matrix expects its input in.
Gamma
Which way through the sRGB transfer function a ColorFilter::Gamma goes.
Material
How a shape is filled.
MaterialVariant
Sampling
How a texture is read between its texels.
TileMode
What happens outside an image’s own bounds.

Constants§

MATERIAL_FLOATS
Floats in the packed representation.
MAX_EFFECT_TEXTURES
How many textures one runtime program may sample.
MAX_STOPS
The most stops a gradient carries in the material itself.
MORPHOLOGY_TAPS
How far one morphology pass reaches, in texels each way.
RUNTIME_FLOATS
How many floats a runtime effect may take.

Type Aliases§

ToLocal
Maps a clip-space offset into a gradient’s own space, in column order.