@babylonjs/inspector 8.45.1-preview → 8.45.2-preview
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/lib/{captureService-BljpAUY0.js → captureService-BDZ64ZKE.js} +3 -5
- package/lib/{captureService-BljpAUY0.js.map → captureService-BDZ64ZKE.js.map} +1 -1
- package/lib/{exportService-Ds9cCJKY.js → exportService-CnPFMXUA.js} +3 -5
- package/lib/{exportService-Ds9cCJKY.js.map → exportService-CnPFMXUA.js.map} +1 -1
- package/lib/{extensionsListService-ClfCMwL9.js → extensionsListService-CN7-7Dna.js} +3 -5
- package/lib/{extensionsListService-ClfCMwL9.js.map → extensionsListService-CN7-7Dna.js.map} +1 -1
- package/lib/{importService-DjRpoPdx.js → importService-e9XEtGfl.js} +3 -5
- package/lib/{importService-DjRpoPdx.js.map → importService-e9XEtGfl.js.map} +1 -1
- package/lib/{index-DShP7wwE.js → index-D450kD0o.js} +280 -149
- package/lib/index-D450kD0o.js.map +1 -0
- package/lib/index.d.ts +145 -4
- package/lib/index.js +2 -4
- package/lib/index.js.map +1 -1
- package/lib/{quickCreateToolsService-B1GLLyqj.js → quickCreateToolsService-gqXZXpNH.js} +3 -4
- package/lib/{quickCreateToolsService-B1GLLyqj.js.map → quickCreateToolsService-gqXZXpNH.js.map} +1 -1
- package/package.json +1 -1
- package/lib/index-DShP7wwE.js.map +0 -1
|
@@ -64,15 +64,13 @@ import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js';
|
|
|
64
64
|
import { Material } from '@babylonjs/core/Materials/material.js';
|
|
65
65
|
import { MultiMaterial } from '@babylonjs/core/Materials/multiMaterial.js';
|
|
66
66
|
import { PBRBaseMaterial } from '@babylonjs/core/Materials/PBR/pbrBaseMaterial.js';
|
|
67
|
-
import { PBRBaseSimpleMaterial } from '@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js';
|
|
68
|
-
import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial.js';
|
|
69
67
|
import { OpenPBRMaterial } from '@babylonjs/core/Materials/PBR/openpbrMaterial.js';
|
|
70
68
|
import { SkyMaterial } from '@babylonjs/materials/sky/skyMaterial.js';
|
|
71
69
|
import { Constants } from '@babylonjs/core/Engines/constants.js';
|
|
72
70
|
import { Engine } from '@babylonjs/core/Engines/engine.js';
|
|
73
71
|
import { ParticleSystem } from '@babylonjs/core/Particles/particleSystem.js';
|
|
74
|
-
import { ReadFile } from '@babylonjs/core/Misc/fileTools.js';
|
|
75
72
|
import { CubeTexture } from '@babylonjs/core/Materials/Textures/cubeTexture.js';
|
|
73
|
+
import { ReadFile } from '@babylonjs/core/Misc/fileTools.js';
|
|
76
74
|
import { Mesh } from '@babylonjs/core/Meshes/mesh.js';
|
|
77
75
|
import { SkeletonViewer } from '@babylonjs/core/Debug/skeletonViewer.js';
|
|
78
76
|
import { VertexBuffer } from '@babylonjs/core/Meshes/buffer.js';
|
|
@@ -3839,7 +3837,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
|
|
|
3839
3837
|
keywords: ["export", "gltf", "glb", "babylon", "exporter", "tools"],
|
|
3840
3838
|
...BabylonWebResources,
|
|
3841
3839
|
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
|
|
3842
|
-
getExtensionModuleAsync: async () => await import('./exportService-
|
|
3840
|
+
getExtensionModuleAsync: async () => await import('./exportService-CnPFMXUA.js'),
|
|
3843
3841
|
},
|
|
3844
3842
|
{
|
|
3845
3843
|
name: "Capture Tools",
|
|
@@ -3847,7 +3845,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
|
|
|
3847
3845
|
keywords: ["capture", "screenshot", "gif", "video", "tools"],
|
|
3848
3846
|
...BabylonWebResources,
|
|
3849
3847
|
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
|
|
3850
|
-
getExtensionModuleAsync: async () => await import('./captureService-
|
|
3848
|
+
getExtensionModuleAsync: async () => await import('./captureService-BDZ64ZKE.js'),
|
|
3851
3849
|
},
|
|
3852
3850
|
{
|
|
3853
3851
|
name: "Import Tools",
|
|
@@ -3855,7 +3853,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
|
|
|
3855
3853
|
keywords: ["import", "tools"],
|
|
3856
3854
|
...BabylonWebResources,
|
|
3857
3855
|
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
|
|
3858
|
-
getExtensionModuleAsync: async () => await import('./importService-
|
|
3856
|
+
getExtensionModuleAsync: async () => await import('./importService-e9XEtGfl.js'),
|
|
3859
3857
|
},
|
|
3860
3858
|
{
|
|
3861
3859
|
name: "Quick Creation Tools (Preview)",
|
|
@@ -3863,7 +3861,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
|
|
|
3863
3861
|
keywords: ["creation", "tools"],
|
|
3864
3862
|
...BabylonWebResources,
|
|
3865
3863
|
author: { name: "Babylon.js", forumUserName: "" },
|
|
3866
|
-
getExtensionModuleAsync: async () => await import('./quickCreateToolsService-
|
|
3864
|
+
getExtensionModuleAsync: async () => await import('./quickCreateToolsService-gqXZXpNH.js'),
|
|
3867
3865
|
},
|
|
3868
3866
|
]);
|
|
3869
3867
|
|
|
@@ -4028,16 +4026,25 @@ const TextInput = (props) => {
|
|
|
4028
4026
|
const handleChange = (event, data) => {
|
|
4029
4027
|
event.stopPropagation();
|
|
4030
4028
|
setValue(data.value);
|
|
4031
|
-
|
|
4029
|
+
if (!props.validateOnlyOnBlur) {
|
|
4030
|
+
tryCommitValue(data.value);
|
|
4031
|
+
}
|
|
4032
4032
|
};
|
|
4033
4033
|
const handleKeyUp = (event) => {
|
|
4034
4034
|
event.stopPropagation();
|
|
4035
|
-
|
|
4036
|
-
|
|
4035
|
+
if (!props.validateOnlyOnBlur) {
|
|
4036
|
+
tryCommitValue(event.currentTarget.value);
|
|
4037
|
+
}
|
|
4038
|
+
};
|
|
4039
|
+
const handleBlur = (event) => {
|
|
4040
|
+
HandleOnBlur(event);
|
|
4041
|
+
if (props.validateOnlyOnBlur) {
|
|
4042
|
+
tryCommitValue(event.currentTarget.value);
|
|
4043
|
+
}
|
|
4037
4044
|
};
|
|
4038
4045
|
const mergedClassName = mergeClasses(classes.input, !validateValue(value) ? classes.invalid : "", props.className);
|
|
4039
4046
|
const id = useId("input-button");
|
|
4040
|
-
return (jsxs("div", { className: classes.container, children: [props.infoLabel && jsx(InfoLabel, { ...props.infoLabel, htmlFor: id }), jsx(Input, { ...props, input: { className: classes.inputSlot }, id: id, size: size, value: value, onChange: handleChange, onKeyUp: handleKeyUp, onKeyDown: HandleKeyDown, onBlur:
|
|
4047
|
+
return (jsxs("div", { className: classes.container, children: [props.infoLabel && jsx(InfoLabel, { ...props.infoLabel, htmlFor: id }), jsx(Input, { ...props, input: { className: classes.inputSlot }, id: id, size: size, value: value, onChange: handleChange, onKeyUp: handleKeyUp, onKeyDown: HandleKeyDown, onBlur: handleBlur, className: mergedClassName })] }));
|
|
4041
4048
|
};
|
|
4042
4049
|
|
|
4043
4050
|
const useDropdownStyles = makeStyles({
|
|
@@ -4996,7 +5003,7 @@ function MakeModularTool(options) {
|
|
|
4996
5003
|
});
|
|
4997
5004
|
// Register the extension list service (for browsing/installing extensions) if extension feeds are provided.
|
|
4998
5005
|
if (extensionFeeds.length > 0) {
|
|
4999
|
-
const { ExtensionListServiceDefinition } = await import('./extensionsListService-
|
|
5006
|
+
const { ExtensionListServiceDefinition } = await import('./extensionsListService-CN7-7Dna.js');
|
|
5000
5007
|
await serviceContainer.addServiceAsync(ExtensionListServiceDefinition);
|
|
5001
5008
|
}
|
|
5002
5009
|
// Register the theme selector service (for selecting the theme) if theming is configured.
|
|
@@ -5609,23 +5616,16 @@ const ArcRotateCameraBehaviorsProperties = (props) => {
|
|
|
5609
5616
|
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Auto Rotation", target: camera, propertyKey: "useAutoRotationBehavior" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Bouncing", target: camera, propertyKey: "useBouncingBehavior" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Framing", target: camera, propertyKey: "useFramingBehavior" })] }));
|
|
5610
5617
|
};
|
|
5611
5618
|
|
|
5612
|
-
// The below conversion functions are taken from old HexLineComponent and can likely be simplified
|
|
5613
|
-
const ConvertToHexString = (valueString) => {
|
|
5614
|
-
while (valueString.length < 10) {
|
|
5615
|
-
valueString += "0";
|
|
5616
|
-
}
|
|
5617
|
-
return valueString;
|
|
5618
|
-
};
|
|
5619
5619
|
const MaskValidatorFn = (valueString) => {
|
|
5620
5620
|
if (valueString.substring(0, 2) != "0x") {
|
|
5621
5621
|
if (valueString.substring(0, 1) != "0") {
|
|
5622
5622
|
valueString = "0x" + valueString;
|
|
5623
5623
|
}
|
|
5624
5624
|
else {
|
|
5625
|
-
valueString = "0x" + valueString.
|
|
5625
|
+
valueString = "0x" + valueString.substring(1);
|
|
5626
5626
|
}
|
|
5627
5627
|
}
|
|
5628
|
-
const valueSubstr = valueString.
|
|
5628
|
+
const valueSubstr = valueString.substring(2);
|
|
5629
5629
|
if (valueSubstr != "" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {
|
|
5630
5630
|
return false;
|
|
5631
5631
|
}
|
|
@@ -5634,14 +5634,16 @@ const MaskValidatorFn = (valueString) => {
|
|
|
5634
5634
|
}
|
|
5635
5635
|
return true;
|
|
5636
5636
|
};
|
|
5637
|
-
const GetHexValFromNumber = (val) => {
|
|
5637
|
+
const GetHexValFromNumber = (val, numBits) => {
|
|
5638
|
+
const numDigits = (numBits ?? 32) >> 2;
|
|
5638
5639
|
let valueAsHex = val.toString(16);
|
|
5639
5640
|
let hex0String = "";
|
|
5640
|
-
for (let i = 0; i <
|
|
5641
|
+
for (let i = 0; i < numDigits - valueAsHex.length; i++) {
|
|
5641
5642
|
// padding the '0's
|
|
5642
|
-
hex0String
|
|
5643
|
+
hex0String = "0" + hex0String;
|
|
5643
5644
|
}
|
|
5644
|
-
|
|
5645
|
+
const finalHexValue = hex0String + valueAsHex;
|
|
5646
|
+
valueAsHex = "0x" + finalHexValue.substring(finalHexValue.length - numDigits);
|
|
5645
5647
|
return valueAsHex;
|
|
5646
5648
|
};
|
|
5647
5649
|
/**
|
|
@@ -5651,16 +5653,16 @@ const GetHexValFromNumber = (val) => {
|
|
|
5651
5653
|
*/
|
|
5652
5654
|
const HexPropertyLine = (props) => {
|
|
5653
5655
|
HexPropertyLine.displayName = "HexPropertyLine";
|
|
5654
|
-
const [hexVal, setHexVal] = useState(GetHexValFromNumber(props.value));
|
|
5656
|
+
const [hexVal, setHexVal] = useState(GetHexValFromNumber(props.value, props.numBits));
|
|
5655
5657
|
const onStrValChange = (val) => {
|
|
5658
|
+
const numBits = props.numBits ?? 32;
|
|
5656
5659
|
setHexVal(val);
|
|
5657
|
-
|
|
5658
|
-
props.onChange(parseInt(valueStringAsHex));
|
|
5660
|
+
props.onChange(parseInt(val) & (2 ** numBits - 1));
|
|
5659
5661
|
};
|
|
5660
5662
|
useEffect(() => {
|
|
5661
|
-
setHexVal(GetHexValFromNumber(props.value));
|
|
5662
|
-
}, [
|
|
5663
|
-
return (jsx(PropertyLine, { ...props, children: jsx(TextInput, { ...props, validator: MaskValidatorFn, value: hexVal, onChange: onStrValChange }) }));
|
|
5663
|
+
setHexVal(GetHexValFromNumber(props.value, props.numBits));
|
|
5664
|
+
}, []);
|
|
5665
|
+
return (jsx(PropertyLine, { ...props, children: jsx(TextInput, { ...props, validator: MaskValidatorFn, value: hexVal, onChange: onStrValChange, validateOnlyOnBlur: true }) }));
|
|
5664
5666
|
};
|
|
5665
5667
|
|
|
5666
5668
|
const CameraModes = [
|
|
@@ -6210,7 +6212,7 @@ const MaterialTransparencyProperties = (props) => {
|
|
|
6210
6212
|
const MaterialStencilProperties = (props) => {
|
|
6211
6213
|
const { material } = props;
|
|
6212
6214
|
const stencilEnabled = useProperty(material.stencil, "enabled");
|
|
6213
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.stencil, propertyKey: "enabled" }), jsx(Collapse, { visible: stencilEnabled, children: jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberInputPropertyLine, label: "Reference Value", target: material.stencil, propertyKey: "funcRef", step: 0 }), jsx(PropertyLine, { label: "Front", expandByDefault: true, expandedContent: jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Function", target: material.stencil, propertyKey: "func", options: StencilFunctionOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil Fail Operation", target: material.stencil, propertyKey: "opStencilFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Depth Fail Operation", target: material.stencil, propertyKey: "opDepthFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil & Depth Pass Operation", target: material.stencil, propertyKey: "opStencilDepthPass", options: StencilOperationOptions })] }) }), jsx(PropertyLine, { label: "Back", expandByDefault: true, expandedContent: jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Function", target: material.stencil, propertyKey: "backFunc", options: StencilFunctionOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil Fail Operation", target: material.stencil, propertyKey: "backOpStencilFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Depth Fail Operation", target: material.stencil, propertyKey: "backOpDepthFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil & Depth Pass Operation", target: material.stencil, propertyKey: "backOpStencilDepthPass", options: StencilOperationOptions })] }) })] }) })] }));
|
|
6215
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.stencil, propertyKey: "enabled" }), jsx(Collapse, { visible: stencilEnabled, children: jsxs(Fragment, { children: [jsx(BoundProperty, { component: HexPropertyLine, label: "Write Mask", target: material.stencil, propertyKey: "mask", numBits: 8 }), jsx(BoundProperty, { component: HexPropertyLine, label: "Read Mask", target: material.stencil, propertyKey: "funcMask", numBits: 8 }), jsx(BoundProperty, { component: NumberInputPropertyLine, label: "Reference Value", target: material.stencil, propertyKey: "funcRef", step: 1, forceInt: true, min: 0, max: 255 }), jsx(PropertyLine, { label: "Front", expandByDefault: true, expandedContent: jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Function", target: material.stencil, propertyKey: "func", options: StencilFunctionOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil Fail Operation", target: material.stencil, propertyKey: "opStencilFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Depth Fail Operation", target: material.stencil, propertyKey: "opDepthFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil & Depth Pass Operation", target: material.stencil, propertyKey: "opStencilDepthPass", options: StencilOperationOptions })] }) }), jsx(PropertyLine, { label: "Back", expandByDefault: true, expandedContent: jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Function", target: material.stencil, propertyKey: "backFunc", options: StencilFunctionOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil Fail Operation", target: material.stencil, propertyKey: "backOpStencilFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Depth Fail Operation", target: material.stencil, propertyKey: "backOpDepthFail", options: StencilOperationOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Stencil & Depth Pass Operation", target: material.stencil, propertyKey: "backOpStencilDepthPass", options: StencilOperationOptions })] }) })] }) })] }));
|
|
6214
6216
|
};
|
|
6215
6217
|
|
|
6216
6218
|
const MultiMaterialChildrenProperties = (props) => {
|
|
@@ -6220,6 +6222,9 @@ const MultiMaterialChildrenProperties = (props) => {
|
|
|
6220
6222
|
.map((material, index) => (jsx(LinkToEntityPropertyLine, { label: `Material #${index + 1}`, entity: material, selectionService: selectionService }, material.uniqueId))) }));
|
|
6221
6223
|
};
|
|
6222
6224
|
|
|
6225
|
+
function IsMaterialWithPublicNormalMaps(mat) {
|
|
6226
|
+
return mat.invertNormalMapX !== undefined;
|
|
6227
|
+
}
|
|
6223
6228
|
/**
|
|
6224
6229
|
* Displays the normal map properties of a standard material.
|
|
6225
6230
|
* @param props - The required properties
|
|
@@ -6227,75 +6232,7 @@ const MultiMaterialChildrenProperties = (props) => {
|
|
|
6227
6232
|
*/
|
|
6228
6233
|
const NormalMapProperties = (props) => {
|
|
6229
6234
|
const { material } = props;
|
|
6230
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert X Axis", target: material, propertyKey: "invertNormalMapX" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert Y Axis", target: material, propertyKey: "invertNormalMapY" })] }));
|
|
6231
|
-
};
|
|
6232
|
-
|
|
6233
|
-
// TODO: ryamtrem / gehalper This function is temporal until there is a line control to handle texture links (similar to the old TextureLinkLineComponent)
|
|
6234
|
-
const UpdateTexture$1 = (file, material, textureSetter) => {
|
|
6235
|
-
ReadFile(file, (data) => {
|
|
6236
|
-
const blob = new Blob([data], { type: "octet/stream" });
|
|
6237
|
-
const url = URL.createObjectURL(blob);
|
|
6238
|
-
textureSetter(new Texture(url, material.getScene(), false, false));
|
|
6239
|
-
}, undefined, true);
|
|
6240
|
-
};
|
|
6241
|
-
const PBRBaseMaterialClearCoatProperties = (props) => {
|
|
6242
|
-
const { material } = props;
|
|
6243
|
-
const isEnabled = useProperty(material.clearCoat, "isEnabled");
|
|
6244
|
-
const isTintEnabled = useProperty(material.clearCoat, "isTintEnabled");
|
|
6245
|
-
const bumpTexture = useProperty(material.clearCoat, "bumpTexture");
|
|
6246
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.clearCoat, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.clearCoat, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Roughness", target: material.clearCoat, propertyKey: "roughness", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "IOR", description: "Index of Refraction", target: material.clearCoat, propertyKey: "indexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Remap F0", target: material.clearCoat, propertyKey: "remapF0OnInterfaceChange" }), jsx(FileUploadLine, { label: "Clear coat", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6247
|
-
if (files.length > 0) {
|
|
6248
|
-
UpdateTexture$1(files[0], material, (texture) => (material.clearCoat.texture = texture));
|
|
6249
|
-
}
|
|
6250
|
-
} }), jsx(FileUploadLine, { label: "Roughness", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6251
|
-
if (files.length > 0) {
|
|
6252
|
-
UpdateTexture$1(files[0], material, (texture) => (material.clearCoat.textureRoughness = texture));
|
|
6253
|
-
}
|
|
6254
|
-
} }), jsx(FileUploadLine, { label: "Bump", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6255
|
-
if (files.length > 0) {
|
|
6256
|
-
UpdateTexture$1(files[0], material, (texture) => (material.clearCoat.bumpTexture = texture));
|
|
6257
|
-
}
|
|
6258
|
-
} }), jsx(Collapse, { visible: bumpTexture !== null, children: jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Bump Strength", target: bumpTexture, propertyKey: "level", min: 0, max: 2, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness from Main Texture", target: material.clearCoat, propertyKey: "useRoughnessFromMainTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Tint", target: material.clearCoat, propertyKey: "isTintEnabled" }), jsxs(Collapse, { visible: isTintEnabled, children: [jsx(BoundProperty, { component: Color3PropertyLine, label: "Tint Color", target: material.clearCoat, propertyKey: "tintColor", isLinearMode: true }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "At Distance", target: material.clearCoat, propertyKey: "tintColorAtDistance", min: 0, max: 20, step: 0.1 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Tint Thickness", target: material.clearCoat, propertyKey: "tintThickness", min: 0, max: 20, step: 0.1 }), jsx(FileUploadLine, { label: "Tint", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6259
|
-
if (files.length > 0) {
|
|
6260
|
-
UpdateTexture$1(files[0], material, (texture) => (material.clearCoat.tintTexture = texture));
|
|
6261
|
-
}
|
|
6262
|
-
} })] })] })] }));
|
|
6263
|
-
};
|
|
6264
|
-
const PBRBaseMaterialIridescenceProperties = (props) => {
|
|
6265
|
-
const { material } = props;
|
|
6266
|
-
const isEnabled = useProperty(material.iridescence, "isEnabled");
|
|
6267
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.iridescence, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.iridescence, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "IOR", description: "Index of Refraction", target: material.iridescence, propertyKey: "indexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Minimum Thickness", target: material.iridescence, propertyKey: "minimumThickness", min: 0, max: 1000, step: 10 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Maxium Thickness", target: material.iridescence, propertyKey: "maximumThickness", min: 0, max: 1000, step: 10 }), jsx(FileUploadLine, { label: "Iridescence", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6268
|
-
if (files.length > 0) {
|
|
6269
|
-
UpdateTexture$1(files[0], material, (texture) => (material.iridescence.texture = texture));
|
|
6270
|
-
}
|
|
6271
|
-
} }), jsx(FileUploadLine, { label: "Thickness", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6272
|
-
if (files.length > 0) {
|
|
6273
|
-
UpdateTexture$1(files[0], material, (texture) => (material.iridescence.thicknessTexture = texture));
|
|
6274
|
-
}
|
|
6275
|
-
} })] })] }));
|
|
6276
|
-
};
|
|
6277
|
-
const PBRBaseMaterialAnisotropicProperties = (props) => {
|
|
6278
|
-
const { material } = props;
|
|
6279
|
-
const isEnabled = useProperty(material.anisotropy, "isEnabled");
|
|
6280
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.anisotropy, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Legacy Mode", target: material.anisotropy, propertyKey: "legacy" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.anisotropy, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Vector2PropertyLine, label: "Direction", target: material.anisotropy, propertyKey: "direction" }), jsx(FileUploadLine, { label: "Anisotropic", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6281
|
-
if (files.length > 0) {
|
|
6282
|
-
UpdateTexture$1(files[0], material, (texture) => (material.anisotropy.texture = texture));
|
|
6283
|
-
}
|
|
6284
|
-
} })] })] }));
|
|
6285
|
-
};
|
|
6286
|
-
const PBRBaseMaterialSheenProperties = (props) => {
|
|
6287
|
-
const { material } = props;
|
|
6288
|
-
const isEnabled = useProperty(material.sheen, "isEnabled");
|
|
6289
|
-
const useRoughness = useProperty(material.sheen, "_useRoughness");
|
|
6290
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.sheen, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Link to Albedo", target: material.sheen, propertyKey: "linkSheenWithAlbedo" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.sheen, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Color", target: material.sheen, propertyKey: "color", isLinearMode: true }), jsx(FileUploadLine, { label: "Sheen", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6291
|
-
if (files.length > 0) {
|
|
6292
|
-
UpdateTexture$1(files[0], material, (texture) => (material.sheen.texture = texture));
|
|
6293
|
-
}
|
|
6294
|
-
} }), jsx(FileUploadLine, { label: "Roughness", accept: ".jpg, .png, .tga, .dds, .env, .exr", onClick: (files) => {
|
|
6295
|
-
if (files.length > 0) {
|
|
6296
|
-
UpdateTexture$1(files[0], material, (texture) => (material.sheen.textureRoughness = texture));
|
|
6297
|
-
}
|
|
6298
|
-
} }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness", target: material.sheen, propertyKey: "_useRoughness" }), jsx(Collapse, { visible: useRoughness, children: jsx(BoundProperty, { nullable: true, component: SyncedSliderPropertyLine, label: "Roughness", target: material.sheen, propertyKey: "roughness", defaultValue: 0, min: 0, max: 1, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness from Main Texture", target: material.sheen, propertyKey: "useRoughnessFromMainTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Albedo Scaling", target: material.sheen, propertyKey: "albedoScaling" })] })] }));
|
|
6235
|
+
return (jsx(Fragment, { children: IsMaterialWithPublicNormalMaps(material) ? (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert X Axis", target: material, propertyKey: "invertNormalMapX" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert Y Axis", target: material, propertyKey: "invertNormalMapY" })] })) : (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert X Axis", target: material, propertyKey: "_invertNormalMapX" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Invert Y Axis", target: material, propertyKey: "_invertNormalMapY" })] })) }));
|
|
6299
6236
|
};
|
|
6300
6237
|
|
|
6301
6238
|
const useStyles$d = makeStyles({
|
|
@@ -6537,25 +6474,178 @@ const MaterialSelectorPropertyLine = (props) => jsx(PropertyLine, { ...props, ch
|
|
|
6537
6474
|
const TextureSelectorPropertyLine = (props) => jsx(PropertyLine, { ...props, children: jsx(TextureSelector, { ...props }) });
|
|
6538
6475
|
const SkeletonSelectorPropertyLine = (props) => jsx(PropertyLine, { ...props, children: jsx(SkeletonSelector, { ...props }) });
|
|
6539
6476
|
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
const
|
|
6477
|
+
const LightFalloffOptions = [
|
|
6478
|
+
{ label: "Physical", value: PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL },
|
|
6479
|
+
{ label: "glTF", value: PBRBaseMaterial.LIGHTFALLOFF_GLTF },
|
|
6480
|
+
{ label: "Standard", value: PBRBaseMaterial.LIGHTFALLOFF_STANDARD },
|
|
6481
|
+
];
|
|
6482
|
+
const RealTimeFilteringQualityOptions = [
|
|
6483
|
+
{ label: "Low", value: Constants.TEXTURE_FILTERING_QUALITY_LOW },
|
|
6484
|
+
{ label: "Medium", value: Constants.TEXTURE_FILTERING_QUALITY_MEDIUM },
|
|
6485
|
+
{ label: "High", value: Constants.TEXTURE_FILTERING_QUALITY_HIGH },
|
|
6486
|
+
];
|
|
6487
|
+
const BaseDiffuseModelOptions = [
|
|
6488
|
+
{ label: "Lambert", value: Constants.MATERIAL_DIFFUSE_MODEL_LAMBERT },
|
|
6489
|
+
{ label: "Burley", value: Constants.MATERIAL_DIFFUSE_MODEL_BURLEY },
|
|
6490
|
+
{ label: "OpenPBR", value: Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR },
|
|
6491
|
+
];
|
|
6492
|
+
const DielectricSpecularModelOptions = [
|
|
6493
|
+
{ label: "glTF", value: Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_GLTF },
|
|
6494
|
+
{ label: "OpenPBR", value: Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR },
|
|
6495
|
+
];
|
|
6496
|
+
const ConductorSpecularModelOptions = [
|
|
6497
|
+
{ label: "glTF", value: Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_GLTF },
|
|
6498
|
+
{ label: "OpenPBR", value: Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR },
|
|
6499
|
+
];
|
|
6500
|
+
const DebugMode = [
|
|
6501
|
+
{ label: "None", value: 0 },
|
|
6502
|
+
// Geometry
|
|
6503
|
+
{ label: "Normalized position", value: 1 },
|
|
6504
|
+
{ label: "Normals", value: 2 },
|
|
6505
|
+
{ label: "Tangents", value: 3 },
|
|
6506
|
+
{ label: "Bitangents", value: 4 },
|
|
6507
|
+
{ label: "Bump Normals", value: 5 },
|
|
6508
|
+
{ label: "UV1", value: 6 },
|
|
6509
|
+
{ label: "UV2", value: 7 },
|
|
6510
|
+
{ label: "ClearCoat Normals", value: 8 },
|
|
6511
|
+
{ label: "ClearCoat Tangents", value: 9 },
|
|
6512
|
+
{ label: "ClearCoat Bitangents", value: 10 },
|
|
6513
|
+
{ label: "Anisotropic Normals", value: 11 },
|
|
6514
|
+
{ label: "Anisotropic Tangents", value: 12 },
|
|
6515
|
+
{ label: "Anisotropic Bitangents", value: 13 },
|
|
6516
|
+
// Maps
|
|
6517
|
+
{ label: "Albedo Map", value: 20 },
|
|
6518
|
+
{ label: "Ambient Map", value: 21 },
|
|
6519
|
+
{ label: "Opacity Map", value: 22 },
|
|
6520
|
+
{ label: "Emissive Map", value: 23 },
|
|
6521
|
+
{ label: "Light Map", value: 24 },
|
|
6522
|
+
{ label: "Metallic Map", value: 25 },
|
|
6523
|
+
{ label: "Reflectivity Map", value: 26 },
|
|
6524
|
+
{ label: "ClearCoat Map", value: 27 },
|
|
6525
|
+
{ label: "ClearCoat Tint Map", value: 28 },
|
|
6526
|
+
{ label: "Sheen Map", value: 29 },
|
|
6527
|
+
{ label: "Anisotropic Map", value: 30 },
|
|
6528
|
+
{ label: "Thickness Map", value: 31 },
|
|
6529
|
+
{ label: "Bump Map", value: 32 },
|
|
6530
|
+
// Env
|
|
6531
|
+
{ label: "Env Refraction", value: 40 },
|
|
6532
|
+
{ label: "Env Reflection", value: 41 },
|
|
6533
|
+
{ label: "Env Clear Coat", value: 42 },
|
|
6534
|
+
// Lighting
|
|
6535
|
+
{ label: "Direct Diffuse", value: 50 },
|
|
6536
|
+
{ label: "Direct Specular", value: 51 },
|
|
6537
|
+
{ label: "Direct Clear Coat", value: 52 },
|
|
6538
|
+
{ label: "Direct Sheen", value: 53 },
|
|
6539
|
+
{ label: "Env Irradiance", value: 54 },
|
|
6540
|
+
// Lighting Params
|
|
6541
|
+
{ label: "Surface Albedo", value: 60 },
|
|
6542
|
+
{ label: "Reflectance 0", value: 61 },
|
|
6543
|
+
{ label: "Metallic", value: 62 },
|
|
6544
|
+
{ label: "Metallic F0", value: 71 },
|
|
6545
|
+
{ label: "Roughness", value: 63 },
|
|
6546
|
+
{ label: "AlphaG", value: 64 },
|
|
6547
|
+
{ label: "NdotV", value: 65 },
|
|
6548
|
+
{ label: "ClearCoat Color", value: 66 },
|
|
6549
|
+
{ label: "ClearCoat Roughness", value: 67 },
|
|
6550
|
+
{ label: "ClearCoat NdotV", value: 68 },
|
|
6551
|
+
{ label: "Transmittance", value: 69 },
|
|
6552
|
+
{ label: "Refraction Transmittance", value: 70 },
|
|
6553
|
+
{ label: "Glossiness", value: 72 },
|
|
6554
|
+
{ label: "Base Color", value: 73 },
|
|
6555
|
+
{ label: "Specular Color", value: 74 },
|
|
6556
|
+
{ label: "Emissive Color", value: 75 },
|
|
6557
|
+
// Misc
|
|
6558
|
+
{ label: "SEO", value: 80 },
|
|
6559
|
+
{ label: "EHO", value: 81 },
|
|
6560
|
+
{ label: "Energy Factor", value: 82 },
|
|
6561
|
+
{ label: "Specular Reflectance", value: 83 },
|
|
6562
|
+
{ label: "Clear Coat Reflectance", value: 84 },
|
|
6563
|
+
{ label: "Sheen Reflectance", value: 85 },
|
|
6564
|
+
{ label: "Luminance Over Alpha", value: 86 },
|
|
6565
|
+
{ label: "Alpha", value: 87 },
|
|
6566
|
+
{ label: "Albedo Alpha", value: 88 },
|
|
6567
|
+
{ label: "Ambient occlusion color", value: 89 },
|
|
6568
|
+
];
|
|
6569
|
+
const PBRBaseMaterialGeneralProperties = (props) => {
|
|
6546
6570
|
const { material } = props;
|
|
6547
|
-
return (
|
|
6571
|
+
return (jsx(Fragment, { children: jsx(BoundProperty, { component: SwitchPropertyLine, label: "Disable Lighting", target: material, propertyKey: "_disableLighting" }) }));
|
|
6548
6572
|
};
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
const
|
|
6573
|
+
const PBRBaseMaterialTransparencyProperties = (props) => {
|
|
6574
|
+
const { material } = props;
|
|
6575
|
+
return (jsxs(Fragment, { children: [material._albedoTexture && (jsx(Fragment, { children: jsx(BoundProperty, { component: SwitchPropertyLine, label: "Albedo texture has alpha", target: material._albedoTexture, propertyKey: "hasAlpha" }) })), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use alpha from albedo texture", target: material, propertyKey: "_useAlphaFromAlbedoTexture" })] }));
|
|
6576
|
+
};
|
|
6577
|
+
const PBRBaseMaterialChannelsProperties = (props) => {
|
|
6578
|
+
const { material, selectionService } = props;
|
|
6579
|
+
const scene = material.getScene();
|
|
6580
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6581
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Albedo", target: material, propertyKey: "_albedoTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Base Weight", target: material, propertyKey: "_baseWeightTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Base Diffuse Roughness", target: material, propertyKey: "_baseDiffuseRoughnessTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Metallic Roughness", target: material, propertyKey: "_metallicTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Reflection", target: material, propertyKey: "_reflectionTexture", scene: scene, cubeOnly: true, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Refraction", target: material.subSurface, propertyKey: "refractionTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Reflectivity", target: material, propertyKey: "_reflectivityTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Micro Surface", target: material, propertyKey: "_microSurfaceTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Bump", target: material, propertyKey: "_bumpTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Emissive", target: material, propertyKey: "_emissiveTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Opacity", target: material, propertyKey: "_opacityTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Ambient", target: material, propertyKey: "_ambientTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Lightmap", target: material, propertyKey: "_lightmapTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Detailmap", target: material.detailMap, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Lightmap as Shadowmap", target: material, propertyKey: "_useLightmapAsShadowmap" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Detailmap", target: material.detailMap, propertyKey: "isEnabled" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Decalmap", target: material.decalMap, propertyKey: "isEnabled" })] }));
|
|
6582
|
+
};
|
|
6583
|
+
const PBRBaseMaterialLightingAndColorProperties = (props) => {
|
|
6584
|
+
const { material } = props;
|
|
6585
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: Color3PropertyLine, label: "Albedo", target: material, propertyKey: "_albedoColor", isLinearMode: true }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Base Weight", target: material, propertyKey: "_baseWeight", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Reflectivity", target: material, propertyKey: "_reflectivityColor", isLinearMode: true }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Micro Surface", target: material, propertyKey: "_microSurface", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Emissive", target: material, propertyKey: "_emissiveColor", isLinearMode: true }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Ambient", target: material, propertyKey: "_ambientColor", isLinearMode: true }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Light Falloff", target: material, propertyKey: "_lightFalloff", options: LightFalloffOptions })] }));
|
|
6586
|
+
};
|
|
6587
|
+
const PBRBaseMaterialMetallicWorkflowProperties = (props) => {
|
|
6588
|
+
const { material, selectionService } = props;
|
|
6589
|
+
const scene = material.getScene();
|
|
6590
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6591
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Metallic", target: material, propertyKey: "_metallic", min: 0, max: 1, step: 0.01, nullable: true, defaultValue: 0 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Roughness", target: material, propertyKey: "_roughness", min: 0, max: 1, step: 0.01, nullable: true, defaultValue: 0 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Base Diffuse Roughness", target: material, propertyKey: "_baseDiffuseRoughness", min: 0, max: 1, step: 0.01, nullable: true, defaultValue: 0 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Index of Refraction", target: material.subSurface, propertyKey: "indexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "F0 Factor", target: material, propertyKey: "_metallicF0Factor", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Reflectance Color", target: material, propertyKey: "_metallicReflectanceColor", isLinearMode: true }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Metallic Only", description: "Use only metallic from MetallicReflectance texture", target: material, propertyKey: "_useOnlyMetallicFromMetallicReflectanceTexture" }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Metallic Reflectance", target: material, propertyKey: "_metallicReflectanceTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Reflectance", target: material, propertyKey: "_reflectanceTexture", scene: scene, onLink: selectEntity, defaultValue: null })] }));
|
|
6592
|
+
};
|
|
6593
|
+
const PBRBaseMaterialClearCoatProperties = (props) => {
|
|
6594
|
+
const { material, selectionService } = props;
|
|
6595
|
+
const scene = material.getScene();
|
|
6596
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6597
|
+
const isEnabled = useProperty(material.clearCoat, "isEnabled");
|
|
6598
|
+
const isTintEnabled = useProperty(material.clearCoat, "isTintEnabled");
|
|
6599
|
+
const bumpTexture = useProperty(material.clearCoat, "bumpTexture");
|
|
6600
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.clearCoat, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.clearCoat, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Roughness", target: material.clearCoat, propertyKey: "roughness", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "IOR", description: "Index of Refraction", target: material.clearCoat, propertyKey: "indexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Remap F0", target: material.clearCoat, propertyKey: "remapF0OnInterfaceChange" }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Clear Coat", target: material.clearCoat, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Roughness", target: material.clearCoat, propertyKey: "textureRoughness", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Bump", target: material.clearCoat, propertyKey: "bumpTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(Collapse, { visible: bumpTexture !== null, children: jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Bump Strength", target: bumpTexture, propertyKey: "level", min: 0, max: 2, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness from Main Texture", target: material.clearCoat, propertyKey: "useRoughnessFromMainTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Tint", target: material.clearCoat, propertyKey: "isTintEnabled" }), jsxs(Collapse, { visible: isTintEnabled, children: [jsx(BoundProperty, { component: Color3PropertyLine, label: "Tint Color", target: material.clearCoat, propertyKey: "tintColor", isLinearMode: true }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "At Distance", target: material.clearCoat, propertyKey: "tintColorAtDistance", min: 0, max: 20, step: 0.1 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Tint Thickness", target: material.clearCoat, propertyKey: "tintThickness", min: 0, max: 20, step: 0.1 }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Tint", target: material.clearCoat, propertyKey: "tintTexture", scene: scene, onLink: selectEntity, defaultValue: null })] })] })] }));
|
|
6601
|
+
};
|
|
6602
|
+
const PBRBaseMaterialIridescenceProperties = (props) => {
|
|
6555
6603
|
const { material, selectionService } = props;
|
|
6556
6604
|
const scene = material.getScene();
|
|
6557
6605
|
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6558
|
-
|
|
6606
|
+
const isEnabled = useProperty(material.iridescence, "isEnabled");
|
|
6607
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.iridescence, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.iridescence, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "IOR", description: "Index of Refraction", target: material.iridescence, propertyKey: "indexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Min Thickness", target: material.iridescence, propertyKey: "minimumThickness", min: 0, max: 1000, step: 10 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Max Thickness", target: material.iridescence, propertyKey: "maximumThickness", min: 0, max: 1000, step: 10 }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Iridescence", target: material.iridescence, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Thickness", target: material.iridescence, propertyKey: "thicknessTexture", scene: scene, onLink: selectEntity, defaultValue: null })] })] }));
|
|
6608
|
+
};
|
|
6609
|
+
const PBRBaseMaterialAnisotropicProperties = (props) => {
|
|
6610
|
+
const { material, selectionService } = props;
|
|
6611
|
+
const scene = material.getScene();
|
|
6612
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6613
|
+
const isEnabled = useProperty(material.anisotropy, "isEnabled");
|
|
6614
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.anisotropy, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Legacy Mode", target: material.anisotropy, propertyKey: "legacy" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.anisotropy, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Vector2PropertyLine, label: "Direction", target: material.anisotropy, propertyKey: "direction" }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Anisotropic", target: material.anisotropy, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null })] })] }));
|
|
6615
|
+
};
|
|
6616
|
+
const PBRBaseMaterialSheenProperties = (props) => {
|
|
6617
|
+
const { material, selectionService } = props;
|
|
6618
|
+
const scene = material.getScene();
|
|
6619
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6620
|
+
const isEnabled = useProperty(material.sheen, "isEnabled");
|
|
6621
|
+
const useRoughness = useProperty(material.sheen, "_useRoughness");
|
|
6622
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Enabled", target: material.sheen, propertyKey: "isEnabled" }), jsxs(Collapse, { visible: isEnabled, children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Link to Albedo", target: material.sheen, propertyKey: "linkSheenWithAlbedo" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.sheen, propertyKey: "intensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Color", target: material.sheen, propertyKey: "color", isLinearMode: true }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Sheen", target: material.sheen, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Roughness", target: material.sheen, propertyKey: "textureRoughness", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness", target: material.sheen, propertyKey: "_useRoughness" }), jsx(Collapse, { visible: useRoughness, children: jsx(BoundProperty, { nullable: true, component: SyncedSliderPropertyLine, label: "Roughness", target: material.sheen, propertyKey: "roughness", defaultValue: 0, min: 0, max: 1, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Roughness from Main Texture", target: material.sheen, propertyKey: "useRoughnessFromMainTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Albedo Scaling", target: material.sheen, propertyKey: "albedoScaling" })] })] }));
|
|
6623
|
+
};
|
|
6624
|
+
const PBRBaseMaterialSubSurfaceProperties = (props) => {
|
|
6625
|
+
const { material, selectionService } = props;
|
|
6626
|
+
const scene = material.getScene();
|
|
6627
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6628
|
+
const useScattering = useProperty(material.subSurface, "isScatteringEnabled") && !!material.getScene().prePassRenderer && !!material.getScene().subSurfaceConfiguration;
|
|
6629
|
+
const useRefraction = useProperty(material.subSurface, "isRefractionEnabled");
|
|
6630
|
+
const useDispersion = useProperty(material.subSurface, "isDispersionEnabled");
|
|
6631
|
+
const useTranslucency = useProperty(material.subSurface, "isTranslucencyEnabled");
|
|
6632
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Thickness", target: material.subSurface, propertyKey: "thicknessTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Min Thickness", target: material.subSurface, propertyKey: "minimumThickness", min: 0, max: 10, step: 0.1 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Max Thickness", target: material.subSurface, propertyKey: "maximumThickness", min: 0, max: 10, step: 0.1 }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Mask From Thickness", target: material.subSurface, propertyKey: "useMaskFromThicknessTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "glTF-Style Textures", target: material.subSurface, propertyKey: "useGltfStyleTextures" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Thickness as Depth", target: material.subSurface, propertyKey: "useThicknessAsDepth" }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Tint Color", target: material.subSurface, propertyKey: "tintColor", isLinearMode: true }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Scattering Enabled", target: material.subSurface, propertyKey: "isScatteringEnabled" }), jsx(Collapse, { visible: useScattering, children: jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Meters Per Unit", target: material.getScene().subSurfaceConfiguration, propertyKey: "metersPerUnit", min: 0.01, max: 2, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Refraction Enabled", target: material.subSurface, propertyKey: "isRefractionEnabled" }), jsxs(Collapse, { visible: useRefraction, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.subSurface, propertyKey: "refractionIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Refraction Intensity", target: material.subSurface, propertyKey: "refractionIntensityTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Refraction", target: material.subSurface, propertyKey: "refractionTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Volume Index of Refraction", target: material.subSurface, propertyKey: "volumeIndexOfRefraction", min: 1, max: 3, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Tint at Distance", target: material.subSurface, propertyKey: "tintColorAtDistance", min: 0, max: 10, step: 0.1 }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Link Refraction with Transparency", target: material.subSurface, propertyKey: "linkRefractionWithTransparency" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Albedo to Tint Surface Transparency", target: material.subSurface, propertyKey: "useAlbedoToTintRefraction" })] }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Dispersion Enabled", target: material.subSurface, propertyKey: "isDispersionEnabled" }), jsx(Collapse, { visible: useDispersion, children: jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.subSurface, propertyKey: "dispersion", min: 0, max: 5, step: 0.01 }) }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Translucency Enabled", target: material.subSurface, propertyKey: "isTranslucencyEnabled" }), jsxs(Collapse, { visible: useTranslucency, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Intensity", target: material.subSurface, propertyKey: "translucencyIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Intensity Texture", target: material.subSurface, propertyKey: "translucencyIntensityTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Diffusion Distance", target: material.subSurface, propertyKey: "diffusionDistance", isLinearMode: true }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Albedo to Tint Surface Translucency", target: material.subSurface, propertyKey: "useAlbedoToTintTranslucency" }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Translucency Tint", target: material.subSurface, propertyKey: "translucencyColor", isLinearMode: true, nullable: true, defaultValue: Color3.White() }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Translucency Tint Texture", target: material.subSurface, propertyKey: "translucencyColorTexture", scene: scene, onLink: selectEntity, defaultValue: null })] })] }));
|
|
6633
|
+
};
|
|
6634
|
+
const PBRBaseMaterialLevelProperties = (props) => {
|
|
6635
|
+
const { material } = props;
|
|
6636
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Environment", target: material, propertyKey: "_environmentIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Specular", target: material, propertyKey: "_specularIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Emissive", target: material, propertyKey: "_emissiveIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Direct", target: material, propertyKey: "_directIntensity", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Bump Strength", target: material._bumpTexture, propertyKey: "level", min: 0, max: 2, step: 0.01 }), jsx(Collapse, { visible: !!material._ambientTexture, children: jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Ambient Strength", target: material, propertyKey: "_ambientTextureStrength", min: 0, max: 1, step: 0.01 }) }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Reflection Strength", target: material._reflectionTexture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Clear Coat", target: material.clearCoat.texture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Clear Coat Bump", target: material.clearCoat.bumpTexture, propertyKey: "level", min: 0, max: 2, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Anisotropic", target: material.anisotropy.texture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Sheen", target: material.sheen.texture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Thickness", target: material.subSurface.thicknessTexture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Refraction", target: material.subSurface.refractionTexture, propertyKey: "level", min: 0, max: 1, step: 0.01 }), jsxs(Collapse, { visible: material.detailMap.isEnabled, children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Detailmap Diffuse", target: material.detailMap, propertyKey: "diffuseBlendLevel", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Detailmap Bump", target: material.detailMap, propertyKey: "bumpLevel", min: 0, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Detailmap Roughness", target: material.detailMap, propertyKey: "roughnessBlendLevel", min: 0, max: 1, step: 0.01 })] })] }));
|
|
6637
|
+
};
|
|
6638
|
+
const PBRBaseMaterialRenderingProperties = (props) => {
|
|
6639
|
+
const { material } = props;
|
|
6640
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Alpha from Albedo", target: material, propertyKey: "_useAlphaFromAlbedoTexture" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Ambient in Grayscale", target: material, propertyKey: "_useAmbientInGrayScale" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Radiance over Alpha", target: material, propertyKey: "_useRadianceOverAlpha" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Micro-surface from Ref. Map Alpha", target: material, propertyKey: "_useMicroSurfaceFromReflectivityMapAlpha" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Specular over Alpha", target: material, propertyKey: "_useSpecularOverAlpha" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Specular Anti-aliasing", target: material, propertyKey: "_enableSpecularAntiAliasing" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Realtime Filtering", target: material, propertyKey: "realTimeFiltering" }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Realtime Filtering Quality", target: material, propertyKey: "realTimeFilteringQuality", options: RealTimeFilteringQualityOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Base Diffuse Model", target: material.brdf, propertyKey: "baseDiffuseModel", options: BaseDiffuseModelOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Dielectric Specular Model", target: material.brdf, propertyKey: "dielectricSpecularModel", options: DielectricSpecularModelOptions }), jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Conductor Specular Model", target: material.brdf, propertyKey: "conductorSpecularModel", options: ConductorSpecularModelOptions })] }));
|
|
6641
|
+
};
|
|
6642
|
+
const PBRBaseMaterialAdvancedProperties = (props) => {
|
|
6643
|
+
const { material } = props;
|
|
6644
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Energy Conservation", target: material.brdf, propertyKey: "useEnergyConservation" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Spherical Harmonics", target: material.brdf, propertyKey: "useSphericalHarmonics" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Radiance Occlusion", target: material, propertyKey: "_useRadianceOcclusion" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Horizon Occlusion", target: material, propertyKey: "_useHorizonOcclusion" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Mix Irradiance with Rough Radiance", target: material.brdf, propertyKey: "mixIblRadianceWithIrradiance" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Legacy Specular Energy Conservation", target: material.brdf, propertyKey: "useLegacySpecularEnergyConservation" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Unlit", target: material, propertyKey: "_unlit" })] }));
|
|
6645
|
+
};
|
|
6646
|
+
const PBRBaseMaterialDebugProperties = (props) => {
|
|
6647
|
+
const { material } = props;
|
|
6648
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: NumberDropdownPropertyLine, label: "Debug Mode", target: material, propertyKey: "debugMode", options: DebugMode }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Split Position", target: material, propertyKey: "debugLimit", min: -1, max: 1, step: 0.01 }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Output Factor", target: material, propertyKey: "debugFactor", min: 0, max: 5, step: 0.01 })] }));
|
|
6559
6649
|
};
|
|
6560
6650
|
|
|
6561
6651
|
// TODO: ryamtrem / gehalper This function is temporal until there is a line control to handle texture links (similar to the old TextureLinkLineComponent)
|
|
@@ -6732,6 +6822,20 @@ const SkyMaterialProperties = (props) => {
|
|
|
6732
6822
|
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Azimuth", description: `Azimuth angle in ${useDegrees ? "degrees" : "radians"}`, target: material, propertyKey: "azimuth", min: toDisplayAngle(0), max: toDisplayAngle(Math.PI * 2), step: toDisplayAngle(0.001), convertTo: toDisplayAngle, convertFrom: fromDisplayAngle, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Inclination", description: `Inclination angle in ${useDegrees ? "degrees" : "radians"}`, target: material, propertyKey: "inclination", min: toDisplayAngle(0), max: toDisplayAngle(Math.PI / 2), step: toDisplayAngle(0.001), convertTo: toDisplayAngle, convertFrom: fromDisplayAngle, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Turbidity", description: "Atmospheric turbidity.", target: material, propertyKey: "turbidity", min: 0, max: 100, step: 0.1, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Luminance", description: "Brightness of the sky (0 to 1).", target: material, propertyKey: "luminance", min: 0, max: 1, step: 0.001, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Rayleigh", description: "Rayleigh scattering coefficient (0 to 4).", target: material, propertyKey: "rayleigh", min: 0, max: 4, step: 0.001, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Mie Directional G", description: "Mie directional scattering (0 to 1).", target: material, propertyKey: "mieDirectionalG", min: 0, max: 1, step: 0.001, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Mie Coefficient", description: "Mie scattering coefficient (0 to 1).", target: material, propertyKey: "mieCoefficient", min: 0, max: 1, step: 0.001, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Distance", description: "Distance to the sky dome (0 to 1000 units).", target: material, propertyKey: "distance", min: 0, max: 1000, step: 0.1, docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Sun Pos", description: "Enable custom sun position.", target: material, propertyKey: "useSunPosition", docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: Vector3PropertyLine, label: "Sun Position", description: "Custom sun position (Vector3).", target: material, propertyKey: "sunPosition", docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#configuring-the-sky-material" }), jsx(BoundProperty, { component: Vector3PropertyLine, label: "Camera Offset", description: "Offset for the camera (Vector3).", target: material, propertyKey: "cameraOffset", docLink: "https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat/#keeping-the-horizon-relative-to-the-camera-elevation" })] }));
|
|
6733
6823
|
};
|
|
6734
6824
|
|
|
6825
|
+
const StandardMaterialGeneralProperties = (props) => {
|
|
6826
|
+
const { material } = props;
|
|
6827
|
+
return (jsx(Fragment, { children: jsx(BoundProperty, { component: SwitchPropertyLine, label: "Disable Lighting", target: material, propertyKey: "disableLighting" }) }));
|
|
6828
|
+
};
|
|
6829
|
+
const StandardMaterialTransparencyProperties = (props) => {
|
|
6830
|
+
const { material } = props;
|
|
6831
|
+
return (jsxs(Fragment, { children: [material.diffuseTexture && (jsx(Fragment, { children: jsx(BoundProperty, { component: SwitchPropertyLine, label: "Diffuse Texture has Alpha", target: material.diffuseTexture, propertyKey: "hasAlpha" }) })), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Alpha from Diffuse Texture", target: material, propertyKey: "useAlphaFromDiffuseTexture" })] }));
|
|
6832
|
+
};
|
|
6833
|
+
const StandardMaterialTexturesProperties = (props) => {
|
|
6834
|
+
const { material, selectionService } = props;
|
|
6835
|
+
const scene = material.getScene();
|
|
6836
|
+
const selectEntity = (entity) => (selectionService.selectedEntity = entity);
|
|
6837
|
+
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Diffuse", target: material, propertyKey: "diffuseTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Specular", target: material, propertyKey: "specularTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Reflection", target: material, propertyKey: "reflectionTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Refraction", target: material, propertyKey: "refractionTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Emissive", target: material, propertyKey: "emissiveTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Bump", target: material, propertyKey: "bumpTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Opacity", target: material, propertyKey: "opacityTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Ambient", target: material, propertyKey: "ambientTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Lightmap", target: material, propertyKey: "lightmapTexture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: TextureSelectorPropertyLine, label: "Detailmap", target: material.detailMap, propertyKey: "texture", scene: scene, onLink: selectEntity, defaultValue: null }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Lightmap as Shadowmap", target: material, propertyKey: "useLightmapAsShadowmap" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Detailmap", target: material.detailMap, propertyKey: "isEnabled" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Decalmap", target: material.decalMap, propertyKey: "isEnabled" })] }));
|
|
6838
|
+
};
|
|
6735
6839
|
/**
|
|
6736
6840
|
* Displays the levels properties of a standard material.
|
|
6737
6841
|
* @param props - The required properties
|
|
@@ -6751,16 +6855,6 @@ const StandardMaterialLightingAndColorProperties = (props) => {
|
|
|
6751
6855
|
const { standardMaterial } = props;
|
|
6752
6856
|
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: Color3PropertyLine, label: "Diffuse Color", target: standardMaterial, propertyKey: "diffuseColor" }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Specular Color", target: standardMaterial, propertyKey: "specularColor" }), jsx(BoundProperty, { component: SyncedSliderPropertyLine, label: "Specular Power", target: standardMaterial, propertyKey: "specularPower", min: 0, max: 128, step: 0.1 }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Emissive Color", target: standardMaterial, propertyKey: "emissiveColor" }), jsx(BoundProperty, { component: Color3PropertyLine, label: "Ambient Color", target: standardMaterial, propertyKey: "ambientColor" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Specular Over Alpha", target: standardMaterial, propertyKey: "useSpecularOverAlpha" })] }));
|
|
6753
6857
|
};
|
|
6754
|
-
/**
|
|
6755
|
-
* Displays the texture properties of a standard material.
|
|
6756
|
-
* @param props - The required properties
|
|
6757
|
-
* @returns A JSX element representing the texture properties.
|
|
6758
|
-
*/
|
|
6759
|
-
const StandardMaterialTexturesProperties = (props) => {
|
|
6760
|
-
const { standardMaterial } = props;
|
|
6761
|
-
// TODO: Add buttons and links for adding the textures themselves
|
|
6762
|
-
return (jsxs(Fragment, { children: [jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Lightmap as Shadowmap", target: standardMaterial, propertyKey: "useLightmapAsShadowmap" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Detailmap", target: standardMaterial.detailMap, propertyKey: "isEnabled" }), jsx(BoundProperty, { component: SwitchPropertyLine, label: "Use Decalmap", target: standardMaterial.decalMap, propertyKey: "isEnabled" })] }));
|
|
6763
|
-
};
|
|
6764
6858
|
|
|
6765
6859
|
const MaterialPropertiesServiceDefinition = {
|
|
6766
6860
|
friendlyName: "Material Properties",
|
|
@@ -6788,9 +6882,17 @@ const MaterialPropertiesServiceDefinition = {
|
|
|
6788
6882
|
key: "Standard Material Properties",
|
|
6789
6883
|
predicate: (entity) => entity instanceof StandardMaterial,
|
|
6790
6884
|
content: [
|
|
6885
|
+
{
|
|
6886
|
+
section: "General",
|
|
6887
|
+
component: ({ context }) => jsx(StandardMaterialGeneralProperties, { material: context }),
|
|
6888
|
+
},
|
|
6889
|
+
{
|
|
6890
|
+
section: "Transparency",
|
|
6891
|
+
component: ({ context }) => jsx(StandardMaterialTransparencyProperties, { material: context }),
|
|
6892
|
+
},
|
|
6791
6893
|
{
|
|
6792
6894
|
section: "Textures",
|
|
6793
|
-
component: ({ context }) => jsx(StandardMaterialTexturesProperties, {
|
|
6895
|
+
component: ({ context }) => jsx(StandardMaterialTexturesProperties, { material: context, selectionService: selectionService }),
|
|
6794
6896
|
},
|
|
6795
6897
|
{
|
|
6796
6898
|
section: "Lighting & Colors",
|
|
@@ -6806,50 +6908,80 @@ const MaterialPropertiesServiceDefinition = {
|
|
|
6806
6908
|
},
|
|
6807
6909
|
],
|
|
6808
6910
|
});
|
|
6911
|
+
const pbrMaterialPropertyChangedObserver = propertiesService.onPropertyChanged.add((changeInfo) => {
|
|
6912
|
+
/**
|
|
6913
|
+
* In Inspector V2, all PBR materials (PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial) are edited using the PBRBaseMaterial properties.
|
|
6914
|
+
* Therefore, when a property of PBRBaseMaterial is changed, we need to mark the material as dirty to ensure the changes are reflected correctly because none of the properties
|
|
6915
|
+
* of PBRBaseMaterial are tagged with a decorator that would automatically mark the material as dirty.
|
|
6916
|
+
*/
|
|
6917
|
+
if (changeInfo.entity instanceof PBRBaseMaterial) {
|
|
6918
|
+
changeInfo.entity.markAsDirty(Material.AllDirtyFlag);
|
|
6919
|
+
}
|
|
6920
|
+
});
|
|
6809
6921
|
const pbrBaseMaterialPropertiesRegistration = propertiesService.addSectionContent({
|
|
6810
6922
|
key: "PBR Base Material Properties",
|
|
6811
6923
|
predicate: (entity) => entity instanceof PBRBaseMaterial,
|
|
6812
6924
|
content: [
|
|
6925
|
+
{
|
|
6926
|
+
section: "General",
|
|
6927
|
+
component: ({ context }) => jsx(PBRBaseMaterialGeneralProperties, { material: context }),
|
|
6928
|
+
},
|
|
6929
|
+
{
|
|
6930
|
+
section: "Transparency",
|
|
6931
|
+
component: ({ context }) => jsx(PBRBaseMaterialTransparencyProperties, { material: context }),
|
|
6932
|
+
},
|
|
6933
|
+
{
|
|
6934
|
+
section: "Textures",
|
|
6935
|
+
component: ({ context }) => jsx(PBRBaseMaterialChannelsProperties, { material: context, selectionService: selectionService }),
|
|
6936
|
+
},
|
|
6937
|
+
{
|
|
6938
|
+
section: "Lighting & Colors",
|
|
6939
|
+
component: ({ context }) => jsx(PBRBaseMaterialLightingAndColorProperties, { material: context }),
|
|
6940
|
+
},
|
|
6941
|
+
{
|
|
6942
|
+
section: "Metallic Workflow",
|
|
6943
|
+
component: ({ context }) => jsx(PBRBaseMaterialMetallicWorkflowProperties, { material: context, selectionService: selectionService }),
|
|
6944
|
+
},
|
|
6813
6945
|
{
|
|
6814
6946
|
section: "Clear Coat",
|
|
6815
|
-
component: ({ context }) => jsx(PBRBaseMaterialClearCoatProperties, { material: context }),
|
|
6947
|
+
component: ({ context }) => jsx(PBRBaseMaterialClearCoatProperties, { material: context, selectionService: selectionService }),
|
|
6816
6948
|
},
|
|
6817
6949
|
{
|
|
6818
6950
|
section: "Iridescence",
|
|
6819
|
-
component: ({ context }) => jsx(PBRBaseMaterialIridescenceProperties, { material: context }),
|
|
6951
|
+
component: ({ context }) => jsx(PBRBaseMaterialIridescenceProperties, { material: context, selectionService: selectionService }),
|
|
6820
6952
|
},
|
|
6821
6953
|
{
|
|
6822
6954
|
section: "Anisotropic",
|
|
6823
|
-
component: ({ context }) => jsx(PBRBaseMaterialAnisotropicProperties, { material: context }),
|
|
6955
|
+
component: ({ context }) => jsx(PBRBaseMaterialAnisotropicProperties, { material: context, selectionService: selectionService }),
|
|
6824
6956
|
},
|
|
6825
6957
|
{
|
|
6826
6958
|
section: "Sheen",
|
|
6827
|
-
component: ({ context }) => jsx(PBRBaseMaterialSheenProperties, { material: context }),
|
|
6959
|
+
component: ({ context }) => jsx(PBRBaseMaterialSheenProperties, { material: context, selectionService: selectionService }),
|
|
6828
6960
|
},
|
|
6829
|
-
],
|
|
6830
|
-
});
|
|
6831
|
-
const pbrMaterialPropertiesRegistration = propertiesService.addSectionContent({
|
|
6832
|
-
key: "PBR Material Properties",
|
|
6833
|
-
predicate: (entity) => entity instanceof PBRMaterial,
|
|
6834
|
-
content: [
|
|
6835
6961
|
{
|
|
6836
|
-
section: "
|
|
6837
|
-
component: ({ context }) => jsx(
|
|
6962
|
+
section: "SubSurface",
|
|
6963
|
+
component: ({ context }) => jsx(PBRBaseMaterialSubSurfaceProperties, { material: context, selectionService: selectionService }),
|
|
6838
6964
|
},
|
|
6839
6965
|
{
|
|
6840
|
-
section: "
|
|
6841
|
-
component: ({ context }) => jsx(
|
|
6966
|
+
section: "Levels",
|
|
6967
|
+
component: ({ context }) => jsx(PBRBaseMaterialLevelProperties, { material: context }),
|
|
6968
|
+
},
|
|
6969
|
+
{
|
|
6970
|
+
section: "Rendering",
|
|
6971
|
+
component: ({ context }) => jsx(PBRBaseMaterialRenderingProperties, { material: context }),
|
|
6842
6972
|
},
|
|
6843
|
-
],
|
|
6844
|
-
});
|
|
6845
|
-
const pbrMaterialNormalMapsContentRegistration = propertiesService.addSectionContent({
|
|
6846
|
-
key: "PBR Material Normal Map Properties",
|
|
6847
|
-
predicate: (entity) => entity instanceof PBRMaterial || entity instanceof PBRBaseSimpleMaterial,
|
|
6848
|
-
content: [
|
|
6849
6973
|
{
|
|
6850
6974
|
section: "Normal Map",
|
|
6851
6975
|
component: ({ context }) => jsx(NormalMapProperties, { material: context }),
|
|
6852
6976
|
},
|
|
6977
|
+
{
|
|
6978
|
+
section: "Advanced",
|
|
6979
|
+
component: ({ context }) => jsx(PBRBaseMaterialAdvancedProperties, { material: context }),
|
|
6980
|
+
},
|
|
6981
|
+
{
|
|
6982
|
+
section: "Debug",
|
|
6983
|
+
component: ({ context }) => jsx(PBRBaseMaterialDebugProperties, { material: context }),
|
|
6984
|
+
},
|
|
6853
6985
|
],
|
|
6854
6986
|
});
|
|
6855
6987
|
const openPBRMaterialPropertiesRegistration = propertiesService.addSectionContent({
|
|
@@ -6908,11 +7040,10 @@ const MaterialPropertiesServiceDefinition = {
|
|
|
6908
7040
|
});
|
|
6909
7041
|
return {
|
|
6910
7042
|
dispose: () => {
|
|
7043
|
+
pbrMaterialPropertyChangedObserver.remove();
|
|
6911
7044
|
materialContentRegistration.dispose();
|
|
6912
7045
|
standardMaterialContentRegistration.dispose();
|
|
6913
7046
|
pbrBaseMaterialPropertiesRegistration.dispose();
|
|
6914
|
-
pbrMaterialPropertiesRegistration.dispose();
|
|
6915
|
-
pbrMaterialNormalMapsContentRegistration.dispose();
|
|
6916
7047
|
openPBRMaterialPropertiesRegistration.dispose();
|
|
6917
7048
|
skyMaterialRegistration.dispose();
|
|
6918
7049
|
multiMaterialContentRegistration.dispose();
|
|
@@ -13221,4 +13352,4 @@ const TextAreaPropertyLine = (props) => {
|
|
|
13221
13352
|
AttachDebugLayer();
|
|
13222
13353
|
|
|
13223
13354
|
export { useSidePaneDockOverrides as $, Accordion as A, ButtonLine as B, Collapse as C, DebugServiceIdentity as D, ExtensibleAccordion as E, FileUploadLine as F, useVector3Property as G, useColor3Property as H, Inspector as I, useColor4Property as J, useQuaternionProperty as K, Link as L, MakeLazyComponent as M, NumberDropdownPropertyLine as N, MakePropertyHook as O, Popover as P, useInterceptObservable as Q, useEventfulState as R, SwitchPropertyLine as S, ToolsServiceIdentity as T, useObservableCollection as U, Vector3PropertyLine as V, useOrderedObservableCollection as W, usePollingObservable as X, useResource as Y, useAsyncResource as Z, useCompactMode as _, SyncedSliderPropertyLine as a, useAngleConverters as a0, MakeTeachingMoment as a1, MakeDialogTeachingMoment as a2, InterceptFunction as a3, GetPropertyDescriptor as a4, IsPropertyReadonly as a5, InterceptProperty as a6, ObservableCollection as a7, ConstructorFactory as a8, SelectionServiceIdentity as a9, TextInput as aA, ToggleButton as aB, ChildWindow as aC, FactorGradientList as aD, Color3GradientList as aE, Color4GradientList as aF, Pane as aG, BooleanBadgePropertyLine as aH, Color3PropertyLine as aI, Color4PropertyLine as aJ, HexPropertyLine as aK, NumberInputPropertyLine as aL, LinkPropertyLine as aM, PropertyLine as aN, LineContainer as aO, PlaceholderPropertyLine as aP, StringifiedPropertyLine as aQ, TextAreaPropertyLine as aR, TextPropertyLine as aS, RotationVectorPropertyLine as aT, QuaternionPropertyLine as aU, Vector2PropertyLine as aV, Vector4PropertyLine as aW, SelectionServiceDefinition as aa, SettingsContextIdentity as ab, ShowInspector as ac, Checkbox as ad, ColorPickerPopup as ae, InputHexField as af, InputHsvField as ag, ComboBox as ah, DraggableLine as ai, Dropdown as aj, NumberDropdown as ak, StringDropdown as al, FactorGradientComponent as am, Color3GradientComponent as an, Color4GradientComponent as ao, ColorStepGradientComponent as ap, InfoLabel as aq, List as ar, MessageBar as as, PositionedPopover as at, SearchBar as au, SearchBox as av, SpinButton as aw, Switch as ax, SyncedSliderInput as ay, Textarea as az, Button as b, TextInputPropertyLine as c, SpinButtonPropertyLine as d, CheckboxPropertyLine as e, ShellServiceIdentity as f, SceneContextIdentity as g, AccordionSection as h, useExtensionManager as i, MakePopoverTeachingMoment as j, TeachingMoment as k, SidePaneContainer as l, PropertiesServiceIdentity as m, SceneExplorerServiceIdentity as n, SettingsServiceIdentity as o, StatsServiceIdentity as p, ConvertOptions as q, AttachDebugLayer as r, DetachDebugLayer as s, StringDropdownPropertyLine as t, useObservableState as u, BoundProperty as v, LinkToEntityPropertyLine as w, Theme as x, BuiltInsExtensionFeed as y, useProperty as z };
|
|
13224
|
-
//# sourceMappingURL=index-
|
|
13355
|
+
//# sourceMappingURL=index-D450kD0o.js.map
|