@babylonjs/inspector 9.30.0 → 9.31.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.
Files changed (71) hide show
  1. package/bin/inspector-bridge.mjs +4730 -4446
  2. package/bin/inspector-cli.mjs +4765 -3866
  3. package/lib/components/curveEditor/animatableAnimations.d.ts +27 -0
  4. package/lib/components/properties/nodes/gaussianSplattingProperties.d.ts +13 -2
  5. package/lib/{extensionsListService-DfE1ZOnF.js → extensionsListService-O8zrOnmL.js} +5 -2
  6. package/lib/{extensionsListService-DfE1ZOnF.js.map → extensionsListService-O8zrOnmL.js.map} +1 -1
  7. package/lib/gif-ut7hgn9U.js +45 -0
  8. package/lib/gif-ut7hgn9U.js.map +1 -0
  9. package/lib/{index-CZ1-Y-Rv.js → index-DbbhJJ1G.js} +321 -85
  10. package/lib/index-DbbhJJ1G.js.map +1 -0
  11. package/lib/index.js +4 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/lite/animationProperties-BKVw6_ls.js +95 -0
  14. package/lib/lite/animationProperties-BKVw6_ls.js.map +1 -0
  15. package/lib/lite/animationUtils.d.ts +47 -0
  16. package/lib/lite/components/properties/animationProperties.d.ts +48 -0
  17. package/lib/lite/directTextureBinding-C5MB2OV2.js +99 -0
  18. package/lib/lite/directTextureBinding-C5MB2OV2.js.map +1 -0
  19. package/lib/lite/dynamicMaterialField-L_nQAxAA.js +107 -0
  20. package/lib/lite/dynamicMaterialField-L_nQAxAA.js.map +1 -0
  21. package/lib/lite/engineExplorerService.d.ts +3 -1
  22. package/lib/lite/{extensionsListService-D1JivcAu.js → extensionsListService-Bl1rTNl1.js} +2 -2
  23. package/lib/lite/{extensionsListService-D1JivcAu.js.map → extensionsListService-Bl1rTNl1.js.map} +1 -1
  24. package/lib/lite/{index-D8vFySa7.js → index-Cy8gzpYG.js} +1453 -394
  25. package/lib/lite/index-Cy8gzpYG.js.map +1 -0
  26. package/lib/lite/index.js +1 -1
  27. package/lib/lite/nodeMaterialProperties-ELFMlzS1.js +182 -0
  28. package/lib/lite/nodeMaterialProperties-ELFMlzS1.js.map +1 -0
  29. package/lib/lite/pbrMaterialProperties-jfJddBxY.js +614 -0
  30. package/lib/lite/pbrMaterialProperties-jfJddBxY.js.map +1 -0
  31. package/lib/lite/services/panes/properties/animationPropertiesService.d.ts +5 -0
  32. package/lib/lite/services/panes/properties/materialPropertiesService.d.ts +3 -1
  33. package/lib/lite/services/panes/properties/materials/directTextureBinding.d.ts +29 -0
  34. package/lib/lite/services/panes/properties/materials/dynamicMaterialField.d.ts +35 -0
  35. package/lib/lite/services/panes/properties/materials/materialAdapterTypes.d.ts +11 -0
  36. package/lib/lite/services/panes/properties/materials/materialReachability.d.ts +9 -0
  37. package/lib/lite/services/panes/properties/materials/nodeMaterialProperties.d.ts +8 -0
  38. package/lib/lite/services/panes/properties/materials/pbrMaterialProperties.d.ts +8 -0
  39. package/lib/lite/services/panes/properties/materials/shaderMaterialProperties.d.ts +8 -0
  40. package/lib/lite/services/panes/properties/materials/standardMaterialProperties.d.ts +8 -0
  41. package/lib/lite/services/panes/properties/materials/useDirectMaterialOperations.d.ts +31 -0
  42. package/lib/lite/services/panes/properties/textureMetadataProperties.d.ts +14 -0
  43. package/lib/lite/services/panes/properties/texturePropertiesService.d.ts +3 -1
  44. package/lib/lite/services/panes/properties/useLatestAsyncOperation.d.ts +24 -0
  45. package/lib/lite/services/panes/scene/animationGroupExplorerService.d.ts +7 -0
  46. package/lib/lite/services/panes/scene/materialExplorerService.d.ts +2 -1
  47. package/lib/lite/services/panes/scene/materialTopologyBindings.d.ts +13 -0
  48. package/lib/lite/services/panes/scene/sceneResourceIndexService.d.ts +36 -0
  49. package/lib/lite/services/panes/scene/sceneResources.d.ts +55 -11
  50. package/lib/lite/services/panes/scene/textureExplorerService.d.ts +2 -1
  51. package/lib/lite/services/pickingService.d.ts +10 -0
  52. package/lib/lite/shaderMaterialProperties-CTH_KfBK.js +229 -0
  53. package/lib/lite/shaderMaterialProperties-CTH_KfBK.js.map +1 -0
  54. package/lib/lite/standardMaterialProperties-BbYdFX86.js +287 -0
  55. package/lib/lite/standardMaterialProperties-BbYdFX86.js.map +1 -0
  56. package/lib/lite/textureMetadataProperties-BdNmp0Pk.js +221 -0
  57. package/lib/lite/textureMetadataProperties-BdNmp0Pk.js.map +1 -0
  58. package/lib/lite/useDirectMaterialOperations-D6V7OtC1.js +83 -0
  59. package/lib/lite/useDirectMaterialOperations-D6V7OtC1.js.map +1 -0
  60. package/lib/lite/useLatestAsyncOperation-k59AgA3B.js +78 -0
  61. package/lib/lite/useLatestAsyncOperation-k59AgA3B.js.map +1 -0
  62. package/lib/{quickCreateToolsService-owfaw163.js → quickCreateToolsService-Cs46Amv7.js} +5 -2
  63. package/lib/{quickCreateToolsService-owfaw163.js.map → quickCreateToolsService-Cs46Amv7.js.map} +1 -1
  64. package/lib/{reflectorService-oIAxxpQt.js → reflectorService-C43FgOiC.js} +5 -2
  65. package/lib/{reflectorService-oIAxxpQt.js.map → reflectorService-C43FgOiC.js.map} +1 -1
  66. package/lib/services/panes/properties/gaussianSplattingDebugController.d.ts +46 -0
  67. package/package.json +8 -8
  68. package/lib/gif-5DieAkSF.js +0 -38
  69. package/lib/gif-5DieAkSF.js.map +0 -1
  70. package/lib/index-CZ1-Y-Rv.js.map +0 -1
  71. package/lib/lite/index-D8vFySa7.js.map +0 -1
@@ -1,13 +1,57 @@
1
- import { type Material, type SceneContext, type Texture2D } from "@babylonjs/lite";
1
+ import { type EngineContext, type Material, type SceneContext, type TextureMetadata } from "@babylonjs/lite";
2
+ import { type IMaterialTopologyBinding } from "./materialTopologyBindings";
3
+ /** A source material reachable from one or more scenes in an inspected Lite engine. @internal */
4
+ export interface IMaterialResourceRecord {
5
+ readonly source: Material;
6
+ readonly family: string | undefined;
7
+ readonly displayName: string;
8
+ readonly scenes: readonly SceneContext[];
9
+ readonly bindings: readonly IMaterialTopologyBinding[];
10
+ }
11
+ /** One canonical binding on a source material or MaterialView that consumes a texture wrapper. @internal */
12
+ export interface ITextureConsumerRecord {
13
+ readonly material: Material;
14
+ readonly bindingId: string;
15
+ }
16
+ /** A texture wrapper reachable from one or more indexed material bindings. @internal */
17
+ export interface ITextureResourceRecord {
18
+ readonly entity: object;
19
+ readonly metadata: TextureMetadata;
20
+ readonly ordinal: number;
21
+ readonly consumers: readonly ITextureConsumerRecord[];
22
+ }
23
+ /** Material and texture resources reachable from one Lite scene. @internal */
24
+ export interface ISceneResourceSnapshot {
25
+ readonly scene: SceneContext;
26
+ readonly materials: readonly IMaterialResourceRecord[];
27
+ readonly textures: readonly ITextureResourceRecord[];
28
+ }
29
+ /** A public-state snapshot used to detect resource topology changes. @internal */
30
+ export type SceneResourceTopologySnapshot = readonly unknown[];
2
31
  /**
3
- * Gets the unique materials referenced by a scene's meshes.
4
- * @param scene The scene to inspect.
5
- * @returns The referenced materials in mesh order.
32
+ * Maintains deterministic, Inspector-owned resource records for one Lite engine.
33
+ * @internal
6
34
  */
7
- export declare function GetSceneMaterials(scene: SceneContext): readonly Material[];
8
- /**
9
- * Gets the unique textures referenced by a scene's materials.
10
- * @param scene The scene to inspect.
11
- * @returns The referenced textures in material order.
12
- */
13
- export declare function GetSceneTextures(scene: SceneContext): readonly Texture2D[];
35
+ export declare class SceneResourceIndex {
36
+ private readonly _engine;
37
+ private _sceneSnapshots;
38
+ private _materialRecords;
39
+ private _textureRecords;
40
+ private _textureOrdinals;
41
+ private _nextTextureOrdinal;
42
+ constructor(_engine: EngineContext);
43
+ /** Rebuilds the resource topology from current public scene and binding state. */
44
+ refresh(): void;
45
+ /**
46
+ * Captures the public identities and values that drive index and Properties refresh.
47
+ * @returns A deterministic topology snapshot.
48
+ */
49
+ getTopologySnapshot(): SceneResourceTopologySnapshot;
50
+ static AreTopologySnapshotsEqual(left: SceneResourceTopologySnapshot, right: SceneResourceTopologySnapshot): boolean;
51
+ getSceneSnapshot(scene: SceneContext): ISceneResourceSnapshot;
52
+ getMaterialRecord(material: Material): IMaterialResourceRecord | undefined;
53
+ getTextureRecord(texture: object): ITextureResourceRecord | undefined;
54
+ dispose(): void;
55
+ private _getTextureOrdinal;
56
+ private _getScenes;
57
+ }
@@ -1,3 +1,4 @@
1
1
  import { type ServiceDefinition } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceDefinition.js";
2
2
  import { type IEngineExplorerService } from "../../../engineExplorerService";
3
- export declare const TextureExplorerServiceDefinition: ServiceDefinition<[], [IEngineExplorerService]>;
3
+ import { type ISceneResourceIndexService } from "./sceneResourceIndexService";
4
+ export declare const TextureExplorerServiceDefinition: ServiceDefinition<[], [IEngineExplorerService, ISceneResourceIndexService]>;
@@ -0,0 +1,10 @@
1
+ import { type ServiceDefinition } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceDefinition.js";
2
+ import { type IShellService } from "@babylonjs/shared-ui-components/modularTool/services/shellService.js";
3
+ import { type ISelectionService } from "../../services/selectionService";
4
+ import { type IWatcherService } from "../../services/watcherService";
5
+ import { type IEngineContext } from "../engineContext";
6
+ /**
7
+ * Adds opt-in mesh picking to the canvases hosting Babylon Lite scenes.
8
+ * Picking uses CSS canvas coordinates and updates the shared Inspector selection.
9
+ */
10
+ export declare const PickingServiceDefinition: ServiceDefinition<[], [IEngineContext, IShellService, ISelectionService, IWatcherService]>;
@@ -0,0 +1,229 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { getMaterialSource, getMaterialFamily, isMaterialView, getShaderUniform, getShaderTexture, getTextureMetadata, setShaderTexture, setShaderUniform } from '@babylonjs/lite';
3
+ import { Body1 } from '@fluentui/react-components';
4
+ import { useCallback } from 'react';
5
+ import { o as useObservableState, T as TextPropertyLine, C as ComputedProperty, b as useWatchedValue, D as DerivedProperty, k as TextInputPropertyLine } from './index-Cy8gzpYG.js';
6
+ import { D as DirectTextureBinding } from './directTextureBinding-C5MB2OV2.js';
7
+ import { D as DynamicMaterialField, V as ValidateDynamicValue } from './dynamicMaterialField-L_nQAxAA.js';
8
+ import { u as useDirectMaterialOperations } from './useDirectMaterialOperations-D6V7OtC1.js';
9
+ import '@babylonjs/core/Misc/observable.js';
10
+ import '@fluentui/react-icons';
11
+ import '@babylonjs/core/Misc/dataStorage.js';
12
+ import '@babylonjs/core/Misc/asyncLock.js';
13
+ import '@babylonjs/core/Misc/deferred.js';
14
+ import '@fluentui-contrib/react-resize-handle';
15
+ import '@fluentui/react-motion-components-preview';
16
+ import '@babylonjs/core/Misc/logger.js';
17
+ import 'react-dom/client';
18
+ import '@fluentui-contrib/react-virtualizer';
19
+ import '@babylonjs/core/Misc/uniqueIdGenerator.js';
20
+ import '@babylonjs/core/Maths/math.color.js';
21
+ import '@babylonjs/core/Maths/math.vector.js';
22
+ import './useLatestAsyncOperation-k59AgA3B.js';
23
+
24
+ const SystemUniforms = new Set(["world", "view", "projection", "viewProjection", "worldView", "worldViewProjection", "cameraPosition", "screenSize", "alphaCutoff"]);
25
+ function ReadName(target) {
26
+ try {
27
+ const name = target.name;
28
+ return name === undefined ? "" : typeof name === "string" ? name : undefined;
29
+ }
30
+ catch {
31
+ return undefined;
32
+ }
33
+ }
34
+ const ShaderGeneral = (props) => {
35
+ const { material, resourceIndexService, selectionService } = props;
36
+ const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);
37
+ const name = useWatchedValue(material, ReadName);
38
+ if (!record) {
39
+ return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
40
+ }
41
+ const family = getMaterialFamily(source);
42
+ const pending = operations["material.name"]?.pending;
43
+ const error = operations["material.name"]?.error;
44
+ return (jsxs(Fragment, { children: [jsxs("div", { "aria-busy": pending, children: [name === undefined ? (jsx(ComputedProperty, { component: TextPropertyLine, target: material, getValue: () => "Unavailable: Material name is not a string or cannot be read.", label: "Name", uniqueId: "material.name" })) : (jsx(DerivedProperty, { component: TextInputPropertyLine, target: material, getValue: ReadName, setValue: (target, next) => commit({
45
+ id: "material.name",
46
+ oldValue: ReadName(target),
47
+ newValue: next,
48
+ invalidate: "owned",
49
+ apply: () => {
50
+ target.name = next;
51
+ },
52
+ }), label: "Name", uniqueId: "material.name", disabled: pending, description: error ? `Error: ${error}` : undefined })), pending ? jsx(Body1, { role: "status", children: "Applying Name\u2026" }) : undefined, error ? jsx(Body1, { role: "alert", children: error }) : undefined] }), jsx(TextPropertyLine, { label: "Family", value: family ?? "shader" }), jsx(TextPropertyLine, { label: "Selection", value: isMaterialView(material) ? "MaterialView" : "Material" }), isMaterialView(material) ? jsx(TextPropertyLine, { label: "Source", value: record.displayName }) : undefined] }));
53
+ };
54
+ function FieldType(type) {
55
+ switch (type) {
56
+ case "f32":
57
+ case "u32":
58
+ case "i32":
59
+ return "number";
60
+ case "vec2<f32>":
61
+ return "vec2";
62
+ case "vec3<f32>":
63
+ return "vec3";
64
+ case "vec4<f32>":
65
+ return "vec4";
66
+ case "mat4x4<f32>":
67
+ return "mat4";
68
+ }
69
+ }
70
+ function ValueLength(type) {
71
+ switch (type) {
72
+ case "f32":
73
+ case "u32":
74
+ case "i32":
75
+ return 1;
76
+ case "vec2<f32>":
77
+ return 2;
78
+ case "vec3<f32>":
79
+ return 3;
80
+ case "vec4<f32>":
81
+ return 4;
82
+ case "mat4x4<f32>":
83
+ return 16;
84
+ }
85
+ }
86
+ const ShaderUniformField = (props) => {
87
+ const { material, declaration, resourceIndexService, selectionService } = props;
88
+ const shader = getMaterialSource(material);
89
+ const { operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);
90
+ const { name, type } = declaration;
91
+ const id = `shader.uniform:${name}`;
92
+ const read = useCallback(() => {
93
+ const current = shader.uniformDecls.find((candidate) => candidate.name === name && !SystemUniforms.has(candidate.name));
94
+ if (!current || current.type !== type) {
95
+ return undefined;
96
+ }
97
+ const value = getShaderUniform(shader, name);
98
+ return typeof value === "number" ? value : Array.from(value);
99
+ }, [shader, name, type]);
100
+ const write = (value) => {
101
+ let oldValue;
102
+ try {
103
+ oldValue = read();
104
+ }
105
+ catch {
106
+ // A stale or unreadable declaration is reported by the guarded apply below.
107
+ }
108
+ const newValue = typeof value === "number" ? value : [...value];
109
+ commit({
110
+ id,
111
+ propertyKey: name,
112
+ oldValue,
113
+ newValue,
114
+ invalidate: "owned",
115
+ apply: () => {
116
+ const current = shader.uniformDecls.find((candidate) => candidate.name === name && !SystemUniforms.has(candidate.name));
117
+ if (!current || current.type !== type) {
118
+ throw new Error(`Property "${id}" is stale, read-only, or unsupported for a Shader material.`);
119
+ }
120
+ const next = ValidateDynamicValue(id, newValue, ValueLength(type), type === "i32" || type === "u32", type === "u32" ? 0 : type === "i32" ? -2147483648 : undefined, type === "u32" ? 0xffffffff : type === "i32" ? 0x7fffffff : undefined);
121
+ setShaderUniform(shader, name, next);
122
+ },
123
+ });
124
+ };
125
+ return (jsx(DynamicMaterialField, { target: shader, id: id, label: name, type: FieldType(type), read: read, write: write, unavailable: `Shader uniform "${name}" has no readable ${type} value.`, integer: type === "u32" || type === "i32", min: type === "u32" ? 0 : type === "i32" ? -2147483648 : undefined, max: type === "u32" ? 0xffffffff : type === "i32" ? 0x7fffffff : undefined, pending: operations[id]?.pending, error: operations[id]?.error }));
126
+ };
127
+ const ShaderSamplerField = (props) => {
128
+ const { material, declaration, resourceIndexService, selectionService } = props;
129
+ const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);
130
+ const shader = source;
131
+ const { name } = declaration;
132
+ const id = `shader.sampler:${name}`;
133
+ const expectedKind = declaration.viewDimension === "2d-array" ? "2d-array" : "2d";
134
+ const expectedSample = declaration.comparison || declaration.sampleType === "depth" ? "depth" : "float";
135
+ let texture;
136
+ try {
137
+ texture = getShaderTexture(shader, name);
138
+ }
139
+ catch {
140
+ return jsx(TextPropertyLine, { label: name, value: `Unavailable: Shader sampler "${name}" is unreadable.` });
141
+ }
142
+ if (!record) {
143
+ return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
144
+ }
145
+ return (jsx(DirectTextureBinding, { record: record, resourceIndexService: resourceIndexService, selectionService: selectionService, operations: operations, commit: commit, id: id, label: name, value: texture, read: () => getShaderTexture(shader, name), acceptedKinds: [expectedKind], sampleCategory: expectedSample, invalidate: "owned", apply: (nextTexture) => {
146
+ const current = shader.samplerDecls.find((candidate) => candidate.name === name);
147
+ if (!current ||
148
+ current.viewDimension !== declaration.viewDimension ||
149
+ current.sampleType !== declaration.sampleType ||
150
+ current.comparison !== declaration.comparison) {
151
+ throw new Error(`Texture binding "${id}" is stale or unsupported for a Shader material.`);
152
+ }
153
+ if (nextTexture) {
154
+ const metadata = getTextureMetadata(nextTexture);
155
+ const sampleType = metadata?.sampleType;
156
+ const compatible = expectedSample === "depth" ? sampleType === "depth" : sampleType === undefined || sampleType === "float" || sampleType === "unfilterable-float";
157
+ if (metadata?.kind !== expectedKind || !compatible) {
158
+ throw new TypeError(`Texture binding "${id}" requires a ${expectedSample} ${expectedKind} texture.`);
159
+ }
160
+ }
161
+ setShaderTexture(shader, name, nextTexture);
162
+ } }));
163
+ };
164
+ function SummarizeBlendComponent(component) {
165
+ return `${component.srcFactor ?? "one"}, ${component.dstFactor ?? "zero"}, ${component.operation ?? "add"}`;
166
+ }
167
+ function SummarizeConfiguration(material) {
168
+ const attributes = material.attributes.length > 0 ? material.attributes.join(", ") : "none";
169
+ const defines = material.defines.length > 0 ? material.defines.map((define) => `${define.name}=${String(define.value)}`).join(", ") : "none";
170
+ const storageBuffers = material.storageBufferDecls.length > 0 ? material.storageBufferDecls.map((declaration) => `${declaration.name}: ${declaration.type}`).join(", ") : "none";
171
+ const blend = material.blend
172
+ ? `custom color(${SummarizeBlendComponent(material.blend.color)}) alpha(${SummarizeBlendComponent(material.blend.alpha)})`
173
+ : material.needAlphaBlending
174
+ ? material.blendMode
175
+ : "disabled";
176
+ return [
177
+ `Attributes: ${attributes}`,
178
+ `Defines: ${defines}`,
179
+ `Blend: ${blend}`,
180
+ `Transmissive: ${String(material.transmissive)}`,
181
+ `Alpha testing: ${String(material.needAlphaTesting)}`,
182
+ `Back-face culling: ${String(material.backFaceCulling)}`,
183
+ `Depth write: ${String(material.depthWrite)}`,
184
+ `Depth compare: ${material.depthCompare}`,
185
+ `Depth-only fragment: ${String(material.depthOnlyFragment)}`,
186
+ `Depth bias: ${String(material.depthBias)}`,
187
+ `Depth bias slope scale: ${String(material.depthBiasSlopeScale)}`,
188
+ "Topology: unavailable",
189
+ `Storage buffers: ${storageBuffers}`,
190
+ ].join("; ");
191
+ }
192
+ /**
193
+ * Displays Shader material properties, sampler bindings, and configuration directly.
194
+ * @param props The selected material section and instance services.
195
+ * @returns Shader material property content.
196
+ */
197
+ const ShaderMaterialAdapter = (props) => {
198
+ const { material, section, resourceIndexService } = props;
199
+ const shader = getMaterialSource(material);
200
+ const getDeclarations = useCallback(() => shader.uniformDecls.filter((declaration) => !SystemUniforms.has(declaration.name)), [shader]);
201
+ const declarations = useObservableState(getDeclarations, resourceIndexService.onChanged);
202
+ const getSamplers = useCallback(() => shader.samplerDecls, [shader]);
203
+ const samplers = useObservableState(getSamplers, resourceIndexService.onChanged);
204
+ if (section === "general") {
205
+ return jsx(ShaderGeneral, { ...props });
206
+ }
207
+ if (section === "inputs") {
208
+ if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {
209
+ return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
210
+ }
211
+ return (jsx(Fragment, { children: declarations.map((declaration) => (jsx(ShaderUniformField, { ...props, declaration: declaration }, declaration.name))) }));
212
+ }
213
+ if (section === "configuration") {
214
+ if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {
215
+ return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
216
+ }
217
+ return jsx(ComputedProperty, { component: TextPropertyLine, target: shader, getValue: SummarizeConfiguration, label: "Configuration" });
218
+ }
219
+ if (section === "textures") {
220
+ if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {
221
+ return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
222
+ }
223
+ return (jsx(Fragment, { children: samplers.map((declaration) => (jsx(ShaderSamplerField, { ...props, declaration: declaration }, declaration.name))) }));
224
+ }
225
+ return null;
226
+ };
227
+
228
+ export { ShaderMaterialAdapter };
229
+ //# sourceMappingURL=shaderMaterialProperties-CTH_KfBK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shaderMaterialProperties-CTH_KfBK.js","sources":["../../../../../../../../../../dev/inspector-v2/src/lite/services/panes/properties/materials/shaderMaterialProperties.tsx"],"sourcesContent":["import {\n getMaterialFamily,\n getMaterialSource,\n getShaderTexture,\n getShaderUniform,\n getTextureMetadata,\n setShaderTexture,\n setShaderUniform,\n isMaterialView,\n type ShaderMaterial,\n type ShaderSamplerDecl,\n type ShaderUniformDecl,\n type ShaderUniformType,\n type Texture2D,\n} from \"@babylonjs/lite\";\nimport { Body1 } from \"@fluentui/react-components\";\nimport { type FunctionComponent, useCallback } from \"react\";\n\nimport { TextInputPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/inputPropertyLine\";\nimport { TextPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/textPropertyLine\";\nimport { useObservableState } from \"shared-ui-components/modularTool/hooks/observableHooks\";\n\nimport { ComputedProperty, DerivedProperty } from \"../../../../../components/properties/boundProperty\";\nimport { useWatchedValue } from \"../../../../../contexts/watcherContext\";\nimport { DirectTextureBinding } from \"./directTextureBinding\";\nimport { DynamicMaterialField, ValidateDynamicValue, type DynamicFieldType, type DynamicFieldValue } from \"./dynamicMaterialField\";\nimport { type MaterialAdapterProps } from \"./materialAdapterTypes\";\nimport { useDirectMaterialOperations } from \"./useDirectMaterialOperations\";\n\nconst SystemUniforms = new Set([\"world\", \"view\", \"projection\", \"viewProjection\", \"worldView\", \"worldViewProjection\", \"cameraPosition\", \"screenSize\", \"alphaCutoff\"]);\n\nfunction ReadName(target: object): string | undefined {\n try {\n const name = (target as { name?: unknown }).name;\n return name === undefined ? \"\" : typeof name === \"string\" ? name : undefined;\n } catch {\n return undefined;\n }\n}\n\nconst ShaderGeneral: FunctionComponent<MaterialAdapterProps> = (props) => {\n const { material, resourceIndexService, selectionService } = props;\n const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);\n const name = useWatchedValue(material, ReadName);\n if (!record) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n const family = getMaterialFamily(source);\n const pending = operations[\"material.name\"]?.pending;\n const error = operations[\"material.name\"]?.error;\n return (\n <>\n <div aria-busy={pending}>\n {name === undefined ? (\n <ComputedProperty\n component={TextPropertyLine}\n target={material}\n getValue={() => \"Unavailable: Material name is not a string or cannot be read.\"}\n label=\"Name\"\n uniqueId=\"material.name\"\n />\n ) : (\n <DerivedProperty\n component={TextInputPropertyLine}\n target={material}\n getValue={ReadName as () => string}\n setValue={(target, next) =>\n commit({\n id: \"material.name\",\n oldValue: ReadName(target),\n newValue: next,\n invalidate: \"owned\",\n apply: () => {\n (target as { name?: string }).name = next;\n },\n })\n }\n label=\"Name\"\n uniqueId=\"material.name\"\n disabled={pending}\n description={error ? `Error: ${error}` : undefined}\n />\n )}\n {pending ? <Body1 role=\"status\">Applying Name…</Body1> : undefined}\n {error ? <Body1 role=\"alert\">{error}</Body1> : undefined}\n </div>\n <TextPropertyLine label=\"Family\" value={family ?? \"shader\"} />\n <TextPropertyLine label=\"Selection\" value={isMaterialView(material) ? \"MaterialView\" : \"Material\"} />\n {isMaterialView(material) ? <TextPropertyLine label=\"Source\" value={record.displayName} /> : undefined}\n </>\n );\n};\n\nfunction FieldType(type: ShaderUniformType): DynamicFieldType {\n switch (type) {\n case \"f32\":\n case \"u32\":\n case \"i32\":\n return \"number\";\n case \"vec2<f32>\":\n return \"vec2\";\n case \"vec3<f32>\":\n return \"vec3\";\n case \"vec4<f32>\":\n return \"vec4\";\n case \"mat4x4<f32>\":\n return \"mat4\";\n }\n}\n\nfunction ValueLength(type: ShaderUniformType): number {\n switch (type) {\n case \"f32\":\n case \"u32\":\n case \"i32\":\n return 1;\n case \"vec2<f32>\":\n return 2;\n case \"vec3<f32>\":\n return 3;\n case \"vec4<f32>\":\n return 4;\n case \"mat4x4<f32>\":\n return 16;\n }\n}\n\nconst ShaderUniformField: FunctionComponent<MaterialAdapterProps & { declaration: ShaderUniformDecl }> = (props) => {\n const { material, declaration, resourceIndexService, selectionService } = props;\n const shader = getMaterialSource(material) as ShaderMaterial;\n const { operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);\n const { name, type } = declaration;\n const id = `shader.uniform:${name}`;\n const read = useCallback((): DynamicFieldValue | undefined => {\n const current = shader.uniformDecls.find((candidate) => candidate.name === name && !SystemUniforms.has(candidate.name));\n if (!current || current.type !== type) {\n return undefined;\n }\n const value = getShaderUniform(shader, name);\n return typeof value === \"number\" ? value : Array.from(value);\n }, [shader, name, type]);\n const write = (value: DynamicFieldValue) => {\n let oldValue: DynamicFieldValue | undefined;\n try {\n oldValue = read();\n } catch {\n // A stale or unreadable declaration is reported by the guarded apply below.\n }\n const newValue = typeof value === \"number\" ? value : [...value];\n commit({\n id,\n propertyKey: name,\n oldValue,\n newValue,\n invalidate: \"owned\",\n apply: () => {\n const current = shader.uniformDecls.find((candidate) => candidate.name === name && !SystemUniforms.has(candidate.name));\n if (!current || current.type !== type) {\n throw new Error(`Property \"${id}\" is stale, read-only, or unsupported for a Shader material.`);\n }\n const next = ValidateDynamicValue(\n id,\n newValue,\n ValueLength(type),\n type === \"i32\" || type === \"u32\",\n type === \"u32\" ? 0 : type === \"i32\" ? -0x80000000 : undefined,\n type === \"u32\" ? 0xffffffff : type === \"i32\" ? 0x7fffffff : undefined\n );\n setShaderUniform(shader, name, next);\n },\n });\n };\n return (\n <DynamicMaterialField\n target={shader}\n id={id}\n label={name}\n type={FieldType(type)}\n read={read}\n write={write}\n unavailable={`Shader uniform \"${name}\" has no readable ${type} value.`}\n integer={type === \"u32\" || type === \"i32\"}\n min={type === \"u32\" ? 0 : type === \"i32\" ? -0x80000000 : undefined}\n max={type === \"u32\" ? 0xffffffff : type === \"i32\" ? 0x7fffffff : undefined}\n pending={operations[id]?.pending}\n error={operations[id]?.error}\n />\n );\n};\n\nconst ShaderSamplerField: FunctionComponent<MaterialAdapterProps & { declaration: ShaderSamplerDecl }> = (props) => {\n const { material, declaration, resourceIndexService, selectionService } = props;\n const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);\n const shader = source as ShaderMaterial;\n const { name } = declaration;\n const id = `shader.sampler:${name}`;\n const expectedKind = declaration.viewDimension === \"2d-array\" ? \"2d-array\" : \"2d\";\n const expectedSample = declaration.comparison || declaration.sampleType === \"depth\" ? \"depth\" : \"float\";\n let texture: Texture2D | null;\n try {\n texture = getShaderTexture(shader, name);\n } catch {\n return <TextPropertyLine label={name} value={`Unavailable: Shader sampler \"${name}\" is unreadable.`} />;\n }\n if (!record) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n return (\n <DirectTextureBinding\n record={record}\n resourceIndexService={resourceIndexService}\n selectionService={selectionService}\n operations={operations}\n commit={commit}\n id={id}\n label={name}\n value={texture}\n read={() => getShaderTexture(shader, name)}\n acceptedKinds={[expectedKind]}\n sampleCategory={expectedSample}\n invalidate=\"owned\"\n apply={(nextTexture) => {\n const current = shader.samplerDecls.find((candidate) => candidate.name === name);\n if (\n !current ||\n current.viewDimension !== declaration.viewDimension ||\n current.sampleType !== declaration.sampleType ||\n current.comparison !== declaration.comparison\n ) {\n throw new Error(`Texture binding \"${id}\" is stale or unsupported for a Shader material.`);\n }\n if (nextTexture) {\n const metadata = getTextureMetadata(nextTexture);\n const sampleType = metadata?.sampleType;\n const compatible =\n expectedSample === \"depth\" ? sampleType === \"depth\" : sampleType === undefined || sampleType === \"float\" || sampleType === \"unfilterable-float\";\n if (metadata?.kind !== expectedKind || !compatible) {\n throw new TypeError(`Texture binding \"${id}\" requires a ${expectedSample} ${expectedKind} texture.`);\n }\n }\n setShaderTexture(shader, name, nextTexture as Texture2D | null);\n }}\n />\n );\n};\n\nfunction SummarizeBlendComponent(component: GPUBlendComponent): string {\n return `${component.srcFactor ?? \"one\"}, ${component.dstFactor ?? \"zero\"}, ${component.operation ?? \"add\"}`;\n}\n\nfunction SummarizeConfiguration(material: ShaderMaterial): string {\n const attributes = material.attributes.length > 0 ? material.attributes.join(\", \") : \"none\";\n const defines = material.defines.length > 0 ? material.defines.map((define) => `${define.name}=${String(define.value)}`).join(\", \") : \"none\";\n const storageBuffers =\n material.storageBufferDecls.length > 0 ? material.storageBufferDecls.map((declaration) => `${declaration.name}: ${declaration.type}`).join(\", \") : \"none\";\n const blend = material.blend\n ? `custom color(${SummarizeBlendComponent(material.blend.color)}) alpha(${SummarizeBlendComponent(material.blend.alpha)})`\n : material.needAlphaBlending\n ? material.blendMode\n : \"disabled\";\n return [\n `Attributes: ${attributes}`,\n `Defines: ${defines}`,\n `Blend: ${blend}`,\n `Transmissive: ${String(material.transmissive)}`,\n `Alpha testing: ${String(material.needAlphaTesting)}`,\n `Back-face culling: ${String(material.backFaceCulling)}`,\n `Depth write: ${String(material.depthWrite)}`,\n `Depth compare: ${material.depthCompare}`,\n `Depth-only fragment: ${String(material.depthOnlyFragment)}`,\n `Depth bias: ${String(material.depthBias)}`,\n `Depth bias slope scale: ${String(material.depthBiasSlopeScale)}`,\n \"Topology: unavailable\",\n `Storage buffers: ${storageBuffers}`,\n ].join(\"; \");\n}\n\n/**\n * Displays Shader material properties, sampler bindings, and configuration directly.\n * @param props The selected material section and instance services.\n * @returns Shader material property content.\n */\nexport const ShaderMaterialAdapter: FunctionComponent<MaterialAdapterProps> = (props) => {\n const { material, section, resourceIndexService } = props;\n const shader = getMaterialSource(material) as ShaderMaterial;\n const getDeclarations = useCallback(() => shader.uniformDecls.filter((declaration) => !SystemUniforms.has(declaration.name)), [shader]);\n const declarations = useObservableState(getDeclarations, resourceIndexService.onChanged);\n const getSamplers = useCallback(() => shader.samplerDecls, [shader]);\n const samplers = useObservableState(getSamplers, resourceIndexService.onChanged);\n if (section === \"general\") {\n return <ShaderGeneral {...props} />;\n }\n if (section === \"inputs\") {\n if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n return (\n <>\n {declarations.map((declaration) => (\n <ShaderUniformField key={declaration.name} {...props} declaration={declaration} />\n ))}\n </>\n );\n }\n if (section === \"configuration\") {\n if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n return <ComputedProperty component={TextPropertyLine} target={shader} getValue={SummarizeConfiguration} label=\"Configuration\" />;\n }\n if (section === \"textures\") {\n if (!resourceIndexService.getMaterialRecord(getMaterialSource(material))) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n return (\n <>\n {samplers.map((declaration) => (\n <ShaderSamplerField key={declaration.name} {...props} declaration={declaration} />\n ))}\n </>\n );\n }\n return null;\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAEpK,SAAS,QAAQ,CAAC,MAAc,EAAA;AAC5B,IAAA,IAAI;AACA,QAAA,MAAM,IAAI,GAAI,MAA6B,CAAC,IAAI;QAChD,OAAO,IAAI,KAAK,SAAS,GAAG,EAAE,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,SAAS;IAChF;AAAE,IAAA,MAAM;AACJ,QAAA,OAAO,SAAS;IACpB;AACJ;AAEA,MAAM,aAAa,GAA4C,CAAC,KAAK,KAAI;IACrE,MAAM,EAAE,QA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