@adobe/data-gpu 0.10.23 → 0.10.25
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.
- package/dist/core/core-plugin.d.ts +1 -1
- package/dist/graphics/animation/animation-plugin.d.ts +2 -2
- package/dist/graphics/camera/camera-plugin.d.ts +1 -1
- package/dist/graphics/camera/orbit/orbit-data-plugin.d.ts +1 -1
- package/dist/graphics/camera/orbit/orbit-plugin.d.ts +1 -1
- package/dist/graphics/camera/orbit/orbit-system-plugin.d.ts +1 -1
- package/dist/graphics/graphics-plugin.d.ts +1 -1
- package/dist/graphics/picking/picking-plugin.d.ts +770 -770
- package/dist/graphics/rendering/bone-collider-plugin.d.ts +200 -200
- package/dist/graphics/rendering/ibl-render/ibl-render-plugin.d.ts +146 -146
- package/dist/graphics/rendering/interpolation-plugin.d.ts +7 -7
- package/dist/graphics/rendering/jolt-ragdoll-plugin.d.ts +200 -200
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.d.ts +7 -7
- package/dist/graphics/rendering/model-collider-plugin.d.ts +150 -150
- package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.d.ts +146 -146
- package/dist/graphics/rendering/skinning/skinning-plugin.d.ts +168 -168
- package/dist/graphics/scene/model/model-loader-plugin.d.ts +150 -150
- package/dist/graphics/scene/model/shape/shape-geometry-plugin.d.ts +74 -74
- package/dist/graphics/scene/model/world-bounds-plugin.d.ts +150 -150
- package/dist/graphics/scene/scene-plugin.d.ts +16 -16
- package/dist/graphics/scene/scene-uniforms/scene-uniforms-plugin.d.ts +13 -13
- package/dist/physics/physics-clock-plugin.d.ts +1 -1
- package/dist/physics/solvers/jolt-solver-plugin.d.ts +1 -1
- package/dist/physics/solvers/rapier-solver-plugin.d.ts +1 -1
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/graphics/rendering/material-gpu/material-arrays.d.ts +0 -47
- package/dist/graphics/rendering/material-gpu/material-arrays.js +0 -83
- package/dist/graphics/rendering/material-gpu/material-arrays.js.map +0 -1
- package/dist/graphics/rendering/material-gpu/material-bind-group.d.ts +0 -9
- package/dist/graphics/rendering/material-gpu/material-bind-group.js +0 -52
- package/dist/graphics/rendering/material-gpu/material-bind-group.js.map +0 -1
- package/dist/graphics/rendering/material-gpu/material-gpu-plugin.d.ts +0 -259
- package/dist/graphics/rendering/material-gpu/material-gpu-plugin.js +0 -90
- package/dist/graphics/rendering/material-gpu/material-gpu-plugin.js.map +0 -1
- package/dist/graphics/rendering/pbr-render/pbr-array-shader.wgsl.d.ts +0 -10
- package/dist/graphics/rendering/pbr-render/pbr-array-shader.wgsl.js +0 -145
- package/dist/graphics/rendering/pbr-render/pbr-array-shader.wgsl.js.map +0 -1
- package/dist/graphics/rendering/pbr-render/pbr-render-plugin.d.ts +0 -1266
- package/dist/graphics/rendering/pbr-render/pbr-render-plugin.js +0 -254
- package/dist/graphics/rendering/pbr-render/pbr-render-plugin.js.map +0 -1
- package/dist/graphics/scene/model/geometry/geometry.d.ts +0 -9
- package/dist/graphics/scene/model/geometry/geometry.js +0 -3
- package/dist/graphics/scene/model/geometry/geometry.js.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shared GPU material set: five `texture_2d_array`s (one per PBR map) plus
|
|
3
|
-
* a palette storage buffer of per-layer factors. Every material occupies one
|
|
4
|
-
* layer across all five arrays; a drawable selects its material with a single
|
|
5
|
-
* per-instance layer index. Built once and grown by layer — materials are
|
|
6
|
-
* added rarely and edited never, so nothing here is rebuilt per frame.
|
|
7
|
-
*/
|
|
8
|
-
export interface MaterialArrays {
|
|
9
|
-
baseColor: GPUTexture;
|
|
10
|
-
metallicRoughness: GPUTexture;
|
|
11
|
-
normal: GPUTexture;
|
|
12
|
-
occlusion: GPUTexture;
|
|
13
|
-
emissive: GPUTexture;
|
|
14
|
-
}
|
|
15
|
-
/** Fixed layer size every material map is resampled to. */
|
|
16
|
-
export declare const MATERIAL_TEXTURE_SIZE = 512;
|
|
17
|
-
/** Maximum distinct materials (array layers). 16 × 512² × 5 maps ≈ 80 MB. */
|
|
18
|
-
export declare const MAX_MATERIAL_LAYERS = 16;
|
|
19
|
-
/** Bytes per palette entry: baseColor(vec4) + emissive/metallic(vec4) + rough/normal/occlusion(vec4). */
|
|
20
|
-
export declare const PALETTE_STRIDE = 48;
|
|
21
|
-
export declare function createMaterialArrays(device: GPUDevice): MaterialArrays;
|
|
22
|
-
/** Per-material visible factors written into one palette layer. */
|
|
23
|
-
export interface MaterialFactors {
|
|
24
|
-
baseColorFactor: readonly number[];
|
|
25
|
-
emissiveFactor: readonly number[];
|
|
26
|
-
metallicFactor: number;
|
|
27
|
-
roughnessFactor: number;
|
|
28
|
-
normalScale: number;
|
|
29
|
-
occlusionStrength: number;
|
|
30
|
-
}
|
|
31
|
-
export declare function writePaletteLayer(device: GPUDevice, palette: GPUBuffer, layer: number, f: MaterialFactors): void;
|
|
32
|
-
/** The five map source URLs for one material ("" = leave the neutral layer). */
|
|
33
|
-
export interface MaterialMapUrls {
|
|
34
|
-
baseColorUrl: string;
|
|
35
|
-
metallicRoughnessUrl: string;
|
|
36
|
-
normalUrl: string;
|
|
37
|
-
occlusionUrl: string;
|
|
38
|
-
emissiveUrl: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Fetches a material's maps and blits them (resampled to the layer size) into
|
|
42
|
-
* its array layer. Fire-and-forget: each map resolves independently, so a body
|
|
43
|
-
* renders (neutral) immediately and sharpens as textures arrive. URLs shared
|
|
44
|
-
* across maps (e.g. an ARM image used for both metallicRoughness and occlusion)
|
|
45
|
-
* are fetched once and copied to each target.
|
|
46
|
-
*/
|
|
47
|
-
export declare function loadMaterialMaps(device: GPUDevice, arrays: MaterialArrays, layer: number, urls: MaterialMapUrls): void;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
/** Fixed layer size every material map is resampled to. */
|
|
3
|
-
export const MATERIAL_TEXTURE_SIZE = 512;
|
|
4
|
-
/** Maximum distinct materials (array layers). 16 × 512² × 5 maps ≈ 80 MB. */
|
|
5
|
-
export const MAX_MATERIAL_LAYERS = 16;
|
|
6
|
-
/** Bytes per palette entry: baseColor(vec4) + emissive/metallic(vec4) + rough/normal/occlusion(vec4). */
|
|
7
|
-
export const PALETTE_STRIDE = 48;
|
|
8
|
-
export function createMaterialArrays(device) {
|
|
9
|
-
const make = (format) => device.createTexture({
|
|
10
|
-
size: [MATERIAL_TEXTURE_SIZE, MATERIAL_TEXTURE_SIZE, MAX_MATERIAL_LAYERS],
|
|
11
|
-
dimension: "2d",
|
|
12
|
-
format,
|
|
13
|
-
// RENDER_ATTACHMENT is required by copyExternalImageToTexture.
|
|
14
|
-
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
baseColor: make("rgba8unorm-srgb"),
|
|
18
|
-
metallicRoughness: make("rgba8unorm"),
|
|
19
|
-
normal: make("rgba8unorm"),
|
|
20
|
-
occlusion: make("rgba8unorm"),
|
|
21
|
-
emissive: make("rgba8unorm-srgb"),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const _palette = new Float32Array(PALETTE_STRIDE / 4);
|
|
25
|
-
export function writePaletteLayer(device, palette, layer, f) {
|
|
26
|
-
_palette[0] = f.baseColorFactor[0];
|
|
27
|
-
_palette[1] = f.baseColorFactor[1];
|
|
28
|
-
_palette[2] = f.baseColorFactor[2];
|
|
29
|
-
_palette[3] = f.baseColorFactor[3];
|
|
30
|
-
_palette[4] = f.emissiveFactor[0];
|
|
31
|
-
_palette[5] = f.emissiveFactor[1];
|
|
32
|
-
_palette[6] = f.emissiveFactor[2];
|
|
33
|
-
_palette[7] = f.metallicFactor;
|
|
34
|
-
_palette[8] = f.roughnessFactor;
|
|
35
|
-
_palette[9] = f.normalScale;
|
|
36
|
-
_palette[10] = f.occlusionStrength;
|
|
37
|
-
_palette[11] = 0;
|
|
38
|
-
device.queue.writeBuffer(palette, layer * PALETTE_STRIDE, _palette);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Fetches a material's maps and blits them (resampled to the layer size) into
|
|
42
|
-
* its array layer. Fire-and-forget: each map resolves independently, so a body
|
|
43
|
-
* renders (neutral) immediately and sharpens as textures arrive. URLs shared
|
|
44
|
-
* across maps (e.g. an ARM image used for both metallicRoughness and occlusion)
|
|
45
|
-
* are fetched once and copied to each target.
|
|
46
|
-
*/
|
|
47
|
-
export function loadMaterialMaps(device, arrays, layer, urls) {
|
|
48
|
-
const targets = [
|
|
49
|
-
{ url: urls.baseColorUrl, tex: arrays.baseColor },
|
|
50
|
-
{ url: urls.metallicRoughnessUrl, tex: arrays.metallicRoughness },
|
|
51
|
-
{ url: urls.normalUrl, tex: arrays.normal },
|
|
52
|
-
{ url: urls.occlusionUrl, tex: arrays.occlusion },
|
|
53
|
-
{ url: urls.emissiveUrl, tex: arrays.emissive },
|
|
54
|
-
];
|
|
55
|
-
const byUrl = new Map();
|
|
56
|
-
for (const t of targets) {
|
|
57
|
-
if (!t.url)
|
|
58
|
-
continue;
|
|
59
|
-
const list = byUrl.get(t.url);
|
|
60
|
-
if (list)
|
|
61
|
-
list.push(t.tex);
|
|
62
|
-
else
|
|
63
|
-
byUrl.set(t.url, [t.tex]);
|
|
64
|
-
}
|
|
65
|
-
for (const [url, texes] of byUrl) {
|
|
66
|
-
fetch(url)
|
|
67
|
-
.then(r => { if (!r.ok)
|
|
68
|
-
throw new Error(`material map ${r.status}: ${url}`); return r.blob(); })
|
|
69
|
-
.then(blob => createImageBitmap(blob, {
|
|
70
|
-
resizeWidth: MATERIAL_TEXTURE_SIZE,
|
|
71
|
-
resizeHeight: MATERIAL_TEXTURE_SIZE,
|
|
72
|
-
colorSpaceConversion: "none",
|
|
73
|
-
}))
|
|
74
|
-
.then(bitmap => {
|
|
75
|
-
for (const tex of texes) {
|
|
76
|
-
device.queue.copyExternalImageToTexture({ source: bitmap }, { texture: tex, origin: [0, 0, layer] }, [MATERIAL_TEXTURE_SIZE, MATERIAL_TEXTURE_SIZE, 1]);
|
|
77
|
-
}
|
|
78
|
-
bitmap.close();
|
|
79
|
-
})
|
|
80
|
-
.catch(err => console.warn("[materialGpu] map load failed", err));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=material-arrays.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-arrays.js","sourceRoot":"","sources":["../../../../src/graphics/rendering/material-gpu/material-arrays.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAiBvD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,yGAAyG;AACzG,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IAClD,MAAM,IAAI,GAAG,CAAC,MAAwB,EAAc,EAAE,CAClD,MAAM,CAAC,aAAa,CAAC;QACjB,IAAI,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,CAAC;QACzE,SAAS,EAAE,IAAI;QACf,MAAM;QACN,+DAA+D;QAC/D,KAAK,EAAE,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,iBAAiB;KACxG,CAAC,CAAC;IACP,OAAO;QACH,SAAS,EAAU,IAAI,CAAC,iBAAiB,CAAC;QAC1C,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC;QACrC,MAAM,EAAa,IAAI,CAAC,YAAY,CAAC;QACrC,SAAS,EAAU,IAAI,CAAC,YAAY,CAAC;QACrC,QAAQ,EAAW,IAAI,CAAC,iBAAiB,CAAC;KAC7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AE,CAAC,iBAAiB,CAAC,IAAI,EAAE;YAClC,WAAW,EAAE,qBAAqB;YAClC,YAAY,EAAE,qBAAqB;YACnC,oBAAoB,EAAE,MAAM;SAC/B,CAAC,CAAC;aACF,IAAI,CAAC,MAAM,CAAC,EAAE;YACX,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;gBACtB,MAAM,CAAC,KAAK,CAAC,0BAA0B,CACnC,EAAE,MAAM,EAAE,MAAM,EAAE,EAClB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,EACvC,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,CAAC,CAAC,CACpD,CAAC;YACN,CAAC;YACD,MAAM,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1E,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MaterialArrays } from "./material-arrays.js";
|
|
2
|
-
/**
|
|
3
|
-
* Bind-group layout for the shared material set: palette storage buffer +
|
|
4
|
-
* five `texture_2d_array`s + a filtering sampler. The renderer's primitive
|
|
5
|
-
* pipeline builds its pipeline layout from this; `createMaterialBindGroup`
|
|
6
|
-
* builds the matching bind group. Cached per device.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createMaterialBindGroupLayout(device: GPUDevice): GPUBindGroupLayout;
|
|
9
|
-
export declare function createMaterialBindGroup(device: GPUDevice, arrays: MaterialArrays, palette: GPUBuffer): GPUBindGroup;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
const cacheByDevice = new WeakMap();
|
|
3
|
-
function deviceCache(device) {
|
|
4
|
-
let c = cacheByDevice.get(device);
|
|
5
|
-
if (!c) {
|
|
6
|
-
const tex = (binding) => ({
|
|
7
|
-
binding, visibility: GPUShaderStage.FRAGMENT,
|
|
8
|
-
texture: { sampleType: "float", viewDimension: "2d-array" },
|
|
9
|
-
});
|
|
10
|
-
c = {
|
|
11
|
-
layout: device.createBindGroupLayout({
|
|
12
|
-
entries: [
|
|
13
|
-
{ binding: 0, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "read-only-storage" } },
|
|
14
|
-
tex(1), tex(2), tex(3), tex(4), tex(5),
|
|
15
|
-
{ binding: 6, visibility: GPUShaderStage.FRAGMENT, sampler: { type: "filtering" } },
|
|
16
|
-
],
|
|
17
|
-
}),
|
|
18
|
-
sampler: device.createSampler({
|
|
19
|
-
magFilter: "linear", minFilter: "linear", mipmapFilter: "linear",
|
|
20
|
-
addressModeU: "repeat", addressModeV: "repeat",
|
|
21
|
-
}),
|
|
22
|
-
};
|
|
23
|
-
cacheByDevice.set(device, c);
|
|
24
|
-
}
|
|
25
|
-
return c;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Bind-group layout for the shared material set: palette storage buffer +
|
|
29
|
-
* five `texture_2d_array`s + a filtering sampler. The renderer's primitive
|
|
30
|
-
* pipeline builds its pipeline layout from this; `createMaterialBindGroup`
|
|
31
|
-
* builds the matching bind group. Cached per device.
|
|
32
|
-
*/
|
|
33
|
-
export function createMaterialBindGroupLayout(device) {
|
|
34
|
-
return deviceCache(device).layout;
|
|
35
|
-
}
|
|
36
|
-
export function createMaterialBindGroup(device, arrays, palette) {
|
|
37
|
-
const { layout, sampler } = deviceCache(device);
|
|
38
|
-
const view = (t) => t.createView({ dimension: "2d-array" });
|
|
39
|
-
return device.createBindGroup({
|
|
40
|
-
layout,
|
|
41
|
-
entries: [
|
|
42
|
-
{ binding: 0, resource: { buffer: palette } },
|
|
43
|
-
{ binding: 1, resource: view(arrays.baseColor) },
|
|
44
|
-
{ binding: 2, resource: view(arrays.metallicRoughness) },
|
|
45
|
-
{ binding: 3, resource: view(arrays.normal) },
|
|
46
|
-
{ binding: 4, resource: view(arrays.occlusion) },
|
|
47
|
-
{ binding: 5, resource: view(arrays.emissive) },
|
|
48
|
-
{ binding: 6, resource: sampler },
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=material-bind-group.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-bind-group.js","sourceRoot":"","sources":["../../../../src/graphics/rendering/material-gpu/material-bind-group.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAQvD,MAAM,aAAa,GAAG,IAAI,OAAO,EAA0B,CAAC;AAE5D,SAAS,WAAW,CAAC,MAAiB;IAClC,IAAI,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,CAAC,EAAE,CAAC;QACL,MAAM,GAAG,GAAG,CAAC,OAAe,EAA2B,EAAE,CAAC,CAAC;YACvD,OAAO,EAAE,UAAU,EAAE,cAAc,CAAC,QAAQ;YAC5C,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE;SAC9D,CAAC,CAAC;QACH,CAAC,GAAG;YACA,MAAM,EAAE,MAAM,CAAC,qBAAqB,CAAC;gBACjC,OAAO,EAAE;oBACL,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE;oBAC1F,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;oBACtC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE;iBACtF;aACJ,CAAC;YAC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,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YAC/C,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE;SACpC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { type MaterialArrays } from "./material-arrays.js";
|
|
2
|
-
/**
|
|
3
|
-
* materialGpu — derives the shared GPU material set from the `Material`
|
|
4
|
-
* registry. Each authored material is assigned one array layer; its factors go
|
|
5
|
-
* into the palette buffer and its maps are fetched + blitted into that layer.
|
|
6
|
-
*
|
|
7
|
-
* Incremental and cached: the arrays / palette / bind group are built once, and
|
|
8
|
-
* a layer is assigned only to a material that doesn't have one yet (`_layerIndex`
|
|
9
|
-
* excluded). Materials are added rarely and edited never, so steady state does
|
|
10
|
-
* no work. The renderer (P3) binds `_materialBindGroup` once and selects a
|
|
11
|
-
* material per instance by `_layerIndex`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const materialGpu: {
|
|
14
|
-
readonly components: {} & {
|
|
15
|
-
readonly material: {
|
|
16
|
-
readonly type: "integer";
|
|
17
|
-
readonly minimum: -2147483648;
|
|
18
|
-
readonly maximum: 2147483647;
|
|
19
|
-
readonly default: number;
|
|
20
|
-
};
|
|
21
|
-
readonly name: {
|
|
22
|
-
readonly type: "string";
|
|
23
|
-
};
|
|
24
|
-
readonly density: {
|
|
25
|
-
readonly type: "number";
|
|
26
|
-
readonly precision: 1;
|
|
27
|
-
readonly default: number;
|
|
28
|
-
};
|
|
29
|
-
readonly restitution: {
|
|
30
|
-
readonly type: "number";
|
|
31
|
-
readonly precision: 1;
|
|
32
|
-
readonly default: number;
|
|
33
|
-
};
|
|
34
|
-
readonly friction: {
|
|
35
|
-
readonly type: "number";
|
|
36
|
-
readonly precision: 1;
|
|
37
|
-
readonly default: number;
|
|
38
|
-
};
|
|
39
|
-
readonly compliance: {
|
|
40
|
-
readonly type: "number";
|
|
41
|
-
readonly precision: 1;
|
|
42
|
-
readonly default: number;
|
|
43
|
-
};
|
|
44
|
-
readonly heatCapacity: {
|
|
45
|
-
readonly type: "number";
|
|
46
|
-
readonly precision: 1;
|
|
47
|
-
readonly default: number;
|
|
48
|
-
};
|
|
49
|
-
readonly baseColorFactor: {
|
|
50
|
-
readonly type: "array";
|
|
51
|
-
readonly items: {
|
|
52
|
-
readonly type: "number";
|
|
53
|
-
readonly precision: 1;
|
|
54
|
-
readonly default: number;
|
|
55
|
-
};
|
|
56
|
-
readonly minItems: 4;
|
|
57
|
-
readonly maxItems: 4;
|
|
58
|
-
readonly default: readonly [0, 0, 0, 0];
|
|
59
|
-
};
|
|
60
|
-
readonly emissiveFactor: {
|
|
61
|
-
readonly type: "array";
|
|
62
|
-
readonly items: {
|
|
63
|
-
readonly type: "number";
|
|
64
|
-
readonly precision: 1;
|
|
65
|
-
readonly default: number;
|
|
66
|
-
};
|
|
67
|
-
readonly minItems: 3;
|
|
68
|
-
readonly maxItems: 3;
|
|
69
|
-
readonly default: readonly [0, 0, 0];
|
|
70
|
-
};
|
|
71
|
-
readonly metallicFactor: {
|
|
72
|
-
readonly type: "number";
|
|
73
|
-
readonly precision: 1;
|
|
74
|
-
readonly default: number;
|
|
75
|
-
};
|
|
76
|
-
readonly roughnessFactor: {
|
|
77
|
-
readonly type: "number";
|
|
78
|
-
readonly precision: 1;
|
|
79
|
-
readonly default: number;
|
|
80
|
-
};
|
|
81
|
-
readonly normalScale: {
|
|
82
|
-
readonly type: "number";
|
|
83
|
-
readonly precision: 1;
|
|
84
|
-
readonly default: number;
|
|
85
|
-
};
|
|
86
|
-
readonly occlusionStrength: {
|
|
87
|
-
readonly type: "number";
|
|
88
|
-
readonly precision: 1;
|
|
89
|
-
readonly default: number;
|
|
90
|
-
};
|
|
91
|
-
readonly baseColorUrl: {
|
|
92
|
-
readonly type: "string";
|
|
93
|
-
};
|
|
94
|
-
readonly metallicRoughnessUrl: {
|
|
95
|
-
readonly type: "string";
|
|
96
|
-
};
|
|
97
|
-
readonly normalUrl: {
|
|
98
|
-
readonly type: "string";
|
|
99
|
-
};
|
|
100
|
-
readonly occlusionUrl: {
|
|
101
|
-
readonly type: "string";
|
|
102
|
-
};
|
|
103
|
-
readonly emissiveUrl: {
|
|
104
|
-
readonly type: "string";
|
|
105
|
-
};
|
|
106
|
-
} & {
|
|
107
|
-
readonly _layerIndex: {
|
|
108
|
-
readonly type: "integer";
|
|
109
|
-
readonly minimum: 0;
|
|
110
|
-
readonly maximum: 4294967295;
|
|
111
|
-
readonly default: number;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
readonly resources: {
|
|
115
|
-
readonly frameTime: {
|
|
116
|
-
readonly default: import("../../../core/frame-time/public.js");
|
|
117
|
-
readonly nonPersistent: true;
|
|
118
|
-
};
|
|
119
|
-
} & {
|
|
120
|
-
readonly schedulerState: {
|
|
121
|
-
readonly default: import("@adobe/data/ecs").SchedulerState;
|
|
122
|
-
};
|
|
123
|
-
} & {
|
|
124
|
-
readonly device: {
|
|
125
|
-
readonly default: GPUDevice | null;
|
|
126
|
-
readonly nonPersistent: true;
|
|
127
|
-
};
|
|
128
|
-
readonly commandEncoder: {
|
|
129
|
-
readonly default: GPUCommandEncoder | null;
|
|
130
|
-
readonly nonPersistent: true;
|
|
131
|
-
};
|
|
132
|
-
} & {
|
|
133
|
-
readonly materials: {
|
|
134
|
-
readonly default: Record<string, number>;
|
|
135
|
-
};
|
|
136
|
-
} & {
|
|
137
|
-
readonly _materialArrays: {
|
|
138
|
-
readonly default: MaterialArrays | null;
|
|
139
|
-
readonly nonPersistent: true;
|
|
140
|
-
};
|
|
141
|
-
readonly _materialPalette: {
|
|
142
|
-
readonly default: GPUBuffer | null;
|
|
143
|
-
readonly nonPersistent: true;
|
|
144
|
-
};
|
|
145
|
-
readonly _materialBindGroup: {
|
|
146
|
-
readonly default: GPUBindGroup | null;
|
|
147
|
-
readonly nonPersistent: true;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
readonly archetypes: {} & {
|
|
151
|
-
readonly Material: readonly ["name", "density", "restitution", "friction", "compliance", "heatCapacity", "baseColorFactor", "emissiveFactor", "metallicFactor", "roughnessFactor", "normalScale", "occlusionStrength", "baseColorUrl", "metallicRoughnessUrl", "normalUrl", "occlusionUrl", "emissiveUrl"];
|
|
152
|
-
} & {};
|
|
153
|
-
readonly transactions: {} & {} & {
|
|
154
|
-
readonly seedStandardMaterials: (t: import("@adobe/data/ecs").TransactionContext<import("@adobe/data/schema").FromSchemas<{
|
|
155
|
-
readonly material: {
|
|
156
|
-
readonly type: "integer";
|
|
157
|
-
readonly minimum: -2147483648;
|
|
158
|
-
readonly maximum: 2147483647;
|
|
159
|
-
readonly default: number;
|
|
160
|
-
};
|
|
161
|
-
readonly name: {
|
|
162
|
-
readonly type: "string";
|
|
163
|
-
};
|
|
164
|
-
readonly density: {
|
|
165
|
-
readonly type: "number";
|
|
166
|
-
readonly precision: 1;
|
|
167
|
-
readonly default: number;
|
|
168
|
-
};
|
|
169
|
-
readonly restitution: {
|
|
170
|
-
readonly type: "number";
|
|
171
|
-
readonly precision: 1;
|
|
172
|
-
readonly default: number;
|
|
173
|
-
};
|
|
174
|
-
readonly friction: {
|
|
175
|
-
readonly type: "number";
|
|
176
|
-
readonly precision: 1;
|
|
177
|
-
readonly default: number;
|
|
178
|
-
};
|
|
179
|
-
readonly compliance: {
|
|
180
|
-
readonly type: "number";
|
|
181
|
-
readonly precision: 1;
|
|
182
|
-
readonly default: number;
|
|
183
|
-
};
|
|
184
|
-
readonly heatCapacity: {
|
|
185
|
-
readonly type: "number";
|
|
186
|
-
readonly precision: 1;
|
|
187
|
-
readonly default: number;
|
|
188
|
-
};
|
|
189
|
-
readonly baseColorFactor: {
|
|
190
|
-
readonly type: "array";
|
|
191
|
-
readonly items: {
|
|
192
|
-
readonly type: "number";
|
|
193
|
-
readonly precision: 1;
|
|
194
|
-
readonly default: number;
|
|
195
|
-
};
|
|
196
|
-
readonly minItems: 4;
|
|
197
|
-
readonly maxItems: 4;
|
|
198
|
-
readonly default: readonly [0, 0, 0, 0];
|
|
199
|
-
};
|
|
200
|
-
readonly emissiveFactor: {
|
|
201
|
-
readonly type: "array";
|
|
202
|
-
readonly items: {
|
|
203
|
-
readonly type: "number";
|
|
204
|
-
readonly precision: 1;
|
|
205
|
-
readonly default: number;
|
|
206
|
-
};
|
|
207
|
-
readonly minItems: 3;
|
|
208
|
-
readonly maxItems: 3;
|
|
209
|
-
readonly default: readonly [0, 0, 0];
|
|
210
|
-
};
|
|
211
|
-
readonly metallicFactor: {
|
|
212
|
-
readonly type: "number";
|
|
213
|
-
readonly precision: 1;
|
|
214
|
-
readonly default: number;
|
|
215
|
-
};
|
|
216
|
-
readonly roughnessFactor: {
|
|
217
|
-
readonly type: "number";
|
|
218
|
-
readonly precision: 1;
|
|
219
|
-
readonly default: number;
|
|
220
|
-
};
|
|
221
|
-
readonly normalScale: {
|
|
222
|
-
readonly type: "number";
|
|
223
|
-
readonly precision: 1;
|
|
224
|
-
readonly default: number;
|
|
225
|
-
};
|
|
226
|
-
readonly occlusionStrength: {
|
|
227
|
-
readonly type: "number";
|
|
228
|
-
readonly precision: 1;
|
|
229
|
-
readonly default: number;
|
|
230
|
-
};
|
|
231
|
-
readonly baseColorUrl: {
|
|
232
|
-
readonly type: "string";
|
|
233
|
-
};
|
|
234
|
-
readonly metallicRoughnessUrl: {
|
|
235
|
-
readonly type: "string";
|
|
236
|
-
};
|
|
237
|
-
readonly normalUrl: {
|
|
238
|
-
readonly type: "string";
|
|
239
|
-
};
|
|
240
|
-
readonly occlusionUrl: {
|
|
241
|
-
readonly type: "string";
|
|
242
|
-
};
|
|
243
|
-
readonly emissiveUrl: {
|
|
244
|
-
readonly type: "string";
|
|
245
|
-
};
|
|
246
|
-
}>, import("@adobe/data/schema").FromSchemas<{
|
|
247
|
-
readonly materials: {
|
|
248
|
-
readonly default: Record<string, number>;
|
|
249
|
-
};
|
|
250
|
-
}>, {
|
|
251
|
-
readonly Material: readonly ["name", "density", "restitution", "friction", "compliance", "heatCapacity", "baseColorFactor", "emissiveFactor", "metallicFactor", "roughnessFactor", "normalScale", "occlusionStrength", "baseColorUrl", "metallicRoughnessUrl", "normalUrl", "occlusionUrl", "emissiveUrl"];
|
|
252
|
-
}, {}>) => void;
|
|
253
|
-
} & {};
|
|
254
|
-
readonly systems: import("@adobe/data/ecs").SystemDeclarations<"_frameTime" | "update" | "schedulerSystem" | "input" | "preUpdate" | "postUpdate" | "physics" | "preRender" | "render" | "postRender" | "materialGpuBuilder">;
|
|
255
|
-
readonly actions: {};
|
|
256
|
-
readonly services: {};
|
|
257
|
-
readonly computed: {};
|
|
258
|
-
readonly indexes: {} & {} & {};
|
|
259
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
import { Database } from "@adobe/data/ecs";
|
|
3
|
-
import { U32 } from "@adobe/data/math";
|
|
4
|
-
import { core } from "../../../core/core-plugin.js";
|
|
5
|
-
import { Material } from "../../../material/material.js";
|
|
6
|
-
import { MAX_MATERIAL_LAYERS, PALETTE_STRIDE, createMaterialArrays, writePaletteLayer, loadMaterialMaps, } from "./material-arrays.js";
|
|
7
|
-
import { createMaterialBindGroup } from "./material-bind-group.js";
|
|
8
|
-
/** Material rows the builder reads to fill a layer (factors + map URLs). */
|
|
9
|
-
const MATERIAL_COMPONENTS = [
|
|
10
|
-
"baseColorFactor", "emissiveFactor", "metallicFactor", "roughnessFactor", "normalScale", "occlusionStrength",
|
|
11
|
-
"baseColorUrl", "metallicRoughnessUrl", "normalUrl", "occlusionUrl", "emissiveUrl",
|
|
12
|
-
];
|
|
13
|
-
/**
|
|
14
|
-
* materialGpu — derives the shared GPU material set from the `Material`
|
|
15
|
-
* registry. Each authored material is assigned one array layer; its factors go
|
|
16
|
-
* into the palette buffer and its maps are fetched + blitted into that layer.
|
|
17
|
-
*
|
|
18
|
-
* Incremental and cached: the arrays / palette / bind group are built once, and
|
|
19
|
-
* a layer is assigned only to a material that doesn't have one yet (`_layerIndex`
|
|
20
|
-
* excluded). Materials are added rarely and edited never, so steady state does
|
|
21
|
-
* no work. The renderer (P3) binds `_materialBindGroup` once and selects a
|
|
22
|
-
* material per instance by `_layerIndex`.
|
|
23
|
-
*/
|
|
24
|
-
export const materialGpu = Database.Plugin.create({
|
|
25
|
-
extends: Database.Plugin.combine(Material.plugin, core),
|
|
26
|
-
components: {
|
|
27
|
-
_layerIndex: U32.schema,
|
|
28
|
-
},
|
|
29
|
-
resources: {
|
|
30
|
-
_materialArrays: { default: null, nonPersistent: true },
|
|
31
|
-
_materialPalette: { default: null, nonPersistent: true },
|
|
32
|
-
_materialBindGroup: { default: null, nonPersistent: true },
|
|
33
|
-
},
|
|
34
|
-
systems: {
|
|
35
|
-
materialGpuBuilder: {
|
|
36
|
-
schedule: { during: ["preRender"] },
|
|
37
|
-
create: db => {
|
|
38
|
-
let arrays = null;
|
|
39
|
-
let palette = null;
|
|
40
|
-
let nextLayer = 0;
|
|
41
|
-
return () => {
|
|
42
|
-
const { device } = db.store.resources;
|
|
43
|
-
if (!device)
|
|
44
|
-
return;
|
|
45
|
-
// Assign a layer to each material that lacks one. Tail→head:
|
|
46
|
-
// every visited row migrates out (gains _layerIndex), so the
|
|
47
|
-
// removal is always from the tail — no hole-fill shift. The GPU
|
|
48
|
-
// arrays are created lazily on the first material, so glTF-only
|
|
49
|
-
// scenes (no materials) allocate nothing.
|
|
50
|
-
for (const arch of db.store.queryArchetypes(["name", ...MATERIAL_COMPONENTS], { exclude: ["_layerIndex"] })) {
|
|
51
|
-
const c = arch.columns;
|
|
52
|
-
for (let i = arch.rowCount - 1; i >= 0; i--) {
|
|
53
|
-
if (nextLayer >= MAX_MATERIAL_LAYERS)
|
|
54
|
-
break;
|
|
55
|
-
if (!arrays || !palette) {
|
|
56
|
-
arrays = createMaterialArrays(device);
|
|
57
|
-
palette = device.createBuffer({
|
|
58
|
-
size: MAX_MATERIAL_LAYERS * PALETTE_STRIDE,
|
|
59
|
-
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
|
|
60
|
-
});
|
|
61
|
-
db.store.resources._materialArrays = arrays;
|
|
62
|
-
db.store.resources._materialPalette = palette;
|
|
63
|
-
db.store.resources._materialBindGroup = createMaterialBindGroup(device, arrays, palette);
|
|
64
|
-
}
|
|
65
|
-
const id = c.id.get(i);
|
|
66
|
-
const layer = nextLayer++;
|
|
67
|
-
writePaletteLayer(device, palette, layer, {
|
|
68
|
-
baseColorFactor: c.baseColorFactor.get(i),
|
|
69
|
-
emissiveFactor: c.emissiveFactor.get(i),
|
|
70
|
-
metallicFactor: c.metallicFactor.get(i),
|
|
71
|
-
roughnessFactor: c.roughnessFactor.get(i),
|
|
72
|
-
normalScale: c.normalScale.get(i),
|
|
73
|
-
occlusionStrength: c.occlusionStrength.get(i),
|
|
74
|
-
});
|
|
75
|
-
loadMaterialMaps(device, arrays, layer, {
|
|
76
|
-
baseColorUrl: c.baseColorUrl.get(i),
|
|
77
|
-
metallicRoughnessUrl: c.metallicRoughnessUrl.get(i),
|
|
78
|
-
normalUrl: c.normalUrl.get(i),
|
|
79
|
-
occlusionUrl: c.occlusionUrl.get(i),
|
|
80
|
-
emissiveUrl: c.emissiveUrl.get(i),
|
|
81
|
-
});
|
|
82
|
-
db.store.update(id, { _layerIndex: layer });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=material-gpu-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-gpu-plugin.js","sourceRoot":"","sources":["../../../../src/graphics/rendering/material-gpu/material-gpu-plugin.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE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
* Materials come from the shared `materialGpu` set — five `texture_2d_array`s +
|
|
4
|
-
* a palette of per-layer factors (group 1) — selected by a per-instance layer
|
|
5
|
-
* index (group 3, binding 1). Shading is identical Cook-Torrance + split-sum
|
|
6
|
-
* IBL to the per-material `ibl-shader`; only the material *source* differs.
|
|
7
|
-
*/
|
|
8
|
-
export declare function buildPbrArrayShader(options: {
|
|
9
|
-
prefilteredMipCount: number;
|
|
10
|
-
}): string;
|