/** * The WebGPU lit quad batcher — normal-mapped sprites shaded by the * Light2d std140 block, the port of the GL `LitQuadBatcher` under this * backend's single-texture-per-draw-segment model: * * - group 1 is a combined material (color texture + normal map, four * entries); a change of either flushes the segment, so there is no * per-vertex normal-texture id and no sampler ladder * - group 2 binds the std140 `Light2dBlock` with a dynamic offset — each * `setLightUniforms` call snapshots the packed block into the effect * uniform arena (queue writes execute before every recorded draw, so a * shared buffer region per camera would be retroactively clobbered) * - normal maps live outside the TextureCache (same as GL): resident * GPUTextures keyed by source object, re-uploaded when the source's * duck-typed `version` stamp advances (NoiseTexture2d and friends) * @augments WebGPUQuadBatcher * @category Rendering */ export default class WebGPULitQuadBatcher extends WebGPUQuadBatcher { /** * @override */ override init(renderer: any, settings: any): void; litMaterialLayout: any; lightsLayout: any; blockData: Float32Array | undefined; lightBindGroups: Map | undefined; lightBinding: { bindGroup: any; dynamicOffset: any; frameId: any; } | null | undefined; litMaterials: Map | undefined; normalTextures: Map | undefined; /** * Snapshot the packed light uniforms for the draws that follow — called * by {@link WebGPURenderer#setLightUniforms} once per camera per frame. * @param {object} packed - what packLights produced */ setLightUniforms(packed: object): void; /** * Whether a light block was snapshotted during the given frame — the * renderer's lit gate requires this: a previous-frame binding points * into a reset arena region, so it would sample reused bytes. * @param {number} frameId - the renderer's current frame stamp * @returns {boolean} true when lit draws can bind a valid light block */ hasCurrentLightBinding(frameId: number): boolean; /** * Add a lit textured quad — the base contract plus the normal map the * segment shades with. * @param {object} texture - the texture atlas to draw with * @param {number} x - destination x * @param {number} y - destination y * @param {number} w - destination width * @param {number} h - destination height * @param {number} u0 - texture UV (u0) * @param {number} v0 - texture UV (v0) * @param {number} u1 - texture UV (u1) * @param {number} v1 - texture UV (v1) * @param {number} tint - tint color in UINT32 (argb) format * @param {boolean} [reupload=false] - force the source pixels to re-upload * @param {object} [normalMap] - the normal-map image paired with the texture * @override */ override addQuad(texture: object, x: number, y: number, w: number, h: number, u0: number, v0: number, u1: number, v1: number, tint: number, reupload?: boolean, normalMap?: object): void; /** * lit draws bind the combined material at 1 and the light block at 2 * @override */ override recordDraw(pass: any, vertexCount: any): void; } import WebGPUQuadBatcher from "./quad_batcher.js"; //# sourceMappingURL=lit_quad_batcher.d.ts.map