RGBA8 texels, row-major, 4 bytes per texel — TextureSource.data's
layout, and usually that very array.
Height of data in texels. A positive integer (§85).
OptionalregionThe sub-rectangle of data the candidate's shape shows, in texels —
§55's frame, for a sprite that atlases. Absent means all of data.
Must lie inside width × height (§85).
OptionalthresholdAlpha in [0, 1] a texel must exceed to count as present. Defaults
to 0 — any nonzero alpha picks, which is §71's reading of "pixel-alpha
testing"; raise it to ignore soft edges.
Width of data in texels. A positive integer (§85).
§71's
"pixel"strategy for the CPU-resident case (RFC 0005 alternative D, adopted): the texels a candidate's visible shape comes from, so a bounds hit can be confirmed — or rejected — by the alpha actually under the point.The common carrier is a §55 sprite: its
TextureSource.datais already CPU-side RGBA8, so a transparent corner of a quad stops picking without a renderer, a read-back, or a new package edge — which is why this tier lives here and the id-buffer tier does not. It composes with the box test rather than replacing it: the box says where the ray meets the candidate, the mask says whether that texel is really there.Sampling
The box entry point's local
x/yare normalized against the box extents tou/vin[0, 1](an axis of zero extent — a flat sprite's thickness — reads as0), then nearest-sampled:umaps across PickableAlphaMask.region's columns,vacross its rows, row 0 being the box's −Y edge — exactly the orientationtexImage2Dgives the same array, so what picks is what shows. The hit is kept when the sampled alpha is strictly greater than PickableAlphaMask.threshold.