import Node from "three/src/nodes/core/Node.js"; //#region src/materials/instanceAttributes.d.ts /** * TSL accessors for the per-instance data packed into `SpriteBatch`'s * interleaved core buffer. Keep every named field readable through a * helper so shader code doesn't repeat the underlying attribute name * + component index, and the packed layout stays refactorable in one * place. * * Layout (see `packages/three-flatland/src/pipeline/SpriteBatch.ts`): * * instanceSystem (vec4, interleaved offset 8..11) * .x = flipX — readFlip().x * .y = flipY — readFlip().y * .z = system flags bitfield — readSystemFlags() + typed bit readers * .w = MaterialEffect enable — readEnableBits() * * instanceExtras (vec4, interleaved offset 12..15) * .x = per-instance shadow radius — readShadowRadius() * .y/.z/.w reserved for future per-instance shadow / system data * * `instanceUV` and `instanceColor` stay raw — materials read them * directly via the usual `attribute(...)` calls since they're simple * passthroughs with no bit math or reinterpretation. */ /** * Read the per-instance flip vector from `instanceSystem.xy`. Each * component is +1 for unflipped, -1 for flipped. Consumers typically * destructure into `.x` and `.y` to drive axis-specific flip math. */ declare function readFlip(): Node<'vec2'>; /** * Read the raw system-flags bitfield from `instanceSystem.z`. Bit 0 = * lit, bit 1 = receiveShadows, bit 2 = castsShadow, bits 3..23 reserved. * Prefer the typed helpers ({@link readLitFlag}, etc.) for individual * bits — this is the lower-level access used when you need to mask or * compare against multiple bits at once. */ declare function readSystemFlags(): Node<'int'>; /** * Read the MaterialEffect enable-bits bitmask from `instanceSystem.w`. * Bit N is set while the Nth registered effect is active on this * instance. 24 slots (bits 0..23) — matches `EFFECT_BIT_OFFSET`. */ declare function readEnableBits(): Node<'int'>; /** * Read the per-instance shadow-occluder radius from `instanceExtras.x`. * World units. Auto-resolved each frame to `max(|scale.x|, |scale.y|)` * by `transformSyncSystem`, overridable via `Sprite2D.shadowRadius`. * * Shadow-casting LightEffects consume this value for algorithm- * specific purposes — SDF sphere-tracers use it as the self-silhouette * escape distance; future shadow maps would use it for depth bias; * AO passes could use it for sample radius. */ declare function readShadowRadius(): Node<'float'>; /** * Read the per-instance lit flag (bit 0 of `instanceSystem.z`). * Used by `wrapWithLightFlags` to gate the light pipeline; custom * ColorTransforms can also call this directly. */ declare function readLitFlag(): Node<'bool'>; /** * Read the per-instance receiveShadows flag (bit 1 of * `instanceSystem.z`). Preset LightEffects call this in their shadow * calculation to skip shadow for sprites that have opted out. */ declare function readReceiveShadowsFlag(): Node<'bool'>; /** * Read the per-instance castsShadow flag (bit 2 of `instanceSystem.z`). * Consumed by the occlusion-pass fragment shader to mask a sprite's * alpha contribution to the SDF seed — casters emit their silhouette, * non-casters emit alpha = 0. */ declare function readCastShadowFlag(): Node<'bool'>; /** * Read the per-instance rotated-frame flag (bit 3 of * `instanceSystem.z`). Set when the current atlas frame is packed 90° * clockwise (TexturePacker rotation); the material unrotates its * frame-local UV before the atlas remap. */ declare function readRotatedFrameFlag(): Node<'bool'>; //#endregion export { readCastShadowFlag, readEnableBits, readFlip, readLitFlag, readReceiveShadowsFlag, readRotatedFrameFlag, readShadowRadius, readSystemFlags }; //# sourceMappingURL=instanceAttributes.d.ts.map