@babylonjs/core 5.2.0 → 5.5.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.
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +7 -0
- package/Behaviors/Cameras/autoRotationBehavior.js +15 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +1 -0
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/skeleton.js +2 -0
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/camera.d.ts +2 -1
- package/Cameras/camera.js +4 -1
- package/Cameras/camera.js.map +1 -1
- package/DeviceInput/Helpers/eventFactory.js +14 -3
- package/DeviceInput/Helpers/eventFactory.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js +2 -8
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +4 -2
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +1 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +13 -9
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +1 -1
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +2 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +28 -17
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.d.ts +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +3 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.d.ts +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureHelper.js +16 -3
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +1 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +48 -32
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +1 -0
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +4 -2
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +5 -5
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +3 -2
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +3 -3
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +4 -0
- package/Lights/Shadows/shadowGenerator.js +5 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -3
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/TBNBlock.d.ts +47 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js +154 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js.map +1 -0
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +5 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +20 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +2 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +6 -5
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +9 -9
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +3 -0
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -1
- package/Materials/Textures/renderTargetTexture.js +24 -20
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +2 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/materialHelper.js +1 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/shaderMaterial.js +1 -0
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +2 -1
- package/Materials/uniformBuffer.js +2 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.d.ts +4 -0
- package/Maths/math.vector.js +12 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/instancedMesh.js +0 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +34 -5
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +3 -2
- package/Misc/sceneOptimizer.js +4 -1
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.js +6 -6
- package/Misc/screenshotTools.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +6 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/renderingGroup.js +8 -0
- package/Rendering/renderingGroup.js.map +1 -1
- package/Shaders/pbr.vertex.js +1 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +1 -1
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +3 -1
- package/scene.js +9 -5
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrMaterial.ts"],"names":[],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,gBAAgB,CAAC,kCAAkC,CAAC;2DACnB;IASlC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;mEACX;IAQ1C;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;4DACnB;IAQlC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;6DAClB;IAOnC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,8BAA8B,CAAC;8CAC5B;IAiNzB,kBAAC;CAAA,AA1yBD,CAAiC,eAAe,GA0yB/C;SA1yBY,WAAW;AA4yBxB,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { GetEnvironmentBRDFTexture } from \"../../Misc/brdfTextureTools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport type { ImageProcessingConfiguration } from \"../../Materials/imageProcessingConfiguration\";\r\nimport type { ColorCurves } from \"../../Materials/colorCurves\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\n\r\n/**\r\n * The Physically based material of BJS.\r\n *\r\n * This offers the main features of a standard PBR material.\r\n * For more information, please refer to the documentation :\r\n * https://doc.babylonjs.com/how_to/physically_based_rendering\r\n */\r\nexport class PBRMaterial extends PBRBaseMaterial {\r\n /**\r\n * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.\r\n */\r\n public static readonly PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.\r\n */\r\n public static readonly PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n */\r\n public static readonly PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n * They are also discarded below the alpha cutoff threshold to improve performances.\r\n */\r\n public static readonly PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND;\r\n\r\n /**\r\n * Defines the default value of how much AO map is occluding the analytical lights\r\n * (point spot...).\r\n */\r\n public static DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Intensity of the direct lights e.g. the four lights available in your scene.\r\n * This impacts both the direct diffuse and specular highlights.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public directIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the emissive part of the material.\r\n * This helps controlling the emissive effect without modifying the emissive color.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the environment e.g. how much the environment will light the object\r\n * either through harmonics for rough material or through the reflection for shiny ones.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentIntensity: number = 1.0;\r\n\r\n /**\r\n * This is a special control allowing the reduction of the specular highlights coming from the\r\n * four lights of the scene. Those highlights may not be needed in full environment lighting.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public specularIntensity: number = 1.0;\r\n\r\n /**\r\n * Debug Control allowing disabling the bump map on this material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public disableBumpMap: boolean = false;\r\n\r\n /**\r\n * AKA Diffuse Texture in standard nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoTexture: BaseTexture;\r\n\r\n /**\r\n * AKA Occlusion Texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTexture: BaseTexture;\r\n\r\n /**\r\n * AKA Occlusion Texture Intensity in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureStrength: number = 1.0;\r\n\r\n /**\r\n * Defines how much the AO map is occluding the analytical lights (point spot...).\r\n * 1 means it completely occludes it\r\n * 0 mean it has no impact\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureImpactOnAnalyticalLights: number = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Stores the alpha values in a texture. Use luminance if texture.getAlphaFromRGB is true.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public opacityTexture: BaseTexture;\r\n\r\n /**\r\n * Stores the reflection values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the emissive values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveTexture: BaseTexture;\r\n\r\n /**\r\n * AKA Specular texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityTexture: BaseTexture;\r\n\r\n /**\r\n * Used to switch from specular/glossiness to metallic/roughness workflow.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicTexture: BaseTexture;\r\n\r\n /**\r\n * Specifies the metallic scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the metalness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallic: Nullable<number>;\r\n\r\n /**\r\n * Specifies the roughness scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the roughness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public roughness: Nullable<number>;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 factor to help configuring the material F0.\r\n * By default the indexOfrefraction is used to compute F0;\r\n *\r\n * This is used as a factor against the default reflectance at normal incidence to tweak it.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicF0Factor = 1;\r\n\r\n /**\r\n * In metallic workflow, specifies an F90 color to help configuring the material F90.\r\n * By default the F90 is always 1;\r\n *\r\n * Please note that this factor is also used as a factor against the default reflectance at normal incidence.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serializeAsColor3()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceColor = Color3.White();\r\n\r\n /**\r\n * Specifies that only the A channel from metallicReflectanceTexture should be used.\r\n * If false, both RGB and A channels will be used\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n\r\n /**\r\n * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A\r\n * This is multiplied against the scalar values defined in the material.\r\n * If useOnlyMetallicFromMetallicReflectanceTexture is true, don't use the RGB channels, only A\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Defines to store reflectanceColor in RGB\r\n * This is multiplied against the scalar values defined in the material.\r\n * If both reflectanceTexture and metallicReflectanceTexture textures are provided and useOnlyMetallicFromMetallicReflectanceTexture\r\n * is false, metallicReflectanceTexture takes priority and reflectanceTexture is not used\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.\r\n * Gray Scale represents roughness in metallic mode and glossiness in specular mode.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurfaceTexture: BaseTexture;\r\n\r\n /**\r\n * Stores surface normal data used to displace a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: BaseTexture;\r\n\r\n /**\r\n * Stores the pre-calculated light information of a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)\r\n public lightmapTexture: BaseTexture;\r\n\r\n /**\r\n * Stores the refracted light information in a texture.\r\n */\r\n public get refractionTexture(): Nullable<BaseTexture> {\r\n return this.subSurface.refractionTexture;\r\n }\r\n public set refractionTexture(value: Nullable<BaseTexture>) {\r\n this.subSurface.refractionTexture = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n } else if (!this.subSurface.linkRefractionWithTransparency) {\r\n this.subSurface.isRefractionEnabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * The color of a material in ambient lighting.\r\n */\r\n @serializeAsColor3(\"ambient\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Diffuse Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"albedo\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * AKA Specular Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"reflectivity\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * The color reflected from the material.\r\n */\r\n @serializeAsColor3(\"reflection\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionColor = new Color3(1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The color emitted from the material.\r\n */\r\n @serializeAsColor3(\"emissive\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Glossiness in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurface = 1.0;\r\n\r\n /**\r\n * Index of refraction of the material base layer.\r\n * https://en.wikipedia.org/wiki/List_of_refractive_indices\r\n *\r\n * This does not only impact refraction but also the Base F0 of Dielectric Materials.\r\n *\r\n * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))\r\n */\r\n public get indexOfRefraction(): number {\r\n return this.subSurface.indexOfRefraction;\r\n }\r\n public set indexOfRefraction(value: number) {\r\n this.subSurface.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\r\n */\r\n public get invertRefractionY(): boolean {\r\n return this.subSurface.invertRefractionY;\r\n }\r\n public set invertRefractionY(value: boolean) {\r\n this.subSurface.invertRefractionY = value;\r\n }\r\n\r\n /**\r\n * This parameters will make the material used its opacity to control how much it is refracting against not.\r\n * Materials half opaque for instance using refraction could benefit from this control.\r\n */\r\n public get linkRefractionWithTransparency(): boolean {\r\n return this.subSurface.linkRefractionWithTransparency;\r\n }\r\n public set linkRefractionWithTransparency(value: boolean) {\r\n this.subSurface.linkRefractionWithTransparency = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n }\r\n }\r\n\r\n /**\r\n * If true, the light map contains occlusion information instead of lighting info.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLightmapAsShadowmap = false;\r\n\r\n /**\r\n * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public useAlphaFromAlbedoTexture = false;\r\n\r\n /**\r\n * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public forceAlphaTest = false;\r\n\r\n /**\r\n * Defines the alpha limits in alpha test mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public alphaCutOff = 0.4;\r\n\r\n /**\r\n * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When sun reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useSpecularOverAlpha = true;\r\n\r\n /**\r\n * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMicroSurfaceFromReflectivityMapAlpha = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureAlpha = true;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its green channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureGreen = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the metallness information in its blue channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMetallnessFromMetallicTextureBlue = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the ambient occlusion information in its red channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientOcclusionFromMetallicTextureRed = false;\r\n\r\n /**\r\n * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientInGrayScale = false;\r\n\r\n /**\r\n * In case the reflectivity map does not contain the microsurface information in its alpha channel,\r\n * The material will try to infer what glossiness each pixel should be.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAutoMicroSurfaceFromReflectivityMap = false;\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n @serialize()\r\n public get usePhysicalLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n }\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n public set usePhysicalLightFalloff(value: boolean) {\r\n if (value !== this.usePhysicalLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n @serialize()\r\n public get useGLTFLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n public set useGLTFLightFalloff(value: boolean) {\r\n if (value !== this.useGLTFLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOverAlpha = true;\r\n\r\n /**\r\n * Allows using an object space normal map (instead of tangent space).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useObjectSpaceNormalMap = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallax = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax occlusion mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallaxOcclusion = false;\r\n\r\n /**\r\n * Controls the scale bias of the parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public parallaxScaleBias = 0.05;\r\n\r\n /**\r\n * If sets to true, disables all the lights affecting the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting = false;\r\n\r\n /**\r\n * Force the shader to compute irradiance in the fragment shader in order to take bump in account.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceIrradianceInFragment = false;\r\n\r\n /**\r\n * Number of Simultaneous lights allowed on the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights = 4;\r\n\r\n /**\r\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapX = false;\r\n\r\n /**\r\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapY = false;\r\n\r\n /**\r\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public twoSidedLighting = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAlphaFresnel = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLinearAlphaFresnel = false;\r\n\r\n /**\r\n * Let user defines the brdf lookup texture used for IBL.\r\n * A default 8bit version is embedded but you could point at :\r\n * * Default texture: https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png\r\n * * Default 16bit pixel depth texture: https://assets.babylonjs.com/environments/correlatedMSBRDF.dds\r\n * * LEGACY Default None correlated https://assets.babylonjs.com/environments/uncorrelatedBRDF_RGBD.png\r\n * * LEGACY Default None correlated 16bit pixel depth https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds\r\n */\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentBRDFTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Force normal to face away from face.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceNormalForward = false;\r\n\r\n /**\r\n * Enables specular anti aliasing in the PBR shader.\r\n * It will both interacts on the Geometry for analytical and IBL lighting.\r\n * It also prefilter the roughness map based on the bump values.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public enableSpecularAntiAliasing = false;\r\n\r\n /**\r\n * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal\r\n * makes the reflect vector face the model (under horizon).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useHorizonOcclusion = true;\r\n\r\n /**\r\n * This parameters will enable/disable radiance occlusion by preventing the radiance to lit\r\n * too much the area relying on ambient texture to define their ambient occlusion.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOcclusion = true;\r\n\r\n /**\r\n * If set to true, no lighting calculations will be applied.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public unlit = false;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._attachImageProcessingConfiguration(value);\r\n\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get cameraColorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set cameraColorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get cameraColorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set cameraColorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get cameraToneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set cameraToneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public get cameraExposure(): number {\r\n return this._imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public set cameraExposure(value: number) {\r\n this._imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets The camera contrast used on this material.\r\n */\r\n public get cameraContrast(): number {\r\n return this._imageProcessingConfiguration.contrast;\r\n }\r\n\r\n /**\r\n * Sets The camera contrast used on this material.\r\n */\r\n public set cameraContrast(value: number) {\r\n this._imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets the Color Grading 2D Lookup Texture.\r\n */\r\n public get cameraColorGradingTexture(): Nullable<BaseTexture> {\r\n return this._imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets the Color Grading 2D Lookup Texture.\r\n */\r\n public set cameraColorGradingTexture(value: Nullable<BaseTexture>) {\r\n this._imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public get cameraColorCurves(): Nullable<ColorCurves> {\r\n return this._imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public set cameraColorCurves(value: Nullable<ColorCurves>) {\r\n this._imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new PBRMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n */\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n\r\n this._environmentBRDFTexture = GetEnvironmentBRDFTexture(this.getScene());\r\n }\r\n\r\n /**\r\n * Returns the name of this material class.\r\n */\r\n public getClassName(): string {\r\n return \"PBRMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n */\r\n public clone(name: string): PBRMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRMaterial(name, this.getScene()), this);\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.stencil.copyTo(clone.stencil);\r\n this.clearCoat.copyTo(clone.clearCoat);\r\n this.anisotropy.copyTo(clone.anisotropy);\r\n this.brdf.copyTo(clone.brdf);\r\n this.sheen.copyTo(clone.sheen);\r\n this.subSurface.copyTo(clone.subSurface);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this PBR Material.\r\n * @returns - An object with the serialized material.\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.PBRMaterial\";\r\n\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n serializationObject.brdf = this.brdf.serialize();\r\n serializationObject.sheen = this.sheen.serialize();\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Parses a PBR Material from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene - BJS scene instance.\r\n * @param rootUrl - url for the scene object\r\n * @returns - PBRMaterial\r\n */\r\n public static Parse(source: any, scene: Scene, rootUrl: string): PBRMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);\r\n if (source.stencil) {\r\n material.stencil.parse(source.stencil, scene, rootUrl);\r\n }\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMaterial\", PBRMaterial);\r\n"]}
|
|
1
|
+
{"version":3,"file":"pbrMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChI,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;GAMG;AACH;IAAiC,+BAAe;IAotB5C;;;;;OAKG;IACH,qBAAY,IAAY,EAAE,KAAa;QAAvC,YACI,kBAAM,IAAI,EAAE,KAAK,CAAC,SAGrB;QAlsBD;;;WAGG;QAGI,qBAAe,GAAW,GAAG,CAAC;QAErC;;;WAGG;QAGI,uBAAiB,GAAW,GAAG,CAAC;QAEvC;;;WAGG;QAGI,0BAAoB,GAAW,GAAG,CAAC;QAE1C;;;WAGG;QAGI,uBAAiB,GAAW,GAAG,CAAC;QAEvC;;WAEG;QAGI,oBAAc,GAAY,KAAK,CAAC;QAgBvC;;WAEG;QAGI,4BAAsB,GAAW,GAAG,CAAC;QAE5C;;;;WAIG;QAGI,4CAAsC,GAAW,WAAW,CAAC,+BAA+B,CAAC;QAqDpG;;;;;;;;WAQG;QAGI,sBAAgB,GAAG,CAAC,CAAC;QAE5B;;;;;;;;WAQG;QAGI,8BAAwB,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAEjD;;;WAGG;QAGI,mDAA6C,GAAG,KA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QACX,gBAAgB,CAAC,kCAAkC,CAAC;yDACrB;IAQhC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;wDACtB;IAQ/B;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;8DAChB;IAWrC;QADC,gBAAgB,CAAC,kCAAkC,CAAC;+DACO;IAO5D;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;2DACnB;IASlC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;mEACX;IAQ1C;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;4DACnB;IAQlC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;6DAClB;IAOnC;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,8BAA8B,CAAC;8CAC5B;IAiNzB,kBAAC;CAAA,AA1yBD,CAAiC,eAAe,GA0yB/C;SA1yBY,WAAW;AA4yBxB,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { GetEnvironmentBRDFTexture } from \"../../Misc/brdfTextureTools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport type { ImageProcessingConfiguration } from \"../../Materials/imageProcessingConfiguration\";\r\nimport type { ColorCurves } from \"../../Materials/colorCurves\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\n\r\n/**\r\n * The Physically based material of BJS.\r\n *\r\n * This offers the main features of a standard PBR material.\r\n * For more information, please refer to the documentation :\r\n * https://doc.babylonjs.com/how_to/physically_based_rendering\r\n */\r\nexport class PBRMaterial extends PBRBaseMaterial {\r\n /**\r\n * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.\r\n */\r\n public static readonly PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.\r\n */\r\n public static readonly PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n */\r\n public static readonly PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n * They are also discarded below the alpha cutoff threshold to improve performances.\r\n */\r\n public static readonly PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND;\r\n\r\n /**\r\n * Defines the default value of how much AO map is occluding the analytical lights\r\n * (point spot...).\r\n */\r\n public static DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Intensity of the direct lights e.g. the four lights available in your scene.\r\n * This impacts both the direct diffuse and specular highlights.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public directIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the emissive part of the material.\r\n * This helps controlling the emissive effect without modifying the emissive color.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the environment e.g. how much the environment will light the object\r\n * either through harmonics for rough material or through the reflection for shiny ones.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentIntensity: number = 1.0;\r\n\r\n /**\r\n * This is a special control allowing the reduction of the specular highlights coming from the\r\n * four lights of the scene. Those highlights may not be needed in full environment lighting.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public specularIntensity: number = 1.0;\r\n\r\n /**\r\n * Debug Control allowing disabling the bump map on this material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public disableBumpMap: boolean = false;\r\n\r\n /**\r\n * AKA Diffuse Texture in standard nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture Intensity in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureStrength: number = 1.0;\r\n\r\n /**\r\n * Defines how much the AO map is occluding the analytical lights (point spot...).\r\n * 1 means it completely occludes it\r\n * 0 mean it has no impact\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureImpactOnAnalyticalLights: number = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Stores the alpha values in a texture. Use luminance if texture.getAlphaFromRGB is true.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public opacityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the reflection values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the emissive values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Specular texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to switch from specular/glossiness to metallic/roughness workflow.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies the metallic scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the metalness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallic: Nullable<number>;\r\n\r\n /**\r\n * Specifies the roughness scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the roughness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public roughness: Nullable<number>;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 factor to help configuring the material F0.\r\n * By default the indexOfrefraction is used to compute F0;\r\n *\r\n * This is used as a factor against the default reflectance at normal incidence to tweak it.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicF0Factor = 1;\r\n\r\n /**\r\n * In metallic workflow, specifies an F90 color to help configuring the material F90.\r\n * By default the F90 is always 1;\r\n *\r\n * Please note that this factor is also used as a factor against the default reflectance at normal incidence.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serializeAsColor3()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceColor = Color3.White();\r\n\r\n /**\r\n * Specifies that only the A channel from metallicReflectanceTexture should be used.\r\n * If false, both RGB and A channels will be used\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n\r\n /**\r\n * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A\r\n * This is multiplied against the scalar values defined in the material.\r\n * If useOnlyMetallicFromMetallicReflectanceTexture is true, don't use the RGB channels, only A\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Defines to store reflectanceColor in RGB\r\n * This is multiplied against the scalar values defined in the material.\r\n * If both reflectanceTexture and metallicReflectanceTexture textures are provided and useOnlyMetallicFromMetallicReflectanceTexture\r\n * is false, metallicReflectanceTexture takes priority and reflectanceTexture is not used\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.\r\n * Gray Scale represents roughness in metallic mode and glossiness in specular mode.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurfaceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores surface normal data used to displace a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the pre-calculated light information of a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)\r\n public lightmapTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the refracted light information in a texture.\r\n */\r\n public get refractionTexture(): Nullable<BaseTexture> {\r\n return this.subSurface.refractionTexture;\r\n }\r\n public set refractionTexture(value: Nullable<BaseTexture>) {\r\n this.subSurface.refractionTexture = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n } else if (!this.subSurface.linkRefractionWithTransparency) {\r\n this.subSurface.isRefractionEnabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * The color of a material in ambient lighting.\r\n */\r\n @serializeAsColor3(\"ambient\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Diffuse Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"albedo\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * AKA Specular Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"reflectivity\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * The color reflected from the material.\r\n */\r\n @serializeAsColor3(\"reflection\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionColor = new Color3(1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The color emitted from the material.\r\n */\r\n @serializeAsColor3(\"emissive\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Glossiness in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurface = 1.0;\r\n\r\n /**\r\n * Index of refraction of the material base layer.\r\n * https://en.wikipedia.org/wiki/List_of_refractive_indices\r\n *\r\n * This does not only impact refraction but also the Base F0 of Dielectric Materials.\r\n *\r\n * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))\r\n */\r\n public get indexOfRefraction(): number {\r\n return this.subSurface.indexOfRefraction;\r\n }\r\n public set indexOfRefraction(value: number) {\r\n this.subSurface.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\r\n */\r\n public get invertRefractionY(): boolean {\r\n return this.subSurface.invertRefractionY;\r\n }\r\n public set invertRefractionY(value: boolean) {\r\n this.subSurface.invertRefractionY = value;\r\n }\r\n\r\n /**\r\n * This parameters will make the material used its opacity to control how much it is refracting against not.\r\n * Materials half opaque for instance using refraction could benefit from this control.\r\n */\r\n public get linkRefractionWithTransparency(): boolean {\r\n return this.subSurface.linkRefractionWithTransparency;\r\n }\r\n public set linkRefractionWithTransparency(value: boolean) {\r\n this.subSurface.linkRefractionWithTransparency = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n }\r\n }\r\n\r\n /**\r\n * If true, the light map contains occlusion information instead of lighting info.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLightmapAsShadowmap = false;\r\n\r\n /**\r\n * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public useAlphaFromAlbedoTexture = false;\r\n\r\n /**\r\n * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public forceAlphaTest = false;\r\n\r\n /**\r\n * Defines the alpha limits in alpha test mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public alphaCutOff = 0.4;\r\n\r\n /**\r\n * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When sun reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useSpecularOverAlpha = true;\r\n\r\n /**\r\n * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMicroSurfaceFromReflectivityMapAlpha = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureAlpha = true;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its green channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureGreen = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the metallness information in its blue channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMetallnessFromMetallicTextureBlue = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the ambient occlusion information in its red channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientOcclusionFromMetallicTextureRed = false;\r\n\r\n /**\r\n * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientInGrayScale = false;\r\n\r\n /**\r\n * In case the reflectivity map does not contain the microsurface information in its alpha channel,\r\n * The material will try to infer what glossiness each pixel should be.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAutoMicroSurfaceFromReflectivityMap = false;\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n @serialize()\r\n public get usePhysicalLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n }\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n public set usePhysicalLightFalloff(value: boolean) {\r\n if (value !== this.usePhysicalLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n @serialize()\r\n public get useGLTFLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n public set useGLTFLightFalloff(value: boolean) {\r\n if (value !== this.useGLTFLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOverAlpha = true;\r\n\r\n /**\r\n * Allows using an object space normal map (instead of tangent space).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useObjectSpaceNormalMap = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallax = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax occlusion mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallaxOcclusion = false;\r\n\r\n /**\r\n * Controls the scale bias of the parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public parallaxScaleBias = 0.05;\r\n\r\n /**\r\n * If sets to true, disables all the lights affecting the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting = false;\r\n\r\n /**\r\n * Force the shader to compute irradiance in the fragment shader in order to take bump in account.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceIrradianceInFragment = false;\r\n\r\n /**\r\n * Number of Simultaneous lights allowed on the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights = 4;\r\n\r\n /**\r\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapX = false;\r\n\r\n /**\r\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapY = false;\r\n\r\n /**\r\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public twoSidedLighting = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAlphaFresnel = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLinearAlphaFresnel = false;\r\n\r\n /**\r\n * Let user defines the brdf lookup texture used for IBL.\r\n * A default 8bit version is embedded but you could point at :\r\n * * Default texture: https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png\r\n * * Default 16bit pixel depth texture: https://assets.babylonjs.com/environments/correlatedMSBRDF.dds\r\n * * LEGACY Default None correlated https://assets.babylonjs.com/environments/uncorrelatedBRDF_RGBD.png\r\n * * LEGACY Default None correlated 16bit pixel depth https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds\r\n */\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentBRDFTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Force normal to face away from face.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceNormalForward = false;\r\n\r\n /**\r\n * Enables specular anti aliasing in the PBR shader.\r\n * It will both interacts on the Geometry for analytical and IBL lighting.\r\n * It also prefilter the roughness map based on the bump values.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public enableSpecularAntiAliasing = false;\r\n\r\n /**\r\n * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal\r\n * makes the reflect vector face the model (under horizon).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useHorizonOcclusion = true;\r\n\r\n /**\r\n * This parameters will enable/disable radiance occlusion by preventing the radiance to lit\r\n * too much the area relying on ambient texture to define their ambient occlusion.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOcclusion = true;\r\n\r\n /**\r\n * If set to true, no lighting calculations will be applied.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public unlit = false;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._attachImageProcessingConfiguration(value);\r\n\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get cameraColorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set cameraColorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get cameraColorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set cameraColorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get cameraToneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set cameraToneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public get cameraExposure(): number {\r\n return this._imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public set cameraExposure(value: number) {\r\n this._imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets The camera contrast used on this material.\r\n */\r\n public get cameraContrast(): number {\r\n return this._imageProcessingConfiguration.contrast;\r\n }\r\n\r\n /**\r\n * Sets The camera contrast used on this material.\r\n */\r\n public set cameraContrast(value: number) {\r\n this._imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets the Color Grading 2D Lookup Texture.\r\n */\r\n public get cameraColorGradingTexture(): Nullable<BaseTexture> {\r\n return this._imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets the Color Grading 2D Lookup Texture.\r\n */\r\n public set cameraColorGradingTexture(value: Nullable<BaseTexture>) {\r\n this._imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public get cameraColorCurves(): Nullable<ColorCurves> {\r\n return this._imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public set cameraColorCurves(value: Nullable<ColorCurves>) {\r\n this._imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new PBRMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n */\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n\r\n this._environmentBRDFTexture = GetEnvironmentBRDFTexture(this.getScene());\r\n }\r\n\r\n /**\r\n * Returns the name of this material class.\r\n */\r\n public getClassName(): string {\r\n return \"PBRMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n */\r\n public clone(name: string): PBRMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRMaterial(name, this.getScene()), this);\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.stencil.copyTo(clone.stencil);\r\n this.clearCoat.copyTo(clone.clearCoat);\r\n this.anisotropy.copyTo(clone.anisotropy);\r\n this.brdf.copyTo(clone.brdf);\r\n this.sheen.copyTo(clone.sheen);\r\n this.subSurface.copyTo(clone.subSurface);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this PBR Material.\r\n * @returns - An object with the serialized material.\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.PBRMaterial\";\r\n\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n serializationObject.brdf = this.brdf.serialize();\r\n serializationObject.sheen = this.sheen.serialize();\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Parses a PBR Material from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene - BJS scene instance.\r\n * @param rootUrl - url for the scene object\r\n * @returns - PBRMaterial\r\n */\r\n public static Parse(source: any, scene: Scene, rootUrl: string): PBRMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);\r\n if (source.stencil) {\r\n material.stencil.parse(source.stencil, scene, rootUrl);\r\n }\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMaterial\", PBRMaterial);\r\n"]}
|
|
@@ -2,6 +2,7 @@ import type { Scene } from "../../scene";
|
|
|
2
2
|
import type { Color3 } from "../../Maths/math.color";
|
|
3
3
|
import type { BaseTexture } from "../../Materials/Textures/baseTexture";
|
|
4
4
|
import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
|
|
5
|
+
import { Nullable } from "../../types";
|
|
5
6
|
/**
|
|
6
7
|
* The PBR material of BJS following the metal roughness convention.
|
|
7
8
|
*
|
|
@@ -20,7 +21,7 @@ export declare class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial
|
|
|
20
21
|
* Base texture of the metallic workflow. It contains both the baseColor information in RGB as
|
|
21
22
|
* well as opacity information in the alpha channel.
|
|
22
23
|
*/
|
|
23
|
-
baseTexture: BaseTexture
|
|
24
|
+
baseTexture: Nullable<BaseTexture>;
|
|
24
25
|
/**
|
|
25
26
|
* Specifies the metallic scalar value of the material.
|
|
26
27
|
* Can also be used to scale the metalness values of the metallic texture.
|
|
@@ -35,7 +36,7 @@ export declare class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial
|
|
|
35
36
|
* Texture containing both the metallic value in the B channel and the
|
|
36
37
|
* roughness value in the G channel to keep better precision.
|
|
37
38
|
*/
|
|
38
|
-
metallicRoughnessTexture: BaseTexture
|
|
39
|
+
metallicRoughnessTexture: Nullable<BaseTexture>;
|
|
39
40
|
/**
|
|
40
41
|
* Instantiates a new PBRMetalRoughnessMaterial instance.
|
|
41
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrMetallicRoughnessMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrMetallicRoughnessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pbrMetallicRoughnessMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrMetallicRoughnessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;GAKG;AACH;IAAkD,gDAAqB;IA2CnE;;;;;OAKG;IACH,sCAAY,IAAY,EAAE,KAAa;QAAvC,YACI,kBAAM,IAAI,EAAE,KAAK,CAAC,SAMrB;QALG,KAAI,CAAC,qCAAqC,GAAG,KAAK,CAAC;QACnD,KAAI,CAAC,qCAAqC,GAAG,IAAI,CAAC;QAClD,KAAI,CAAC,qCAAqC,GAAG,IAAI,CAAC;QAClD,KAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,KAAI,CAAC,SAAS,GAAG,GAAG,CAAC;;IACzB,CAAC;IAED;;OA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,gBAAgB,CAAC;qEAC7B;IAQ1C;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;kEAC7B;IAQxB;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;mEAC5B;IAQzB;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;kFAClB;IAoF3D,mCAAC;CAAA,AA7HD,CAAkD,qBAAqB,GA6HtE;SA7HY,4BAA4B;AA+HzC,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseSimpleMaterial } from \"./pbrBaseSimpleMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { Nullable } from \"../../types\";\r\n\r\n/**\r\n * The PBR material of BJS following the metal roughness convention.\r\n *\r\n * This fits to the PBR convention in the GLTF definition:\r\n * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness\r\n */\r\nexport class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial {\r\n /**\r\n * The base color has two different interpretations depending on the value of metalness.\r\n * When the material is a metal, the base color is the specific measured reflectance value\r\n * at normal incidence (F0). For a non-metal the base color represents the reflected diffuse color\r\n * of the material.\r\n */\r\n @serializeAsColor3()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")\r\n public baseColor: Color3;\r\n\r\n /**\r\n * Base texture of the metallic workflow. It contains both the baseColor information in RGB as\r\n * well as opacity information in the alpha channel.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")\r\n public baseTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies the metallic scalar value of the material.\r\n * Can also be used to scale the metalness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallic: number;\r\n\r\n /**\r\n * Specifies the roughness scalar value of the material.\r\n * Can also be used to scale the roughness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public roughness: number;\r\n\r\n /**\r\n * Texture containing both the metallic value in the B channel and the\r\n * roughness value in the G channel to keep better precision.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_metallicTexture\")\r\n public metallicRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Instantiates a new PBRMetalRoughnessMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n */\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this._useRoughnessFromMetallicTextureAlpha = false;\r\n this._useRoughnessFromMetallicTextureGreen = true;\r\n this._useMetallnessFromMetallicTextureBlue = true;\r\n this.metallic = 1.0;\r\n this.roughness = 1.0;\r\n }\r\n\r\n /**\r\n * Return the current class name of the material.\r\n */\r\n public getClassName(): string {\r\n return \"PBRMetallicRoughnessMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n */\r\n public clone(name: string): PBRMetallicRoughnessMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRMetallicRoughnessMaterial(name, this.getScene()), this);\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.clearCoat.copyTo(clone.clearCoat);\r\n this.anisotropy.copyTo(clone.anisotropy);\r\n this.brdf.copyTo(clone.brdf);\r\n this.sheen.copyTo(clone.sheen);\r\n this.subSurface.copyTo(clone.subSurface);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize the material to a parsable JSON object.\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.PBRMetallicRoughnessMaterial\";\r\n\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n serializationObject.brdf = this.brdf.serialize();\r\n serializationObject.sheen = this.sheen.serialize();\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a JSON object corresponding to the serialize function.\r\n * @param source\r\n * @param scene\r\n * @param rootUrl\r\n */\r\n public static Parse(source: any, scene: Scene, rootUrl: string): PBRMetallicRoughnessMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRMetallicRoughnessMaterial(source.name, scene), source, scene, rootUrl);\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMetallicRoughnessMaterial\", PBRMetallicRoughnessMaterial);\r\n"]}
|
|
@@ -2,6 +2,7 @@ import type { Scene } from "../../scene";
|
|
|
2
2
|
import type { Color3 } from "../../Maths/math.color";
|
|
3
3
|
import type { BaseTexture } from "../../Materials/Textures/baseTexture";
|
|
4
4
|
import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
|
|
5
|
+
import { Nullable } from "../../types";
|
|
5
6
|
/**
|
|
6
7
|
* The PBR material of BJS following the specular glossiness convention.
|
|
7
8
|
*
|
|
@@ -17,7 +18,7 @@ export declare class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial
|
|
|
17
18
|
* Specifies the diffuse texture of the material. This can also contains the opacity value in its alpha
|
|
18
19
|
* channel.
|
|
19
20
|
*/
|
|
20
|
-
diffuseTexture: BaseTexture
|
|
21
|
+
diffuseTexture: Nullable<BaseTexture>;
|
|
21
22
|
/**
|
|
22
23
|
* Specifies the specular color of the material. This indicates how reflective is the material (none to mirror).
|
|
23
24
|
*/
|
|
@@ -29,7 +30,7 @@ export declare class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial
|
|
|
29
30
|
/**
|
|
30
31
|
* Specifies both the specular color RGB and the glossiness A of the material per pixels.
|
|
31
32
|
*/
|
|
32
|
-
specularGlossinessTexture: BaseTexture
|
|
33
|
+
specularGlossinessTexture: Nullable<BaseTexture>;
|
|
33
34
|
/**
|
|
34
35
|
* Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrSpecularGlossinessMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrSpecularGlossinessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pbrSpecularGlossinessMaterial.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/PBR/pbrSpecularGlossinessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA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SACtD;QACD,IAAI,MAAM,CAAC,UAAU,EAAE;YACnB,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;SAChE;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAnHD;QAFC,iBAAiB,CAAC,SAAS,CAAC;QAC5B,gBAAgB,CAAC,kCAAkC,EAAE,cAAc,CAAC;uEACzC;IAQ5B;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,EAAE,gBAAgB,CAAC;yEAC1B;IAO7C;QAFC,iBAAiB,CAAC,UAAU,CAAC;QAC7B,gBAAgB,CAAC,kCAAkC,EAAE,oBAAoB,CAAC;wEAC9C;IAO7B;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,EAAE,eAAe,CAAC;qEAC5C;IAO1B;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,EAAE,sBAAsB,CAAC;oFACrB;IAuF5D,oCAAC;CAAA,AA1HD,CAAmD,qBAAqB,GA0HvE;SA1HY,6BAA6B;AA4H1C,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseSimpleMaterial } from \"./pbrBaseSimpleMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { Nullable } from \"../../types\";\r\n\r\n/**\r\n * The PBR material of BJS following the specular glossiness convention.\r\n *\r\n * This fits to the PBR convention in the GLTF definition:\r\n * https://github.com/KhronosGroup/glTF/tree/2.0/extensions/Khronos/KHR_materials_pbrSpecularGlossiness\r\n */\r\nexport class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial {\r\n /**\r\n * Specifies the diffuse color of the material.\r\n */\r\n @serializeAsColor3(\"diffuse\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")\r\n public diffuseColor: Color3;\r\n\r\n /**\r\n * Specifies the diffuse texture of the material. This can also contains the opacity value in its alpha\r\n * channel.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")\r\n public diffuseTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies the specular color of the material. This indicates how reflective is the material (none to mirror).\r\n */\r\n @serializeAsColor3(\"specular\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityColor\")\r\n public specularColor: Color3;\r\n\r\n /**\r\n * Specifies the glossiness of the material. This indicates \"how sharp is the reflection\".\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_microSurface\")\r\n public glossiness: number;\r\n\r\n /**\r\n * Specifies both the specular color RGB and the glossiness A of the material per pixels.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityTexture\")\r\n public specularGlossinessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.\r\n */\r\n public get useMicroSurfaceFromReflectivityMapAlpha() {\r\n return this._useMicroSurfaceFromReflectivityMapAlpha;\r\n }\r\n\r\n /**\r\n * Instantiates a new PBRSpecularGlossinessMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n */\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this._useMicroSurfaceFromReflectivityMapAlpha = true;\r\n }\r\n\r\n /**\r\n * Return the current class name of the material.\r\n */\r\n public getClassName(): string {\r\n return \"PBRSpecularGlossinessMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n */\r\n public clone(name: string): PBRSpecularGlossinessMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRSpecularGlossinessMaterial(name, this.getScene()), this);\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.clearCoat.copyTo(clone.clearCoat);\r\n this.anisotropy.copyTo(clone.anisotropy);\r\n this.brdf.copyTo(clone.brdf);\r\n this.sheen.copyTo(clone.sheen);\r\n this.subSurface.copyTo(clone.subSurface);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize the material to a parsable JSON object.\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.PBRSpecularGlossinessMaterial\";\r\n\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n serializationObject.brdf = this.brdf.serialize();\r\n serializationObject.sheen = this.sheen.serialize();\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a JSON object corresponding to the serialize function.\r\n * @param source\r\n * @param scene\r\n * @param rootUrl\r\n */\r\n public static Parse(source: any, scene: Scene, rootUrl: string): PBRSpecularGlossinessMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRSpecularGlossinessMaterial(source.name, scene), source, scene, rootUrl);\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRSpecularGlossinessMaterial\", PBRSpecularGlossinessMaterial);\r\n"]}
|
|
@@ -209,6 +209,9 @@ var CubeTexture = /** @class */ (function (_super) {
|
|
|
209
209
|
this.name = url;
|
|
210
210
|
}
|
|
211
211
|
this.url = url;
|
|
212
|
+
if (forcedExtension) {
|
|
213
|
+
this._forcedExtension = forcedExtension;
|
|
214
|
+
}
|
|
212
215
|
var lastDot = url.lastIndexOf(".");
|
|
213
216
|
var extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : "";
|
|
214
217
|
var isDDS = extension.indexOf(".dds") === 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cubeTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/cubeTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH;IAAiC,+BAAW;IAsIxC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,qBACI,OAAe,EACf,aAAiC,EACjC,UAAqC,EACrC,QAAyB,EACzB,KAAgC,EAChC,MAAmC,EACnC,OAAqE,EACrE,MAA6C,EAC7C,WAAmB,EACnB,eAA2B,EAC3B,iBAAkC,EAClC,QAAsB,EACtB,SAAqB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Misc/decorators\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3 } from \"../../Maths/math.vector\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../../Materials/Textures/texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\nimport \"../../Engines/Extensions/engine.cubeTexture\";\r\nimport { StartsWith } from \"../../Misc/stringTools\";\r\nimport { Observable } from \"../../Misc/observable\";\r\n\r\n/**\r\n * Class for creating a cube texture\r\n */\r\nexport class CubeTexture extends BaseTexture {\r\n private _delayedOnLoad: Nullable<() => void>;\r\n private _delayedOnError: Nullable<(message?: string, exception?: any) => void>;\r\n private _lodScale: number = 0.8;\r\n private _lodOffset: number = 0;\r\n\r\n /**\r\n * Observable triggered once the texture has been loaded.\r\n */\r\n public onLoadObservable: Observable<CubeTexture> = new Observable<CubeTexture>();\r\n\r\n /**\r\n * The url of the texture\r\n */\r\n @serialize()\r\n public url: string;\r\n\r\n /**\r\n * Gets or sets the center of the bounding box associated with the cube texture.\r\n * It must define where the camera used to render the texture was set\r\n * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode\r\n */\r\n public boundingBoxPosition = Vector3.Zero();\r\n\r\n private _boundingBoxSize: Vector3;\r\n\r\n /**\r\n * Gets or sets the size of the bounding box associated with the cube texture\r\n * When defined, the cubemap will switch to local mode\r\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\r\n * @example https://www.babylonjs-playground.com/#RNASML\r\n */\r\n public set boundingBoxSize(value: Vector3) {\r\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\r\n return;\r\n }\r\n this._boundingBoxSize = value;\r\n const scene = this.getScene();\r\n if (scene) {\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n }\r\n /**\r\n * Returns the bounding box size\r\n * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode\r\n */\r\n public get boundingBoxSize(): Vector3 {\r\n return this._boundingBoxSize;\r\n }\r\n\r\n protected _rotationY: number = 0;\r\n\r\n /**\r\n * Sets texture matrix rotation angle around Y axis in radians.\r\n */\r\n @serialize(\"rotationY\")\r\n public set rotationY(value: number) {\r\n this._rotationY = value;\r\n this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));\r\n }\r\n /**\r\n * Gets texture matrix rotation angle around Y axis radians.\r\n */\r\n public get rotationY(): number {\r\n return this._rotationY;\r\n }\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n public get noMipmap(): boolean {\r\n return this._noMipmap;\r\n }\r\n\r\n private _noMipmap: boolean;\r\n\r\n @serialize(\"files\")\r\n private _files: Nullable<string[]> = null;\r\n\r\n @serialize(\"forcedExtension\")\r\n protected _forcedExtension: Nullable<string> = null;\r\n\r\n /**\r\n * Gets the forced extension (if any)\r\n */\r\n public get forcedExtension(): Nullable<string> {\r\n return this._forcedExtension;\r\n }\r\n\r\n @serialize(\"extensions\")\r\n private _extensions: Nullable<string[]> = null;\r\n\r\n @serializeAsMatrix(\"textureMatrix\")\r\n private _textureMatrix: Matrix;\r\n\r\n private _format: number;\r\n private _createPolynomials: boolean;\r\n private _loaderOptions: any;\r\n private _useSRGBBuffer?: boolean;\r\n\r\n /**\r\n * Creates a cube texture from an array of image urls\r\n * @param files defines an array of image urls\r\n * @param scene defines the hosting scene\r\n * @param noMipmap specifies if mip maps are not used\r\n * @returns a cube texture\r\n */\r\n public static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean): CubeTexture {\r\n let rootUrlKey = \"\";\r\n\r\n files.forEach((url) => (rootUrlKey += url));\r\n\r\n return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);\r\n }\r\n\r\n /**\r\n * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.\r\n * @param url defines the url of the prefiltered texture\r\n * @param scene defines the scene the texture is attached to\r\n * @param forcedExtension defines the extension of the file if different from the url\r\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\r\n * @return the prefiltered texture\r\n */\r\n public static CreateFromPrefilteredData(url: string, scene: Scene, forcedExtension: any = null, createPolynomials: boolean = true) {\r\n const oldValue = scene.useDelayedTextureLoading;\r\n scene.useDelayedTextureLoading = false;\r\n\r\n const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);\r\n\r\n scene.useDelayedTextureLoading = oldValue;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well\r\n * as prefiltered data.\r\n * @param rootUrl defines the url of the texture or the root name of the six images\r\n * @param sceneOrEngine defines the scene or engine the texture is attached to\r\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\r\n * @param noMipmap defines if mipmaps should be created or not\r\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\r\n * @param onLoad defines a callback triggered at the end of the file load if no errors occurred\r\n * @param onError defines a callback triggered in case of error during load\r\n * @param format defines the internal format to use for the texture once loaded\r\n * @param prefiltered defines whether or not the texture is created from prefiltered data\r\n * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name\r\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param loaderOptions options to be passed to the loader\r\n * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)\r\n * @return the cube texture\r\n */\r\n constructor(\r\n rootUrl: string,\r\n sceneOrEngine: Scene | ThinEngine,\r\n extensions: Nullable<string[]> = null,\r\n noMipmap: boolean = false,\r\n files: Nullable<string[]> = null,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n prefiltered = false,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0.8,\r\n lodOffset: number = 0,\r\n loaderOptions?: any,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(sceneOrEngine);\r\n\r\n this.name = rootUrl;\r\n this.url = rootUrl;\r\n this._noMipmap = noMipmap;\r\n this.hasAlpha = false;\r\n this._format = format;\r\n this.isCube = true;\r\n this._textureMatrix = Matrix.Identity();\r\n this._createPolynomials = createPolynomials;\r\n this.coordinatesMode = Texture.CUBIC_MODE;\r\n this._extensions = extensions;\r\n this._files = files;\r\n this._forcedExtension = forcedExtension;\r\n this._loaderOptions = loaderOptions;\r\n this._useSRGBBuffer = useSRGBBuffer;\r\n this._lodScale = lodScale;\r\n this._lodOffset = lodOffset;\r\n\r\n if (!rootUrl && !files) {\r\n return;\r\n }\r\n\r\n this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, this.getScene()?.useDelayedTextureLoading, files);\r\n }\r\n\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"CubeTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"CubeTexture\";\r\n }\r\n\r\n /**\r\n * Update the url (and optional buffer) of this texture if url was null during construction.\r\n * @param url the url of the texture\r\n * @param forcedExtension defines the extension to use\r\n * @param onLoad callback called when the texture is loaded (defaults to null)\r\n * @param prefiltered Defines whether the updated texture is prefiltered or not\r\n * @param onError callback called if there was an error during the loading process (defaults to null)\r\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\r\n * @param delayLoad defines if the texture should be loaded now (false by default)\r\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\r\n */\r\n public updateURL(\r\n url: string,\r\n forcedExtension?: string,\r\n onLoad: Nullable<() => void> = null,\r\n prefiltered: boolean = false,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n extensions: Nullable<string[]> = null,\r\n delayLoad = false,\r\n files: Nullable<string[]> = null\r\n ): void {\r\n if (!this.name || StartsWith(this.name, \"data:\")) {\r\n this.name = url;\r\n }\r\n this.url = url;\r\n\r\n const lastDot = url.lastIndexOf(\".\");\r\n const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : \"\";\r\n const isDDS = extension.indexOf(\".dds\") === 0;\r\n const isEnv = extension.indexOf(\".env\") === 0;\r\n\r\n if (isEnv) {\r\n this.gammaSpace = false;\r\n this._prefiltered = false;\r\n this.anisotropicFilteringLevel = 1;\r\n } else {\r\n this._prefiltered = prefiltered;\r\n\r\n if (prefiltered) {\r\n this.gammaSpace = false;\r\n this.anisotropicFilteringLevel = 1;\r\n }\r\n }\r\n\r\n if (files) {\r\n this._files = files;\r\n } else {\r\n if (!isEnv && !isDDS && !extensions) {\r\n extensions = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"];\r\n }\r\n\r\n this._files = this._files || [];\r\n this._files.length = 0;\r\n\r\n if (extensions) {\r\n for (let index = 0; index < extensions.length; index++) {\r\n this._files.push(url + extensions[index]);\r\n }\r\n this._extensions = extensions;\r\n }\r\n }\r\n\r\n if (delayLoad) {\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n this._delayedOnLoad = onLoad;\r\n this._delayedOnError = onError;\r\n } else {\r\n this._loadTexture(onLoad, onError);\r\n }\r\n }\r\n\r\n /**\r\n * Delays loading of the cube texture\r\n * @param forcedExtension defines the extension to use\r\n */\r\n public delayLoad(forcedExtension?: string): void {\r\n if (this.delayLoadState !== Constants.DELAYLOADSTATE_NOTLOADED) {\r\n return;\r\n }\r\n if (forcedExtension) {\r\n this._forcedExtension = forcedExtension;\r\n }\r\n\r\n this.delayLoadState = Constants.DELAYLOADSTATE_LOADED;\r\n this._loadTexture(this._delayedOnLoad, this._delayedOnError);\r\n }\r\n\r\n /**\r\n * Returns the reflection texture matrix\r\n * @returns the reflection texture matrix\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n return this._textureMatrix;\r\n }\r\n\r\n /**\r\n * Sets the reflection texture matrix\r\n * @param value Reflection texture matrix\r\n */\r\n public setReflectionTextureMatrix(value: Matrix): void {\r\n if (value.updateFlag === this._textureMatrix.updateFlag) {\r\n return;\r\n }\r\n\r\n if (value.isIdentity() !== this._textureMatrix.isIdentity()) {\r\n this.getScene()?.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => mat.getActiveTextures().indexOf(this) !== -1);\r\n }\r\n\r\n this._textureMatrix = value;\r\n }\r\n\r\n private _loadTexture(onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null) {\r\n const scene = this.getScene();\r\n const oldTexture = this._texture;\r\n this._texture = this._getFromCache(this.url, this._noMipmap, undefined, undefined, this._useSRGBBuffer);\r\n\r\n const onLoadProcessing = () => {\r\n this.onLoadObservable.notifyObservers(this);\r\n if (oldTexture) {\r\n oldTexture.dispose();\r\n this.getScene()?.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n this._loadingError = true;\r\n this._errorObject = { message, exception };\r\n if (onError) {\r\n onError(message, exception);\r\n }\r\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\r\n };\r\n\r\n if (!this._texture) {\r\n if (this._prefiltered) {\r\n this._texture = this._getEngine()!.createPrefilteredCubeTexture(\r\n this.url,\r\n scene,\r\n this._lodScale,\r\n this._lodOffset,\r\n onLoad,\r\n errorHandler,\r\n this._format,\r\n this._forcedExtension,\r\n this._createPolynomials\r\n );\r\n } else {\r\n this._texture = this._getEngine()!.createCubeTexture(\r\n this.url,\r\n scene,\r\n this._files,\r\n this._noMipmap,\r\n onLoad,\r\n errorHandler,\r\n this._format,\r\n this._forcedExtension,\r\n false,\r\n this._lodScale,\r\n this._lodOffset,\r\n null,\r\n this._loaderOptions,\r\n !!this._useSRGBBuffer\r\n );\r\n }\r\n\r\n this._texture?.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this));\r\n } else {\r\n if (this._texture.isReady) {\r\n Tools.SetImmediate(() => onLoadProcessing());\r\n } else {\r\n this._texture.onLoadedObservable.add(() => onLoadProcessing());\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Parses text to create a cube texture\r\n * @param parsedTexture define the serialized text to read from\r\n * @param scene defines the hosting scene\r\n * @param rootUrl defines the root url of the cube texture\r\n * @returns a cube texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => {\r\n let prefiltered: boolean = false;\r\n if (parsedTexture.prefiltered) {\r\n prefiltered = parsedTexture.prefiltered;\r\n }\r\n return new CubeTexture(\r\n rootUrl + parsedTexture.name,\r\n scene,\r\n parsedTexture.extensions,\r\n false,\r\n parsedTexture.files || null,\r\n null,\r\n null,\r\n undefined,\r\n prefiltered,\r\n parsedTexture.forcedExtension\r\n );\r\n },\r\n parsedTexture,\r\n scene\r\n );\r\n\r\n // Local Cubemaps\r\n if (parsedTexture.boundingBoxPosition) {\r\n texture.boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);\r\n }\r\n if (parsedTexture.boundingBoxSize) {\r\n texture.boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);\r\n }\r\n\r\n // Animations\r\n if (parsedTexture.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedTexture.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n texture.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Makes a clone, or deep copy, of the cube texture\r\n * @returns a new cube texture\r\n */\r\n public clone(): CubeTexture {\r\n let uniqueId = 0;\r\n\r\n const newCubeTexture = SerializationHelper.Clone(() => {\r\n const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine()!, this._extensions, this._noMipmap, this._files);\r\n uniqueId = cubeTexture.uniqueId;\r\n\r\n return cubeTexture;\r\n }, this);\r\n\r\n newCubeTexture.uniqueId = uniqueId;\r\n\r\n return newCubeTexture;\r\n }\r\n}\r\n\r\nTexture._CubeTextureParser = CubeTexture.Parse;\r\n// Some exporters relies on Tools.Instantiate\r\nRegisterClass(\"BABYLON.CubeTexture\", CubeTexture);\r\n"]}
|
|
1
|
+
{"version":3,"file":"cubeTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/cubeTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH;IAAiC,+BAAW;IAsIxC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,qBACI,OAAe,EACf,aAAiC,EACjC,UAAqC,EACrC,QAAyB,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AW,GA0c3C;SA1cY,WAAW;AA4cxB,OAAO,CAAC,kBAAkB,GAAG,WAAW,CAAC,KAAK,CAAC;AAC/C,6CAA6C;AAC7C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsMatrix, SerializationHelper } from \"../../Misc/decorators\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3 } from \"../../Maths/math.vector\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../../Materials/Textures/texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\nimport \"../../Engines/Extensions/engine.cubeTexture\";\r\nimport { StartsWith } from \"../../Misc/stringTools\";\r\nimport { Observable } from \"../../Misc/observable\";\r\n\r\n/**\r\n * Class for creating a cube texture\r\n */\r\nexport class CubeTexture extends BaseTexture {\r\n private _delayedOnLoad: Nullable<() => void>;\r\n private _delayedOnError: Nullable<(message?: string, exception?: any) => void>;\r\n private _lodScale: number = 0.8;\r\n private _lodOffset: number = 0;\r\n\r\n /**\r\n * Observable triggered once the texture has been loaded.\r\n */\r\n public onLoadObservable: Observable<CubeTexture> = new Observable<CubeTexture>();\r\n\r\n /**\r\n * The url of the texture\r\n */\r\n @serialize()\r\n public url: string;\r\n\r\n /**\r\n * Gets or sets the center of the bounding box associated with the cube texture.\r\n * It must define where the camera used to render the texture was set\r\n * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode\r\n */\r\n public boundingBoxPosition = Vector3.Zero();\r\n\r\n private _boundingBoxSize: Vector3;\r\n\r\n /**\r\n * Gets or sets the size of the bounding box associated with the cube texture\r\n * When defined, the cubemap will switch to local mode\r\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\r\n * @example https://www.babylonjs-playground.com/#RNASML\r\n */\r\n public set boundingBoxSize(value: Vector3) {\r\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\r\n return;\r\n }\r\n this._boundingBoxSize = value;\r\n const scene = this.getScene();\r\n if (scene) {\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n }\r\n /**\r\n * Returns the bounding box size\r\n * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode\r\n */\r\n public get boundingBoxSize(): Vector3 {\r\n return this._boundingBoxSize;\r\n }\r\n\r\n protected _rotationY: number = 0;\r\n\r\n /**\r\n * Sets texture matrix rotation angle around Y axis in radians.\r\n */\r\n @serialize(\"rotationY\")\r\n public set rotationY(value: number) {\r\n this._rotationY = value;\r\n this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));\r\n }\r\n /**\r\n * Gets texture matrix rotation angle around Y axis radians.\r\n */\r\n public get rotationY(): number {\r\n return this._rotationY;\r\n }\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n public get noMipmap(): boolean {\r\n return this._noMipmap;\r\n }\r\n\r\n private _noMipmap: boolean;\r\n\r\n @serialize(\"files\")\r\n private _files: Nullable<string[]> = null;\r\n\r\n @serialize(\"forcedExtension\")\r\n protected _forcedExtension: Nullable<string> = null;\r\n\r\n /**\r\n * Gets the forced extension (if any)\r\n */\r\n public get forcedExtension(): Nullable<string> {\r\n return this._forcedExtension;\r\n }\r\n\r\n @serialize(\"extensions\")\r\n private _extensions: Nullable<string[]> = null;\r\n\r\n @serializeAsMatrix(\"textureMatrix\")\r\n private _textureMatrix: Matrix;\r\n\r\n private _format: number;\r\n private _createPolynomials: boolean;\r\n private _loaderOptions: any;\r\n private _useSRGBBuffer?: boolean;\r\n\r\n /**\r\n * Creates a cube texture from an array of image urls\r\n * @param files defines an array of image urls\r\n * @param scene defines the hosting scene\r\n * @param noMipmap specifies if mip maps are not used\r\n * @returns a cube texture\r\n */\r\n public static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean): CubeTexture {\r\n let rootUrlKey = \"\";\r\n\r\n files.forEach((url) => (rootUrlKey += url));\r\n\r\n return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);\r\n }\r\n\r\n /**\r\n * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.\r\n * @param url defines the url of the prefiltered texture\r\n * @param scene defines the scene the texture is attached to\r\n * @param forcedExtension defines the extension of the file if different from the url\r\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\r\n * @return the prefiltered texture\r\n */\r\n public static CreateFromPrefilteredData(url: string, scene: Scene, forcedExtension: any = null, createPolynomials: boolean = true) {\r\n const oldValue = scene.useDelayedTextureLoading;\r\n scene.useDelayedTextureLoading = false;\r\n\r\n const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);\r\n\r\n scene.useDelayedTextureLoading = oldValue;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well\r\n * as prefiltered data.\r\n * @param rootUrl defines the url of the texture or the root name of the six images\r\n * @param sceneOrEngine defines the scene or engine the texture is attached to\r\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\r\n * @param noMipmap defines if mipmaps should be created or not\r\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\r\n * @param onLoad defines a callback triggered at the end of the file load if no errors occurred\r\n * @param onError defines a callback triggered in case of error during load\r\n * @param format defines the internal format to use for the texture once loaded\r\n * @param prefiltered defines whether or not the texture is created from prefiltered data\r\n * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name\r\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param loaderOptions options to be passed to the loader\r\n * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)\r\n * @return the cube texture\r\n */\r\n constructor(\r\n rootUrl: string,\r\n sceneOrEngine: Scene | ThinEngine,\r\n extensions: Nullable<string[]> = null,\r\n noMipmap: boolean = false,\r\n files: Nullable<string[]> = null,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n prefiltered = false,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0.8,\r\n lodOffset: number = 0,\r\n loaderOptions?: any,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(sceneOrEngine);\r\n\r\n this.name = rootUrl;\r\n this.url = rootUrl;\r\n this._noMipmap = noMipmap;\r\n this.hasAlpha = false;\r\n this._format = format;\r\n this.isCube = true;\r\n this._textureMatrix = Matrix.Identity();\r\n this._createPolynomials = createPolynomials;\r\n this.coordinatesMode = Texture.CUBIC_MODE;\r\n this._extensions = extensions;\r\n this._files = files;\r\n this._forcedExtension = forcedExtension;\r\n this._loaderOptions = loaderOptions;\r\n this._useSRGBBuffer = useSRGBBuffer;\r\n this._lodScale = lodScale;\r\n this._lodOffset = lodOffset;\r\n\r\n if (!rootUrl && !files) {\r\n return;\r\n }\r\n\r\n this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, this.getScene()?.useDelayedTextureLoading, files);\r\n }\r\n\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"CubeTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"CubeTexture\";\r\n }\r\n\r\n /**\r\n * Update the url (and optional buffer) of this texture if url was null during construction.\r\n * @param url the url of the texture\r\n * @param forcedExtension defines the extension to use\r\n * @param onLoad callback called when the texture is loaded (defaults to null)\r\n * @param prefiltered Defines whether the updated texture is prefiltered or not\r\n * @param onError callback called if there was an error during the loading process (defaults to null)\r\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\r\n * @param delayLoad defines if the texture should be loaded now (false by default)\r\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\r\n */\r\n public updateURL(\r\n url: string,\r\n forcedExtension?: string,\r\n onLoad: Nullable<() => void> = null,\r\n prefiltered: boolean = false,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n extensions: Nullable<string[]> = null,\r\n delayLoad = false,\r\n files: Nullable<string[]> = null\r\n ): void {\r\n if (!this.name || StartsWith(this.name, \"data:\")) {\r\n this.name = url;\r\n }\r\n this.url = url;\r\n\r\n if (forcedExtension) {\r\n this._forcedExtension = forcedExtension;\r\n }\r\n\r\n const lastDot = url.lastIndexOf(\".\");\r\n const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : \"\";\r\n const isDDS = extension.indexOf(\".dds\") === 0;\r\n const isEnv = extension.indexOf(\".env\") === 0;\r\n\r\n if (isEnv) {\r\n this.gammaSpace = false;\r\n this._prefiltered = false;\r\n this.anisotropicFilteringLevel = 1;\r\n } else {\r\n this._prefiltered = prefiltered;\r\n\r\n if (prefiltered) {\r\n this.gammaSpace = false;\r\n this.anisotropicFilteringLevel = 1;\r\n }\r\n }\r\n\r\n if (files) {\r\n this._files = files;\r\n } else {\r\n if (!isEnv && !isDDS && !extensions) {\r\n extensions = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"];\r\n }\r\n\r\n this._files = this._files || [];\r\n this._files.length = 0;\r\n\r\n if (extensions) {\r\n for (let index = 0; index < extensions.length; index++) {\r\n this._files.push(url + extensions[index]);\r\n }\r\n this._extensions = extensions;\r\n }\r\n }\r\n\r\n if (delayLoad) {\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n this._delayedOnLoad = onLoad;\r\n this._delayedOnError = onError;\r\n } else {\r\n this._loadTexture(onLoad, onError);\r\n }\r\n }\r\n\r\n /**\r\n * Delays loading of the cube texture\r\n * @param forcedExtension defines the extension to use\r\n */\r\n public delayLoad(forcedExtension?: string): void {\r\n if (this.delayLoadState !== Constants.DELAYLOADSTATE_NOTLOADED) {\r\n return;\r\n }\r\n if (forcedExtension) {\r\n this._forcedExtension = forcedExtension;\r\n }\r\n\r\n this.delayLoadState = Constants.DELAYLOADSTATE_LOADED;\r\n this._loadTexture(this._delayedOnLoad, this._delayedOnError);\r\n }\r\n\r\n /**\r\n * Returns the reflection texture matrix\r\n * @returns the reflection texture matrix\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n return this._textureMatrix;\r\n }\r\n\r\n /**\r\n * Sets the reflection texture matrix\r\n * @param value Reflection texture matrix\r\n */\r\n public setReflectionTextureMatrix(value: Matrix): void {\r\n if (value.updateFlag === this._textureMatrix.updateFlag) {\r\n return;\r\n }\r\n\r\n if (value.isIdentity() !== this._textureMatrix.isIdentity()) {\r\n this.getScene()?.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => mat.getActiveTextures().indexOf(this) !== -1);\r\n }\r\n\r\n this._textureMatrix = value;\r\n }\r\n\r\n private _loadTexture(onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null) {\r\n const scene = this.getScene();\r\n const oldTexture = this._texture;\r\n this._texture = this._getFromCache(this.url, this._noMipmap, undefined, undefined, this._useSRGBBuffer);\r\n\r\n const onLoadProcessing = () => {\r\n this.onLoadObservable.notifyObservers(this);\r\n if (oldTexture) {\r\n oldTexture.dispose();\r\n this.getScene()?.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n this._loadingError = true;\r\n this._errorObject = { message, exception };\r\n if (onError) {\r\n onError(message, exception);\r\n }\r\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\r\n };\r\n\r\n if (!this._texture) {\r\n if (this._prefiltered) {\r\n this._texture = this._getEngine()!.createPrefilteredCubeTexture(\r\n this.url,\r\n scene,\r\n this._lodScale,\r\n this._lodOffset,\r\n onLoad,\r\n errorHandler,\r\n this._format,\r\n this._forcedExtension,\r\n this._createPolynomials\r\n );\r\n } else {\r\n this._texture = this._getEngine()!.createCubeTexture(\r\n this.url,\r\n scene,\r\n this._files,\r\n this._noMipmap,\r\n onLoad,\r\n errorHandler,\r\n this._format,\r\n this._forcedExtension,\r\n false,\r\n this._lodScale,\r\n this._lodOffset,\r\n null,\r\n this._loaderOptions,\r\n !!this._useSRGBBuffer\r\n );\r\n }\r\n\r\n this._texture?.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this));\r\n } else {\r\n if (this._texture.isReady) {\r\n Tools.SetImmediate(() => onLoadProcessing());\r\n } else {\r\n this._texture.onLoadedObservable.add(() => onLoadProcessing());\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Parses text to create a cube texture\r\n * @param parsedTexture define the serialized text to read from\r\n * @param scene defines the hosting scene\r\n * @param rootUrl defines the root url of the cube texture\r\n * @returns a cube texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => {\r\n let prefiltered: boolean = false;\r\n if (parsedTexture.prefiltered) {\r\n prefiltered = parsedTexture.prefiltered;\r\n }\r\n return new CubeTexture(\r\n rootUrl + parsedTexture.name,\r\n scene,\r\n parsedTexture.extensions,\r\n false,\r\n parsedTexture.files || null,\r\n null,\r\n null,\r\n undefined,\r\n prefiltered,\r\n parsedTexture.forcedExtension\r\n );\r\n },\r\n parsedTexture,\r\n scene\r\n );\r\n\r\n // Local Cubemaps\r\n if (parsedTexture.boundingBoxPosition) {\r\n texture.boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);\r\n }\r\n if (parsedTexture.boundingBoxSize) {\r\n texture.boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);\r\n }\r\n\r\n // Animations\r\n if (parsedTexture.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedTexture.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n texture.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Makes a clone, or deep copy, of the cube texture\r\n * @returns a new cube texture\r\n */\r\n public clone(): CubeTexture {\r\n let uniqueId = 0;\r\n\r\n const newCubeTexture = SerializationHelper.Clone(() => {\r\n const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine()!, this._extensions, this._noMipmap, this._files);\r\n uniqueId = cubeTexture.uniqueId;\r\n\r\n return cubeTexture;\r\n }, this);\r\n\r\n newCubeTexture.uniqueId = uniqueId;\r\n\r\n return newCubeTexture;\r\n }\r\n}\r\n\r\nTexture._CubeTextureParser = CubeTexture.Parse;\r\n// Some exporters relies on Tools.Instantiate\r\nRegisterClass(\"BABYLON.CubeTexture\", CubeTexture);\r\n"]}
|
|
@@ -241,6 +241,7 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
|
|
|
241
241
|
* @param delayAllocation if the texture allocation should be delayed (default: false)
|
|
242
242
|
* @param samples sample count to use when creating the RTT
|
|
243
243
|
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
244
|
+
* @param noColorTarget True to indicate that no color target should be created. Useful if you only want to write to the depth buffer, for eg
|
|
244
245
|
*/
|
|
245
246
|
constructor(name: string, size: number | {
|
|
246
247
|
width: number;
|
|
@@ -248,7 +249,7 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
|
|
|
248
249
|
layers?: number;
|
|
249
250
|
} | {
|
|
250
251
|
ratio: number;
|
|
251
|
-
}, scene?: Nullable<Scene>, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number, isCube?: boolean, samplingMode?: number, generateDepthBuffer?: boolean, generateStencilBuffer?: boolean, isMulti?: boolean, format?: number, delayAllocation?: boolean, samples?: number, creationFlags?: number);
|
|
252
|
+
}, scene?: Nullable<Scene>, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number, isCube?: boolean, samplingMode?: number, generateDepthBuffer?: boolean, generateStencilBuffer?: boolean, isMulti?: boolean, format?: number, delayAllocation?: boolean, samples?: number, creationFlags?: number, noColorTarget?: boolean);
|
|
252
253
|
/**
|
|
253
254
|
* Creates a depth stencil texture.
|
|
254
255
|
* This is only available in WebGL 2 or with the depth texture extension available.
|