@ignifx/core 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"scene-color-passes-DgXJ45Ql.js","names":[],"sources":["../src/lite/gpu/scene-color-passes.ts"],"sourcesContent":["import {\n addTaskAfter,\n buildFrameGraphTask,\n createCopyToTextureTask,\n createRenderTarget,\n disposeRenderTarget,\n getFrameGraph,\n} from \"@babylonjs/lite\";\nimport { frameGraphTasks } from \"./scene-inputs.js\";\nimport type { ScenePresenter } from \"./render-path.js\";\nimport type { EngineContext, RenderTarget, SceneContext, Task } from \"@babylonjs/lite\";\n\n/**\n * Scene-colour passes (`docs/architecture/07-rendering.md` §2.7): Lite screen-space effects that\n * read the lit scene colour and the shared scene-input depth, and whose result replaces the scene\n * colour before anything else reads it. Its own chunk, loaded with the first such effect\n * (`CONSTITUTION.md` §2.5).\n *\n * ```text\n * scene ─→ S ─ pass 1 ─→ scratch ─ pass 2 ─→ S ─ … [─ copy ─→ S] ─→ present / output pass / chain\n * ```\n *\n * `S` is the presenter's {@link ScenePresenter.scenePass} target: `sceneColor` on the plain path,\n * the linear `rgba16float` target under `rendering.hdr`, so the passes see linear colour ahead of\n * the output pass there. Lite's composite cannot write its own source, so under HDR the passes\n * ping-pong between `S` and one scratch target of the same format, and a copy brings an odd count\n * back into `S`. On the plain path no pass may write `S` (`ScenePass.isTargetWritable` in `./render-path.ts`): the\n * passes ping-pong between two scratch targets and the copy always runs. Every task sits right after\n * the scene task, ahead of the present blit, the HDR output pass and a `PostProcessStack` chain\n * alike, which therefore need no change.\n */\n\n/**\n * One scene-colour effect, as the installer sees it.\n *\n * @internal\n */\nexport interface SceneColorPass {\n /**\n * Creates the effect's task.\n *\n * @param source - The colour it reads.\n * @param target - The colour it writes; never `source`.\n * @returns The task.\n */\n create(source: RenderTarget, target: RenderTarget): Task;\n}\n\n/**\n * The installed passes.\n *\n * @internal\n */\nexport interface InstalledSceneColorPasses {\n /** How many tasks were added, copy included. */\n readonly taskCount: number;\n /** Removes and disposes every task and the scratch target. Idempotent. */\n dispose(): void;\n}\n\n/**\n * Inserts the passes after the scene task, in order.\n *\n * @param engine - The engine; also the surface the scratch target is sized by.\n * @param scene - The scene.\n * @param presenter - The offscreen render path.\n * @param passes - The effects, first to last.\n * @param isFrameGraphBuilt - Whether the scene is registered, so each task is recorded now.\n * @returns The handle that takes them out again.\n *\n * @internal\n */\nexport function installSceneColorPasses(\n engine: EngineContext,\n scene: SceneContext,\n presenter: ScenePresenter,\n passes: readonly SceneColorPass[],\n isFrameGraphBuilt: boolean,\n): InstalledSceneColorPasses {\n const { task: sceneTask, target: sceneTarget, format, isTargetWritable } = presenter.scenePass;\n const scratches: RenderTarget[] = [];\n const tasks: Task[] = [];\n let source = sceneTarget;\n for (const pass of passes) {\n const target = sceneColorPassTarget(source, sceneTarget, isTargetWritable, scratches, (index) =>\n createRenderTarget({\n lbl: index === 0 ? \"ignifx:scene-color-scratch\" : \"ignifx:scene-color-scratch-2\",\n format,\n samples: 1,\n size: engine,\n }),\n );\n tasks.push(pass.create(source, target));\n source = target;\n }\n if (source !== sceneTarget) {\n tasks.push(\n createCopyToTextureTask(\n { name: \"ignifx:scene-color-copy\", sourceTexture: source, targetTexture: sceneTarget },\n engine,\n scene,\n ),\n );\n }\n let after = sceneTask;\n for (const task of tasks) {\n addTaskAfter(scene, task, after);\n after = task;\n }\n if (isFrameGraphBuilt) {\n const graph = getFrameGraph(scene);\n for (const task of tasks) {\n buildFrameGraphTask(graph, task);\n }\n }\n let isDisposed = false;\n return {\n taskCount: tasks.length,\n dispose(): void {\n if (isDisposed) {\n return;\n }\n isDisposed = true;\n const list = frameGraphTasks(scene);\n for (const task of tasks) {\n // Disable first: a disposed task that still executes is a use-after-free.\n task.executionEnabled = false;\n const index = list?.indexOf(task) ?? -1;\n if (list !== null && index >= 0) {\n list.splice(index, 1);\n }\n task.dispose();\n }\n for (const scratch of scratches) {\n disposeRenderTarget(scratch);\n }\n },\n };\n}\n\n/**\n * Picks where the next scene-colour pass writes: back into the scene target when that is allowed\n * and the pass does not read it, otherwise the scratch target the pass does not read.\n *\n * @param source - What the pass reads.\n * @param sceneTarget - The scene's colour target.\n * @param isTargetWritable - Whether a pass may write `sceneTarget` (`ScenePass.isTargetWritable` in `./render-path.ts`).\n * @param scratches - The scratch targets made so far; a new one is appended when needed.\n * @param createScratch - Makes the scratch target at an index, 0 or 1.\n * @returns The target, never `source`.\n *\n * @internal\n */\nexport function sceneColorPassTarget<T>(\n source: T,\n sceneTarget: T,\n isTargetWritable: boolean,\n scratches: T[],\n createScratch: (index: number) => T,\n): T {\n if (source !== sceneTarget && isTargetWritable) {\n return sceneTarget;\n }\n const index = source === scratches[0] ? 1 : 0;\n let scratch = scratches[index];\n if (scratch === undefined) {\n scratch = createScratch(index);\n scratches[index] = scratch;\n }\n return scratch;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwEA,SAAgB,wBACd,QACA,OACA,WACA,QACA,mBAC2B;CAC3B,MAAM,EAAE,MAAM,WAAW,QAAQ,aAAa,QAAQ,qBAAqB,UAAU;CACrF,MAAM,YAA4B,CAAC;CACnC,MAAM,QAAgB,CAAC;CACvB,IAAI,SAAS;CACb,KAAK,MAAM,QAAQ,QAAQ;EACzB,MAAM,SAAS,qBAAqB,QAAQ,aAAa,kBAAkB,YAAY,UACrF,mBAAmB;GACjB,KAAK,UAAU,IAAI,+BAA+B;GAClD;GACA,SAAS;GACT,MAAM;EACR,CAAC,CACH;EACA,MAAM,KAAK,KAAK,OAAO,QAAQ,MAAM,CAAC;EACtC,SAAS;CACX;CACA,IAAI,WAAW,aACb,MAAM,KACJ,wBACE;EAAE,MAAM;EAA2B,eAAe;EAAQ,eAAe;CAAY,GACrF,QACA,KACF,CACF;CAEF,IAAI,QAAQ;CACZ,KAAK,MAAM,QAAQ,OAAO;EACxB,aAAa,OAAO,MAAM,KAAK;EAC/B,QAAQ;CACV;CACA,IAAI,mBAAmB;EACrB,MAAM,QAAQ,cAAc,KAAK;EACjC,KAAK,MAAM,QAAQ,OACjB,oBAAoB,OAAO,IAAI;CAEnC;CACA,IAAI,aAAa;CACjB,OAAO;EACL,WAAW,MAAM;EACjB,UAAgB;GACd,IAAI,YACF;GAEF,aAAa;GACb,MAAM,OAAO,gBAAgB,KAAK;GAClC,KAAK,MAAM,QAAQ,OAAO;IAExB,KAAK,mBAAmB;IACxB,MAAM,QAAQ,MAAM,QAAQ,IAAI,KAAK;IACrC,IAAI,SAAS,QAAQ,SAAS,GAC5B,KAAK,OAAO,OAAO,CAAC;IAEtB,KAAK,QAAQ;GACf;GACA,KAAK,MAAM,WAAW,WACpB,oBAAoB,OAAO;EAE/B;CACF;AACF;;;;;;;;;;;;;;AAeA,SAAgB,qBACd,QACA,aACA,kBACA,WACA,eACG;CACH,IAAI,WAAW,eAAe,kBAC5B,OAAO;CAET,MAAM,QAAQ,WAAW,UAAU,KAAK,IAAI;CAC5C,IAAI,UAAU,UAAU;CACxB,IAAI,YAAY,KAAA,GAAW;EACzB,UAAU,cAAc,KAAK;EAC7B,UAAU,SAAS;CACrB;CACA,OAAO;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scene-inputs-_0j2Hi6L.js","names":[],"sources":["../src/lite/gpu/scene-inputs.ts"],"sourcesContent":["import {\n addTaskAfter,\n addTaskAtStart,\n buildFrameGraphTask,\n createCopyToTextureTask,\n createDepthPyramid,\n createDepthPyramidTask,\n createGeometryRendererTask,\n createSurfaceRenderTargetTexture,\n disposeRenderTargetTexture,\n GeometryTextureType,\n getFrameGraph,\n onRenderTargetTextureResize,\n withSampledDepthTexture,\n} from \"@babylonjs/lite\";\nimport type {\n DepthPyramid,\n EngineContext,\n RenderTarget,\n RenderTargetTextureResult,\n SceneContext,\n Task,\n Texture2D,\n} from \"@babylonjs/lite\";\n\n/**\n * Shared scene inputs (`docs/architecture/07-rendering.md` §2.12): one geometry pass that\n * screen-space effects (TAA, GTAO, contact shadows, SSGI) read instead of each drawing the scene\n * again. Its own chunk: the renderer imports it only when an effect asks for it, so a project with\n * no such effect loads none of it and its frame graph has none of these tasks (`CONSTITUTION.md`\n * §2.5).\n *\n * ```text\n * [shadow] → geometry ─→ normals copy ─→ velocity copy ─→ depth pyramid → scene → …\n * ├ depth (depth32float, sampled)\n * ├ world normal ─(copy)─→ normals\n * └ velocity ─(copy)─→ velocity\n * ```\n *\n * - **Depth** is a surface-sized `depth32float` target with a sampled facade\n * (`withSampledDepthTexture`) handed to the geometry task as its depth. Reverse-Z: 0 is\n * the far plane. `depth24plus-stencil8`, the main pass's format, cannot be bound in compute.\n * - **Normals and velocity** are geometry attachments, which Lite exposes only as task-owned\n * `RenderTarget`s; compute and effect bindings take a `Texture2D`, so each is copied into a target\n * that has one (`docs/architecture/07-rendering.md` §8, upstream ask \"geometry attachments as\n * `Texture2D`\").\n * - **The depth pyramid** is Lite's `createDepthPyramid`: an `r32float` mip chain where each level\n * keeps the `max` (in reverse-Z, the nearest surface) of its four children.\n * - **Ref-counted.** {@link SceneInputsHost.acquire} adds the tasks for the first user;\n * {@link SceneInputs.release} by the last one removes and disposes them.\n * - **Resize and device loss.** The targets are sized by the surface, so `frameGraph.build()`\n * reallocates them, on a resize and on a recovered device alike. The depth target's resize\n * callback rebuilds the pyramid (its pipelines belong to one device) and tells every user through\n * {@link SceneInputs.onChange}, so they can rebind.\n */\n\n/**\n * The frame-graph task names, in the order they run.\n *\n * @internal\n */\nexport const SCENE_INPUT_TASK_NAMES = {\n geometry: \"ignifx:scene-inputs\",\n normals: \"ignifx:scene-inputs-normals\",\n velocity: \"ignifx:scene-inputs-velocity\",\n depthPyramid: \"ignifx:scene-inputs-depth-pyramid\",\n} as const;\n\n/**\n * The texture format of each input.\n *\n * @internal\n */\nexport const SCENE_INPUT_FORMATS: {\n readonly depth: \"depth32float\";\n readonly normals: \"rgba16float\";\n readonly velocity: \"rgba16float\";\n readonly depthPyramid: \"r32float\";\n} = { depth: \"depth32float\", normals: \"rgba16float\", velocity: \"rgba16float\", depthPyramid: \"r32float\" };\n\n/**\n * One user's lease on the shared scene inputs.\n *\n * @remarks\n * Every texture is sized like the surface (backing-store pixels) and holds this frame's values for\n * any task that runs after the inputs' tasks, which sit at the start of the frame graph. A resize or\n * a recovered device swaps the GPU textures behind the same objects; bind groups that captured a\n * view must be rebuilt in {@link SceneInputs.onChange}.\n *\n * @internal\n */\nexport interface SceneInputs {\n /** Scene depth, `depth32float`, reverse-Z (1 near, 0 far). Bind with `sampleType: \"depth\"`. */\n readonly depth: Texture2D;\n /**\n * The same depth as the single-sample `RenderTarget` it lives in, for Lite tasks that take a\n * `depthTexture` target (contact shadows, SSGI).\n */\n readonly depthTarget: RenderTarget;\n /** World-space normals, `rgba16float`, stored as `n * 0.5 + 0.5`; 0 where nothing was drawn. */\n readonly normals: Texture2D;\n /**\n * Screen-space motion, `rgba16float`: `xy = 0.5 * (previousNdc - currentNdc)`, so UV units with Y\n * up, pointing from where a pixel is now to where it was last frame; 0 where nothing was drawn.\n * Camera motion always counts. Object motion counts for Standard materials only: Lite 1.34's PBR\n * geometry view reprojects the current world position (`pbr-geometry-output-shader.js` line 41),\n * so a moving PBR mesh under a still camera reads 0.\n */\n readonly velocity: Texture2D;\n /**\n * The depth pyramid, `r32float`, every mip level; level `n` is the `max` of its four children in\n * level `n - 1`. Read with `textureLoad(tex, coord, mip)`. A resize or recovered device replaces\n * this object, so read it again after {@link SceneInputs.onChange}.\n */\n readonly depthPyramid: Texture2D;\n /** How many mip levels {@link SceneInputs.depthPyramid} has. */\n readonly depthPyramidMipCount: number;\n /** `true` once {@link SceneInputs.release} ran. */\n readonly isReleased: boolean;\n /**\n * Registers a callback for when the textures were reallocated (resize, recovered device).\n *\n * @param callback - Runs during the frame graph rebuild, before the next frame is recorded.\n * @returns A function that unregisters it.\n */\n onChange(callback: () => void): () => void;\n /** Ends this lease. The last release removes and disposes the tasks and targets. Idempotent. */\n release(): void;\n}\n\n/**\n * The per-scene owner of the shared inputs: one per renderer.\n *\n * @internal\n */\nexport interface SceneInputsHost {\n /**\n * Leases the inputs, creating the geometry pass for the first user.\n *\n * @param isFrameGraphBuilt - Whether the scene is registered, so new tasks must be recorded now;\n * before registration `registerScene` records them.\n * @returns A lease; call its `release()` when done. `null` once the host is disposed.\n */\n acquire(isFrameGraphBuilt: boolean): SceneInputs | null;\n /** How many leases are live. */\n readonly userCount: number;\n /** Ends every lease and frees everything. Idempotent. */\n dispose(): void;\n}\n\n/** What the first acquire builds and the last release frees. */\ninterface SharedInputs {\n readonly depth: RenderTargetTextureResult;\n readonly normals: RenderTargetTextureResult;\n readonly velocity: RenderTargetTextureResult;\n readonly tasks: readonly Task[];\n readonly pyramid: { current: DepthPyramid };\n readonly listeners: Set<() => void>;\n readonly stopResizeWatch: () => void;\n}\n\n/**\n * Creates the scene-inputs owner for one scene. It adds nothing to the frame graph until the first\n * {@link SceneInputsHost.acquire}.\n *\n * @param engine - The engine, which is also the primary surface.\n * @param scene - The render scene.\n * @returns The host.\n *\n * @internal\n */\nexport function createSceneInputsHost(engine: EngineContext, scene: SceneContext): SceneInputsHost {\n let shared: SharedInputs | null = null;\n const leases = new Set<SceneInputs>();\n let isDisposed = false;\n\n const releaseLease = (lease: SceneInputs): void => {\n if (!leases.delete(lease) || leases.size > 0 || shared === null) {\n return;\n }\n teardown(scene, shared);\n shared = null;\n };\n\n return {\n acquire(isFrameGraphBuilt: boolean): SceneInputs | null {\n if (isDisposed) {\n return null;\n }\n shared ??= buildSharedInputs(engine, scene, isFrameGraphBuilt);\n const inputs = shared;\n let isReleased = false;\n const own = new Set<() => void>();\n const lease: SceneInputs = {\n depth: requireDepthFacade(inputs.depth),\n depthTarget: inputs.depth.rt,\n normals: inputs.normals.texture,\n velocity: inputs.velocity.texture,\n get depthPyramid(): Texture2D {\n return inputs.pyramid.current.texture;\n },\n get depthPyramidMipCount(): number {\n return inputs.pyramid.current.mipCount;\n },\n get isReleased(): boolean {\n return isReleased;\n },\n onChange(callback: () => void): () => void {\n inputs.listeners.add(callback);\n own.add(callback);\n return (): void => {\n inputs.listeners.delete(callback);\n own.delete(callback);\n };\n },\n release(): void {\n if (isReleased) {\n return;\n }\n isReleased = true;\n for (const callback of own) {\n inputs.listeners.delete(callback);\n }\n own.clear();\n releaseLease(lease);\n },\n };\n leases.add(lease);\n return lease;\n },\n get userCount(): number {\n return leases.size;\n },\n dispose(): void {\n if (isDisposed) {\n return;\n }\n isDisposed = true;\n for (const lease of leases) {\n lease.release();\n }\n },\n };\n}\n\n/**\n * Builds the targets and tasks, and splices the tasks into the frame graph ahead of the scene pass.\n *\n * @param engine - The engine.\n * @param scene - The scene.\n * @param isFrameGraphBuilt - Whether each task must be recorded now.\n * @returns The shared state.\n */\nfunction buildSharedInputs(engine: EngineContext, scene: SceneContext, isFrameGraphBuilt: boolean): SharedInputs {\n const depth = createSurfaceRenderTargetTexture(\n engine,\n { lbl: \"ignifx:scene-inputs-depth\", dFormat: SCENE_INPUT_FORMATS.depth, samples: 1, size: engine },\n withSampledDepthTexture,\n );\n const normals = createSurfaceRenderTargetTexture(engine, {\n lbl: \"ignifx:scene-inputs-normals\",\n format: SCENE_INPUT_FORMATS.normals,\n samples: 1,\n size: engine,\n });\n const velocity = createSurfaceRenderTargetTexture(engine, {\n lbl: \"ignifx:scene-inputs-velocity\",\n format: SCENE_INPUT_FORMATS.velocity,\n samples: 1,\n size: engine,\n });\n const geometry = createGeometryRendererTask(\n {\n name: SCENE_INPUT_TASK_NAMES.geometry,\n size: engine,\n depthTexture: depth.rt,\n textureDescriptions: [\n { type: GeometryTextureType.WORLD_NORMAL, format: SCENE_INPUT_FORMATS.normals },\n { type: GeometryTextureType.LINEAR_VELOCITY, format: SCENE_INPUT_FORMATS.velocity },\n ],\n },\n engine,\n scene,\n );\n const copyNormals = createCopyToTextureTask(\n {\n name: SCENE_INPUT_TASK_NAMES.normals,\n sourceTexture: requireAttachment(geometry.geometryWorldNormalTexture, \"world normal\"),\n targetTexture: normals.rt,\n },\n engine,\n scene,\n );\n const copyVelocity = createCopyToTextureTask(\n {\n name: SCENE_INPUT_TASK_NAMES.velocity,\n sourceTexture: requireAttachment(geometry.geometryLinearVelocityTexture, \"linear velocity\"),\n targetTexture: velocity.rt,\n },\n engine,\n scene,\n );\n const depthFacade = requireDepthFacade(depth);\n const pyramid = { current: newPyramid(engine, depthFacade) };\n // The pyramid task adopts what it is given and disposes it with the graph; a forwarding object\n // lets the inner pyramid be replaced after a resize or a recovered device.\n const forward: DepthPyramid = {\n get texture(): Texture2D {\n return pyramid.current.texture;\n },\n get mipCount(): number {\n return pyramid.current.mipCount;\n },\n build(source: Texture2D, encoder?: GPUCommandEncoder): void {\n pyramid.current.build(source, encoder);\n },\n resize(width: number, height: number): void {\n pyramid.current.resize(width, height);\n },\n dispose(): void {\n pyramid.current.dispose();\n },\n };\n const buildPyramid = createDepthPyramidTask(engine, scene, { pyramid: forward, source: () => depthFacade });\n Reflect.set(buildPyramid, \"name\", SCENE_INPUT_TASK_NAMES.depthPyramid);\n\n const tasks: readonly Task[] = [geometry, copyNormals, copyVelocity, buildPyramid];\n addTaskAtStart(scene, geometry);\n addTaskAfter(scene, copyNormals, geometry);\n addTaskAfter(scene, copyVelocity, copyNormals);\n addTaskAfter(scene, buildPyramid, copyVelocity);\n if (isFrameGraphBuilt) {\n const graph = getFrameGraph(scene);\n for (const task of tasks) {\n buildFrameGraphTask(graph, task);\n }\n }\n\n const listeners = new Set<() => void>();\n const stopResizeWatch = onRenderTargetTextureResize(depth, () => {\n pyramid.current.dispose();\n pyramid.current = newPyramid(engine, depthFacade);\n for (const listener of listeners) {\n listener();\n }\n });\n return { depth, normals, velocity, tasks, pyramid, listeners, stopResizeWatch };\n}\n\n/**\n * Removes the tasks from the frame graph and frees every task and target.\n *\n * @param scene - The scene.\n * @param shared - What {@link buildSharedInputs} built.\n */\nfunction teardown(scene: SceneContext, shared: SharedInputs): void {\n shared.stopResizeWatch();\n shared.listeners.clear();\n for (const task of shared.tasks) {\n // Disable first: a disposed task that still executes is a use-after-free.\n task.executionEnabled = false;\n removeFrameGraphTask(scene, task);\n task.dispose();\n }\n disposeRenderTargetTexture(shared.depth);\n disposeRenderTargetTexture(shared.normals);\n disposeRenderTargetTexture(shared.velocity);\n}\n\n/**\n * Takes a task out of the scene's frame graph.\n *\n * @remarks\n * Lite 1.34 has no public remove (`index.d.ts` 206–217 add only), and a disposed task left in the\n * graph is recorded again by the next `frameGraph.build()` against freed targets. The task list is\n * the private `_tasks` array every `addTask*` splices (`lib/frame-graph/frame-graph-actions.js`).\n * If a later Lite renames it, the task stays in, disabled.\n *\n * @param scene - The scene.\n * @param task - The task to remove.\n */\nfunction removeFrameGraphTask(scene: SceneContext, task: Task): void {\n const tasks = frameGraphTasks(scene);\n const index = tasks?.indexOf(task) ?? -1;\n if (tasks !== null && index >= 0) {\n tasks.splice(index, 1);\n }\n}\n\n/**\n * The scene's frame-graph task list, or `null` when Lite no longer exposes it.\n *\n * @param scene - The scene.\n * @returns The live array (Lite's own), or `null`.\n *\n * @internal\n */\nexport function frameGraphTasks(scene: SceneContext): Task[] | null {\n const tasks: unknown = Reflect.get(getFrameGraph(scene), \"_tasks\");\n return isTaskList(tasks) ? tasks : null;\n}\n\n/**\n * Whether a value is Lite's task array.\n *\n * @param value - The value read from the frame graph.\n * @returns `true` for an array.\n */\nfunction isTaskList(value: unknown): value is Task[] {\n return Array.isArray(value);\n}\n\n/**\n * Creates a depth pyramid the size of the depth facade's current texture.\n *\n * @param engine - The engine, whose current device owns the pipelines.\n * @param depth - The depth facade.\n * @returns The pyramid.\n */\nfunction newPyramid(engine: EngineContext, depth: Texture2D): DepthPyramid {\n return createDepthPyramid(engine, { width: depth.width, height: depth.height, reduce: \"max\" });\n}\n\n/**\n * The sampled depth facade of the depth target.\n *\n * @param depth - The depth target, created with `withSampledDepthTexture`.\n * @returns The facade.\n */\nfunction requireDepthFacade(depth: RenderTargetTextureResult): Texture2D {\n if (depth.depthTexture === null) {\n throw new Error(\"Lite built the scene-inputs depth target without a sampled depth facade.\");\n }\n return depth.depthTexture;\n}\n\n/**\n * A geometry attachment the task was asked for.\n *\n * @param target - The accessor's value.\n * @param what - The attachment, for the error.\n * @returns The attachment.\n */\nfunction requireAttachment(target: RenderTarget | null, what: string): RenderTarget {\n if (target === null) {\n throw new Error(`Lite's geometry task built no ${what} attachment.`);\n }\n return target;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAa,yBAAyB;CACpC,UAAU;CACV,SAAS;CACT,UAAU;CACV,cAAc;AAChB;;;;;;AAOA,MAAa,sBAKT;CAAE,OAAO;CAAgB,SAAS;CAAe,UAAU;CAAe,cAAc;AAAW;;;;;;;;;;;AA6FvG,SAAgB,sBAAsB,QAAuB,OAAsC;CACjG,IAAI,SAA8B;CAClC,MAAM,yBAAS,IAAI,IAAiB;CACpC,IAAI,aAAa;CAEjB,MAAM,gBAAgB,UAA6B;EACjD,IAAI,CAAC,OAAO,OAAO,KAAK,KAAK,OAAO,OAAO,KAAK,WAAW,MACzD;EAEF,SAAS,OAAO,MAAM;EACtB,SAAS;CACX;CAEA,OAAO;EACL,QAAQ,mBAAgD;GACtD,IAAI,YACF,OAAO;GAET,WAAW,kBAAkB,QAAQ,OAAO,iBAAiB;GAC7D,MAAM,SAAS;GACf,IAAI,aAAa;GACjB,MAAM,sBAAM,IAAI,IAAgB;GAChC,MAAM,QAAqB;IACzB,OAAO,mBAAmB,OAAO,KAAK;IACtC,aAAa,OAAO,MAAM;IAC1B,SAAS,OAAO,QAAQ;IACxB,UAAU,OAAO,SAAS;IAC1B,IAAI,eAA0B;KAC5B,OAAO,OAAO,QAAQ,QAAQ;IAChC;IACA,IAAI,uBAA+B;KACjC,OAAO,OAAO,QAAQ,QAAQ;IAChC;IACA,IAAI,aAAsB;KACxB,OAAO;IACT;IACA,SAAS,UAAkC;KACzC,OAAO,UAAU,IAAI,QAAQ;KAC7B,IAAI,IAAI,QA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;CACf;CACA,2BAA2B,OAAO,KAAK;CACvC,2BAA2B,OAAO,OAAO;CACzC,2BAA2B,OAAO,QAAQ;AAC5C;;;;;;;;;;;;;AAcA,SAAS,qBAAqB,OAAqB,MAAkB;CACnE,MAAM,QAAQ,gBAAgB,KAAK;CACnC,MAAM,QAAQ,OAAO,QAAQ,IAAI,KAAK;CACtC,IAAI,UAAU,QAAQ,SAAS,GAC7B,MAAM,OAAO,OAAO,CAAC;AAEzB;;;;;;;;;AAUA,SAAgB,gBAAgB,OAAoC;CAClE,MAAM,QAAiB,QAAQ,IAAI,cAAc,KAAK,GAAG,QAAQ;CACjE,OAAO,WAAW,KAAK,IAAI,QAAQ;AACrC;;;;;;;AAQA,SAAS,WAAW,OAAiC;CACnD,OAAO,MAAM,QAAQ,KAAK;AAC5B;;;;;;;;AASA,SAAS,WAAW,QAAuB,OAAgC;CACzE,OAAO,mBAAmB,QAAQ;EAAE,OAAO,MAAM;EAAO,QAAQ,MAAM;EAAQ,QAAQ;CAAM,CAAC;AAC/F;;;;;;;AAQA,SAAS,mBAAmB,OAA6C;CACvE,IAAI,MAAM,iBAAiB,MACzB,MAAM,IAAI,MAAM,0EAA0E;CAE5F,OAAO,MAAM;AACf;;;;;;;;AASA,SAAS,kBAAkB,QAA6B,MAA4B;CAClF,IAAI,WAAW,MACb,MAAM,IAAI,MAAM,iCAAiC,KAAK,aAAa;CAErE,OAAO;AACT"}
@@ -1,113 +0,0 @@
1
- import { o as rebuildMaterialPipelines } from "./material-myMbl9mW.js";
2
- import { createScreenSpaceGlobalIlluminationPostProcessTask, getPbrUnlit, isPbrMaterial } from "@babylonjs/lite";
3
- //#region src/lite/gpu/ssgi.ts
4
- /** The pass's frame-graph task name. */
5
- const TASK_NAME = "ignifx:ssgi";
6
- /**
7
- * The environment plugin's name.
8
- *
9
- * @internal
10
- */
11
- const SSGI_ENVIRONMENT_PLUGIN_NAME = "ignifx-ssgi-environment";
12
- /**
13
- * Creates an SSGI pass.
14
- *
15
- * @param engine - The engine.
16
- * @param scene - The scene, whose materials get the plugin.
17
- * @param depth - The scene-input depth target.
18
- * @param camera - The camera the depth was drawn from.
19
- * @param options - The initial tuning and the creation-time choices.
20
- * @param options.tuning - The initial tuning.
21
- * @param options.halfResolution - Whether the rays are traced at half resolution.
22
- * @param options.usePlugin - Whether Lite's plugin bridges are installed, so the plugin can be used.
23
- * @returns The pass.
24
- *
25
- * @internal
26
- */
27
- function createSsgiPass(engine, scene, depth, camera, options) {
28
- let task = null;
29
- let plugin = null;
30
- let pluginValue = NaN;
31
- return {
32
- create(source, target) {
33
- const tuning = options.tuning;
34
- task = createScreenSpaceGlobalIlluminationPostProcessTask({
35
- name: TASK_NAME,
36
- sourceTexture: source,
37
- depthTexture: depth,
38
- targetTexture: target,
39
- camera,
40
- resolutionScale: options.halfResolution ? .5 : 1,
41
- intensity: tuning.intensity,
42
- rayLength: tuning.radius,
43
- stepCount: tuning.samples,
44
- composition: "additive"
45
- }, engine, scene);
46
- return task;
47
- },
48
- update(tuning, isSceneRegistered) {
49
- if (task === null) return;
50
- task.intensity = tuning.intensity;
51
- task.rayLength = tuning.radius;
52
- task.stepCount = tuning.samples;
53
- if (!options.usePlugin) return;
54
- const value = Math.min(1, Math.max(0, tuning.environmentDiffuse));
55
- if (plugin === null || value !== pluginValue) {
56
- pluginValue = value;
57
- plugin = createSsgiEnvironmentPlugin(value);
58
- }
59
- attachPlugin(scene, plugin, isSceneRegistered);
60
- },
61
- dispose(isSceneRegistered) {
62
- if (plugin !== null) {
63
- attachPlugin(scene, null, isSceneRegistered);
64
- plugin = null;
65
- }
66
- }
67
- };
68
- }
69
- /**
70
- * Builds the plugin that leaves `environmentDiffuse` of the environment's diffuse light.
71
- *
72
- * @param environmentDiffuse - What remains, 0 to 1. Baked into the WGSL, so a change compiles anew.
73
- * @returns The plugin.
74
- *
75
- * @internal
76
- */
77
- function createSsgiEnvironmentPlugin(environmentDiffuse) {
78
- const fragment = {
79
- CUSTOM_FRAGMENT_DEFINITIONS: "var<private> finalIrradiance: vec3<f32>;var<private> ignifxSsgiRemoved: vec3<f32>;",
80
- CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: `color-=(finalIrradiance-ignifxSsgiRemoved)*${(1 - environmentDiffuse).toFixed(4)};ignifxSsgiRemoved=finalIrradiance;`
81
- };
82
- return {
83
- name: SSGI_ENVIRONMENT_PLUGIN_NAME,
84
- priority: -1,
85
- getCustomCode: (stage) => stage === "fragment" ? fragment : null
86
- };
87
- }
88
- /**
89
- * Puts a plugin on every lit PBR material in the scene, replacing an older one of the same name,
90
- * or takes it off every material when `plugin` is `null`.
91
- *
92
- * @param scene - The scene.
93
- * @param plugin - The current plugin, or `null` to remove.
94
- * @param isSceneRegistered - Whether a changed material's pipelines must be rebuilt.
95
- */
96
- function attachPlugin(scene, plugin, isSceneRegistered) {
97
- const meshes = scene.meshes;
98
- for (let index = 0; index < meshes.length; index += 1) {
99
- const material = meshes[index]?.material;
100
- if (material === void 0 || material === null || !isPbrMaterial(material)) continue;
101
- const current = material.plugins ?? [];
102
- const wanted = plugin !== null && getPbrUnlit(material) === void 0;
103
- if (wanted && current.includes(plugin)) continue;
104
- const kept = current.filter((other) => other.name !== SSGI_ENVIRONMENT_PLUGIN_NAME);
105
- if (!wanted && kept.length === current.length) continue;
106
- material.plugins = wanted ? [...kept, plugin] : kept;
107
- if (isSceneRegistered) rebuildMaterialPipelines(scene, material);
108
- }
109
- }
110
- //#endregion
111
- export { SSGI_ENVIRONMENT_PLUGIN_NAME, createSsgiEnvironmentPlugin, createSsgiPass };
112
-
113
- //# sourceMappingURL=ssgi-DSnhqotl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssgi-DSnhqotl.js","names":[],"sources":["../src/lite/gpu/ssgi.ts"],"sourcesContent":["import { createScreenSpaceGlobalIlluminationPostProcessTask, getPbrUnlit, isPbrMaterial } from \"@babylonjs/lite\";\nimport { rebuildMaterialPipelines } from \"../material.js\";\nimport type { SceneColorPass } from \"./scene-color-passes.js\";\nimport type {\n Camera,\n EngineContext,\n MaterialPlugin,\n RenderTarget,\n SceneContext,\n ScreenSpaceGlobalIlluminationPostProcessTask,\n} from \"@babylonjs/lite\";\n\n/**\n * Screen-space global illumination: Lite's `@beta`\n * `createScreenSpaceGlobalIlluminationPostProcessTask` (`index.d.ts` 3681), fed the shared\n * scene-input depth and run as a scene-colour pass (`./scene-color-passes.ts`), plus a material\n * plugin that turns the environment's diffuse light down while it runs. Its own chunk, loaded only\n * while a `PostProcessStack` enables `ssgi` (`CONSTITUTION.md` §2.5).\n *\n * **Why the plugin.** Lite's additive composite adds one bounce of the lit scene colour on top of\n * the frame, and the environment's irradiance (`finalIrradiance`, `lib/material/pbr/fragments/\n * ibl-fragment.js` line 6) already stands in for that bounce, so with both the indirect light is\n * counted twice. The plugin subtracts `(1 - environmentDiffuse)` of `finalIrradiance` from the\n * colour; specular reflections are left alone.\n *\n * **How it compiles everywhere.** `CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION` is injected at both\n * the `AI` and the `NI` slot, which follow each other, and `finalIrradiance` exists only when the\n * material has an environment. The plugin declares a module-scope `finalIrradiance` of zero, which\n * the IBL code's own `let` shadows where it exists, and subtracts only what changed since its last\n * run, so the two injections together subtract once whichever side of the IBL code they land on,\n * and a material without an environment subtracts nothing. Priority -1 puts it ahead of the HDR\n * linear-output save (priority 0), which then keeps the adjusted colour.\n *\n * Plugins need Lite's bridges, which `rendering.hdr` and the `materialPlugins` feature install, so\n * without either the plugin is not attached and the environment is left as it is.\n */\n\n/**\n * The tuning a recorded pass follows live.\n *\n * @internal\n */\nexport interface SsgiTuning {\n /** How strongly the bounce is added, 0 to 4. */\n readonly intensity: number;\n /** How far each ray marches, in world units. */\n readonly radius: number;\n /** March steps per ray, 1 to 64. */\n readonly samples: number;\n /** How much of the environment's diffuse light remains, 0 to 1. */\n readonly environmentDiffuse: number;\n}\n\n/**\n * An SSGI pass: its task once created, its per-frame update, and the plugin it owns.\n *\n * @internal\n */\nexport interface SsgiPass extends SceneColorPass {\n /**\n * Writes the tuning onto the task and, when plugins are available, keeps every lit PBR material's\n * environment plugin in step.\n *\n * @param tuning - The stack's `ssgi` record.\n * @param isSceneRegistered - Whether a patched material's pipelines must be rebuilt.\n */\n update(tuning: SsgiTuning, isSceneRegistered: boolean): void;\n /**\n * Takes the plugin off every material again. The task itself is disposed by the installer.\n *\n * @param isSceneRegistered - Whether a patched material's pipelines must be rebuilt.\n */\n dispose(isSceneRegistered: boolean): void;\n}\n\n/** The pass's frame-graph task name. */\nconst TASK_NAME = \"ignifx:ssgi\";\n\n/**\n * The environment plugin's name.\n *\n * @internal\n */\nexport const SSGI_ENVIRONMENT_PLUGIN_NAME = \"ignifx-ssgi-environment\";\n\n/**\n * Creates an SSGI pass.\n *\n * @param engine - The engine.\n * @param scene - The scene, whose materials get the plugin.\n * @param depth - The scene-input depth target.\n * @param camera - The camera the depth was drawn from.\n * @param options - The initial tuning and the creation-time choices.\n * @param options.tuning - The initial tuning.\n * @param options.halfResolution - Whether the rays are traced at half resolution.\n * @param options.usePlugin - Whether Lite's plugin bridges are installed, so the plugin can be used.\n * @returns The pass.\n *\n * @internal\n */\nexport function createSsgiPass(\n engine: EngineContext,\n scene: SceneContext,\n depth: RenderTarget,\n camera: Camera,\n options: { readonly tuning: SsgiTuning; readonly halfResolution: boolean; readonly usePlugin: boolean },\n): SsgiPass {\n let task: ScreenSpaceGlobalIlluminationPostProcessTask | null = null;\n let plugin: MaterialPlugin | null = null;\n let pluginValue = Number.NaN;\n return {\n create(source: RenderTarget, target: RenderTarget): ScreenSpaceGlobalIlluminationPostProcessTask {\n const tuning = options.tuning;\n task = createScreenSpaceGlobalIlluminationPostProcessTask(\n {\n name: TASK_NAME,\n sourceTexture: source,\n depthTexture: depth,\n targetTexture: target,\n camera,\n resolutionScale: options.halfResolution ? 0.5 : 1,\n intensity: tuning.intensity,\n rayLength: tuning.radius,\n stepCount: tuning.samples,\n composition: \"additive\",\n },\n engine,\n scene,\n );\n return task;\n },\n update(tuning: SsgiTuning, isSceneRegistered: boolean): void {\n if (task === null) {\n return;\n }\n task.intensity = tuning.intensity;\n task.rayLength = tuning.radius;\n task.stepCount = tuning.samples;\n if (!options.usePlugin) {\n return;\n }\n const value = Math.min(1, Math.max(0, tuning.environmentDiffuse));\n if (plugin === null || value !== pluginValue) {\n pluginValue = value;\n plugin = createSsgiEnvironmentPlugin(value);\n }\n attachPlugin(scene, plugin, isSceneRegistered);\n },\n dispose(isSceneRegistered: boolean): void {\n if (plugin !== null) {\n attachPlugin(scene, null, isSceneRegistered);\n plugin = null;\n }\n },\n };\n}\n\n/**\n * Builds the plugin that leaves `environmentDiffuse` of the environment's diffuse light.\n *\n * @param environmentDiffuse - What remains, 0 to 1. Baked into the WGSL, so a change compiles anew.\n * @returns The plugin.\n *\n * @internal\n */\nexport function createSsgiEnvironmentPlugin(environmentDiffuse: number): MaterialPlugin {\n const removed = (1 - environmentDiffuse).toFixed(4);\n const fragment = {\n CUSTOM_FRAGMENT_DEFINITIONS: \"var<private> finalIrradiance: vec3<f32>;var<private> ignifxSsgiRemoved: vec3<f32>;\",\n CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: `color-=(finalIrradiance-ignifxSsgiRemoved)*${removed};ignifxSsgiRemoved=finalIrradiance;`,\n };\n return {\n name: SSGI_ENVIRONMENT_PLUGIN_NAME,\n priority: -1,\n getCustomCode: (stage) => (stage === \"fragment\" ? fragment : null),\n };\n}\n\n/**\n * Puts a plugin on every lit PBR material in the scene, replacing an older one of the same name,\n * or takes it off every material when `plugin` is `null`.\n *\n * @param scene - The scene.\n * @param plugin - The current plugin, or `null` to remove.\n * @param isSceneRegistered - Whether a changed material's pipelines must be rebuilt.\n */\nfunction attachPlugin(scene: SceneContext, plugin: MaterialPlugin | null, isSceneRegistered: boolean): void {\n const meshes = scene.meshes;\n for (let index = 0; index < meshes.length; index += 1) {\n const material = meshes[index]?.material;\n // Declared non-null, but Lite's mesh factories create meshes with `material: null`.\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (material === undefined || material === null || !isPbrMaterial(material)) {\n continue;\n }\n const current = material.plugins ?? [];\n const wanted = plugin !== null && getPbrUnlit(material) === undefined;\n if (wanted && current.includes(plugin)) {\n continue;\n }\n const kept = current.filter((other) => other.name !== SSGI_ENVIRONMENT_PLUGIN_NAME);\n if (!wanted && kept.length === current.length) {\n continue;\n }\n material.plugins = wanted ? [...kept, plugin] : kept;\n if (isSceneRegistered) {\n rebuildMaterialPipelines(scene, material);\n }\n }\n}\n"],"mappings":";;;;AA4EA,MAAM,YAAY;;;;;;AAOlB,MAAa,+BAA+B;;;;;;;;;;;;;;;;AAiB5C,SAAgB,eACd,QACA,OACA,OACA,QACA,SACU;CACV,IAAI,OAA4D;CAChE,IAAI,SAAgC;CACpC,IAAI,cAAc;CAClB,OAAO;EACL,OAAO,QAAsB,QAAoE;GAC/F,MAAM,SAAS,QAAQ;GACvB,OAAO,mDACL;IACE,MAAM;IACN,eAAe;IACf,cAAc;IACd,eAAe;IACf;IACA,iBAAiB,QAAQ,iBAAiB,KAAM;IAChD,WAAW,OAAO;IAClB,WAAW,OAAO;IAClB,WAAW,OAAO;IAClB,aAAa;GACf,GACA,QACA,KACF;GACA,OAAO;EACT;EACA,OAAO,QAAoB,mBAAkC;GAC3D,IAAI,SAAS,MACX;GAEF,KAAK,YAAY,OAAO;GACxB,KAAK,YAAY,OAAO;GACxB,KAAK,YAAY,OAAO;GACxB,IAAI,CAAC,QAAQ,WACX;GAEF,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAO,kBAAkB,CAAC;GAChE,IAAI,WAAW,QAAQ,UAAU,aAAa;IAC5C,cAAc;IACd,SAAS,4BAA4B,KAAK;GAC5C;GACA,aAAa,OAAO,QAAQ,iBAAiB;EAC/C;EACA,QAAQ,mBAAkC;GACxC,IAAI,WAAW,MAAM;IACnB,aAAa,OAAO,MAAM,iBAAiB;IAC3C,SA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