@babylonjs/core 7.39.1 → 7.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/Cameras/arcRotateCamera.d.ts +1 -1
  2. package/Cameras/arcRotateCamera.js.map +1 -1
  3. package/Debug/directionalLightFrustumViewer.d.ts +2 -1
  4. package/Debug/directionalLightFrustumViewer.js +4 -3
  5. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  6. package/Engines/Extensions/engine.multiRender.js +1 -0
  7. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/constants.d.ts +8 -0
  11. package/Engines/constants.js +8 -0
  12. package/Engines/constants.js.map +1 -1
  13. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -9
  14. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  15. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -9
  16. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  17. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -9
  18. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +5 -17
  20. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +5 -17
  22. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  23. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -9
  24. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  25. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -1
  26. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +40 -20
  27. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  28. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +77 -0
  29. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +250 -0
  30. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -0
  31. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +57 -0
  32. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +169 -0
  33. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -0
  34. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +3 -9
  35. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -1
  36. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +4 -13
  37. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  38. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +6 -0
  39. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +27 -0
  40. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
  41. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.d.ts +19 -0
  42. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +28 -0
  43. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -0
  44. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -9
  45. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +3 -9
  47. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  48. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +2 -5
  49. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  50. package/FrameGraph/Node/Blocks/executeBlock.d.ts +29 -0
  51. package/FrameGraph/Node/Blocks/executeBlock.js +43 -0
  52. package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -0
  53. package/FrameGraph/Node/Blocks/index.d.ts +4 -0
  54. package/FrameGraph/Node/Blocks/index.js +4 -0
  55. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  56. package/FrameGraph/Node/Blocks/inputBlock.d.ts +7 -2
  57. package/FrameGraph/Node/Blocks/inputBlock.js +13 -0
  58. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  59. package/FrameGraph/Node/Blocks/resourceContainerBlock.d.ts +55 -0
  60. package/FrameGraph/Node/Blocks/resourceContainerBlock.js +97 -0
  61. package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -0
  62. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +13 -10
  63. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +11 -4
  64. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  65. package/FrameGraph/Node/nodeRenderGraph.js +32 -4
  66. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  67. package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +1 -0
  68. package/FrameGraph/Node/nodeRenderGraphBlock.js +11 -0
  69. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  70. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +18 -0
  71. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +24 -0
  72. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  73. package/FrameGraph/Passes/cullPass.d.ts +1 -1
  74. package/FrameGraph/Passes/cullPass.js.map +1 -1
  75. package/FrameGraph/Tasks/Misc/executeTask.d.ts +22 -0
  76. package/FrameGraph/Tasks/Misc/executeTask.js +28 -0
  77. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -0
  78. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +72 -0
  79. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +183 -0
  80. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -0
  81. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +16 -5
  82. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +46 -0
  83. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  84. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +107 -0
  85. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +264 -0
  86. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -0
  87. package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -0
  88. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  89. package/FrameGraph/frameGraph.d.ts +9 -0
  90. package/FrameGraph/frameGraph.js +12 -3
  91. package/FrameGraph/frameGraph.js.map +1 -1
  92. package/FrameGraph/frameGraphTextureManager.js +4 -1
  93. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  94. package/FrameGraph/index.d.ts +5 -0
  95. package/FrameGraph/index.js +5 -0
  96. package/FrameGraph/index.js.map +1 -1
  97. package/Inputs/scene.inputManager.d.ts +1 -1
  98. package/Inputs/scene.inputManager.js +8 -1
  99. package/Inputs/scene.inputManager.js.map +1 -1
  100. package/Lights/Shadows/shadowGenerator.d.ts +1 -1
  101. package/Lights/Shadows/shadowGenerator.js +2 -7
  102. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  103. package/Lights/directionalLight.d.ts +5 -4
  104. package/Lights/directionalLight.js +7 -9
  105. package/Lights/directionalLight.js.map +1 -1
  106. package/Lights/shadowLight.d.ts +4 -4
  107. package/Lights/shadowLight.js +3 -2
  108. package/Lights/shadowLight.js.map +1 -1
  109. package/Lights/spotLight.d.ts +2 -2
  110. package/Lights/spotLight.js +3 -2
  111. package/Lights/spotLight.js.map +1 -1
  112. package/Loading/sceneLoader.d.ts +1 -1
  113. package/Loading/sceneLoader.js.map +1 -1
  114. package/Materials/GreasedLine/greasedLinePluginMaterial.js +1 -1
  115. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  116. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +18 -6
  117. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  118. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +18 -6
  119. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  120. package/Materials/Textures/renderTargetTexture.d.ts +2 -0
  121. package/Materials/Textures/renderTargetTexture.js +18 -8
  122. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  123. package/Materials/material.js +3 -1
  124. package/Materials/material.js.map +1 -1
  125. package/Materials/materialPluginBase.d.ts +4 -0
  126. package/Materials/materialPluginBase.js +4 -0
  127. package/Materials/materialPluginBase.js.map +1 -1
  128. package/Maths/math.color.js.map +1 -1
  129. package/Maths/math.vector.js.map +1 -1
  130. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
  131. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  132. package/Meshes/lattice.material.d.ts +3 -8
  133. package/Meshes/lattice.material.js.map +1 -1
  134. package/Misc/copyTextureToTexture.js +1 -1
  135. package/Misc/copyTextureToTexture.js.map +1 -1
  136. package/Misc/filesInput.d.ts +3 -1
  137. package/Misc/filesInput.js +8 -4
  138. package/Misc/filesInput.js.map +1 -1
  139. package/PostProcesses/postProcess.d.ts +2 -2
  140. package/PostProcesses/postProcess.js +4 -4
  141. package/PostProcesses/postProcess.js.map +1 -1
  142. package/PostProcesses/postProcessManager.js +1 -1
  143. package/PostProcesses/postProcessManager.js.map +1 -1
  144. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
  145. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  146. package/Shaders/default.fragment.js +2 -1
  147. package/Shaders/default.fragment.js.map +1 -1
  148. package/Shaders/default.vertex.js +2 -1
  149. package/Shaders/default.vertex.js.map +1 -1
  150. package/Shaders/pbr.fragment.js +2 -1
  151. package/Shaders/pbr.fragment.js.map +1 -1
  152. package/Shaders/pbr.vertex.js +2 -1
  153. package/Shaders/pbr.vertex.js.map +1 -1
  154. package/XR/webXRCamera.js +3 -0
  155. package/XR/webXRCamera.js.map +1 -1
  156. package/package.json +1 -1
  157. package/scene.d.ts +7 -0
  158. package/scene.js +10 -1
  159. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"greasedLinePluginMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLinePluginMaterial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI9D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE5F;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,eAAe;IAA/D;;QACI;;WAEG;QACH,gEAAgE;QAChE,2BAAsB,GAAG,KAAK,CAAC;QAC/B;;WAEG;QACH,gEAAgE;QAChE,kCAA6B,GAAG,KAAK,CAAC;QACt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IAAI,CAAC,eAAe,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAElC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAEO,OAAO,CAAC,cAA8B;QAC1C,OAAO,cAAc,gCAAwB,IAAI,IAAI,CAAC,UAAU,CAAC;IACrE,CAAC;;AA1iBD;;GAEG;AACoB,oDAA0B,GAAG,2BAA2B,AAA9B,CAA+B;AAEhF;;;GAGG;AACW,mCAAS,GAAG,KAAK,AAAR,CAAS;AAoiBpC,aAAa,CAAC,WAAW,yBAAyB,CAAC,0BAA0B,EAAE,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport { RawTexture } from \"../Textures/rawTexture\";\r\nimport { MaterialPluginBase } from \"../materialPluginBase\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { UniformBuffer } from \"../uniformBuffer\";\r\nimport { Vector2, TmpVectors } from \"../../Maths/math.vector\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Material } from \"../material\";\r\nimport { MaterialDefines } from \"../materialDefines\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"../Textures/baseTexture\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { ShaderLanguage } from \"../shaderLanguage\";\r\n\r\nimport type { GreasedLineMaterialOptions, IGreasedLineMaterial } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshColorDistributionType, GreasedLineMeshColorMode } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport { GetCustomCode as getCustomCodeGLSL } from \"./greasedLinePluginMaterialShadersGLSL\";\r\nimport { GetCustomCode as getCustomCodeWGSL } from \"./greasedLinePluginMaterialShadersWGSL\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class MaterialGreasedLineDefines extends MaterialDefines {\r\n /**\r\n * The material has a color option specified\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_HAS_COLOR = false;\r\n /**\r\n * The material's size attenuation optiom\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_SIZE_ATTENUATION = false;\r\n /**\r\n * The type of color distribution is set to line this value equals to true.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = false;\r\n /**\r\n * True if scene is in right handed coordinate system.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = false;\r\n\r\n /**\r\n * True if the line is in camera facing mode\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_CAMERA_FACING = true;\r\n}\r\n\r\n/**\r\n * GreasedLinePluginMaterial for GreasedLineMesh/GreasedLineRibbonMesh.\r\n * Use the GreasedLineBuilder.CreateGreasedLineMaterial function to create and instance of this class.\r\n */\r\nexport class GreasedLinePluginMaterial extends MaterialPluginBase implements IGreasedLineMaterial {\r\n /**\r\n * Plugin name\r\n */\r\n public static readonly GREASED_LINE_MATERIAL_NAME = \"GreasedLinePluginMaterial\";\r\n\r\n /**\r\n * Force all the greased lines to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static ForceGLSL = false;\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n public useColors: boolean;\r\n\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n public visibility: number;\r\n\r\n /**\r\n * Dash offset\r\n */\r\n public dashOffset: number;\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n public dashRatio: number;\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n public width: number;\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n public colorsSampling: number;\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n public useDash: boolean;\r\n\r\n /**\r\n * The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET\r\n * @see GreasedLineMeshColorMode\r\n */\r\n public colorMode: GreasedLineMeshColorMode;\r\n\r\n /**\r\n * You can provide a colorsTexture to use instead of one generated from the 'colors' option\r\n */\r\n public colorsTexture: Nullable<RawTexture> = null;\r\n\r\n private _scene: Scene;\r\n private _dashCount: number;\r\n private _dashArray: number;\r\n private _color: Nullable<Color3>;\r\n private _colors: Nullable<Color3[]>;\r\n private _colorsDistributionType: GreasedLineMeshColorDistributionType;\r\n private _resolution: Vector2;\r\n private _aspect: number;\r\n private _sizeAttenuation: boolean;\r\n\r\n private _cameraFacing: boolean;\r\n\r\n private _engine: AbstractEngine;\r\n\r\n private _forceGLSL = false;\r\n\r\n /**\r\n * Gets a boolean indicating that the plugin is compatible with a given shader language\r\n * @param _shaderLanguage The shader language to use\r\n * @returns true if the plugin is compatible with the shader language. Return always true since both GLSL and WGSL are supported\r\n */\r\n public override isCompatible(_shaderLanguage: ShaderLanguage): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Creates a new instance of the GreasedLinePluginMaterial\r\n * @param material Base material for the plugin\r\n * @param scene The scene\r\n * @param options Plugin options\r\n */\r\n constructor(material: Material, scene?: Scene, options?: GreasedLineMaterialOptions) {\r\n options = options || {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n\r\n const defines = new MaterialGreasedLineDefines();\r\n defines.GREASED_LINE_HAS_COLOR = !!options.color && !options.useColors;\r\n defines.GREASED_LINE_SIZE_ATTENUATION = options.sizeAttenuation ?? false;\r\n defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = options.colorDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE;\r\n defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = (scene ?? material.getScene()).useRightHandedSystem;\r\n defines.GREASED_LINE_CAMERA_FACING = options.cameraFacing ?? true;\r\n super(material, GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME, 200, defines, true, true);\r\n\r\n this._forceGLSL = options?.forceGLSL || GreasedLinePluginMaterial.ForceGLSL;\r\n\r\n this._scene = scene ?? material.getScene();\r\n this._engine = this._scene.getEngine();\r\n\r\n this._cameraFacing = options.cameraFacing ?? true;\r\n\r\n this.visibility = options.visibility ?? 1;\r\n this.useDash = options.useDash ?? false;\r\n this.dashRatio = options.dashRatio ?? 0.5;\r\n this.dashOffset = options.dashOffset ?? 0;\r\n this.width = options.width ? options.width : options.sizeAttenuation ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n this._sizeAttenuation = options.sizeAttenuation ?? false;\r\n this.colorMode = options.colorMode ?? GreasedLineMeshColorMode.COLOR_MODE_SET;\r\n this._color = options.color ?? null;\r\n this.useColors = options.useColors ?? false;\r\n this._colorsDistributionType = options.colorDistributionType ?? GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;\r\n this._colors = options.colors ?? null;\r\n\r\n this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter\r\n this.resolution = options.resolution ?? new Vector2(this._engine.getRenderWidth(), this._engine.getRenderHeight()); // calculate aspect call the setter\r\n\r\n if (options.colorsTexture) {\r\n this.colorsTexture = options.colorsTexture; // colorsTexture from options takes precedence\r\n } else {\r\n if (this._colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${material.name}-colors-texture`, this._colors, this.colorsSampling, this._scene);\r\n } else {\r\n this._color = this._color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n GreasedLineTools.PrepareEmptyColorsTexture(this._scene);\r\n }\r\n }\r\n\r\n this._engine.onDisposeObservable.add(() => {\r\n GreasedLineTools.DisposeEmptyColorsTexture();\r\n });\r\n }\r\n\r\n /**\r\n * Get the shader attributes\r\n * @param attributes array which will be filled with the attributes\r\n */\r\n override getAttributes(attributes: string[]) {\r\n attributes.push(\"grl_offsets\");\r\n attributes.push(\"grl_widths\");\r\n attributes.push(\"grl_colorPointers\");\r\n attributes.push(\"grl_counters\");\r\n if (this._cameraFacing) {\r\n attributes.push(\"grl_previousAndSide\");\r\n attributes.push(\"grl_nextAndCounters\");\r\n } else {\r\n attributes.push(\"grl_slopes\");\r\n }\r\n }\r\n\r\n /**\r\n * Get the shader samplers\r\n * @param samplers\r\n */\r\n override getSamplers(samplers: string[]) {\r\n samplers.push(\"grl_colors\");\r\n }\r\n\r\n /**\r\n * Get the shader textures\r\n * @param activeTextures array which will be filled with the textures\r\n */\r\n public override getActiveTextures(activeTextures: BaseTexture[]): void {\r\n if (this.colorsTexture) {\r\n activeTextures.push(this.colorsTexture);\r\n }\r\n }\r\n\r\n /**\r\n * Get the shader uniforms\r\n * @param shaderLanguage The shader language to use\r\n * @returns uniforms\r\n */\r\n override getUniforms(shaderLanguage = ShaderLanguage.GLSL) {\r\n const ubo = [\r\n { name: \"grl_singleColor\", size: 3, type: \"vec3\" },\r\n { name: \"grl_textureSize\", size: 2, type: \"vec2\" },\r\n { name: \"grl_dashOptions\", size: 4, type: \"vec4\" },\r\n { name: \"grl_colorMode_visibility_colorsWidth_useColors\", size: 4, type: \"vec4\" },\r\n ];\r\n if (this._cameraFacing) {\r\n ubo.push({ name: \"grl_projection\", size: 16, type: \"mat4\" }, { name: \"grl_aspect_resolution_lineWidth\", size: 4, type: \"vec4\" });\r\n }\r\n\r\n if (shaderLanguage === ShaderLanguage.WGSL) {\r\n ubo.push({\r\n name: \"viewProjection\",\r\n size: 16,\r\n type: \"mat4\",\r\n });\r\n }\r\n\r\n return {\r\n ubo,\r\n vertex:\r\n this._cameraFacing && this._isGLSL(shaderLanguage)\r\n ? `\r\n uniform vec4 grl_aspect_resolution_lineWidth;\r\n uniform mat4 grl_projection;\r\n `\r\n : \"\",\r\n fragment: this._isGLSL(shaderLanguage)\r\n ? `\r\n uniform vec4 grl_dashOptions;\r\n uniform vec2 grl_textureSize;\r\n uniform vec4 grl_colorMode_visibility_colorsWidth_useColors;\r\n uniform vec3 grl_singleColor;\r\n `\r\n : \"\",\r\n };\r\n }\r\n\r\n // only getter, it doesn't make sense to use this plugin on a mesh other than GreasedLineMesh\r\n // and it doesn't make sense to disable it on the mesh\r\n get isEnabled() {\r\n return true;\r\n }\r\n\r\n /**\r\n * Bind the uniform buffer\r\n * @param uniformBuffer\r\n */\r\n override bindForSubMesh(uniformBuffer: UniformBuffer) {\r\n if (this._cameraFacing) {\r\n uniformBuffer.updateMatrix(\"grl_projection\", this._scene.getProjectionMatrix());\r\n uniformBuffer.updateMatrix(\"viewProjection\", this._scene.getTransformMatrix());\r\n\r\n const resolutionLineWidth = TmpVectors.Vector4[0];\r\n resolutionLineWidth.x = this._aspect;\r\n resolutionLineWidth.y = this._resolution.x;\r\n resolutionLineWidth.z = this._resolution.y;\r\n resolutionLineWidth.w = this.width;\r\n uniformBuffer.updateVector4(\"grl_aspect_resolution_lineWidth\", resolutionLineWidth);\r\n }\r\n\r\n const dashOptions = TmpVectors.Vector4[0];\r\n dashOptions.x = GreasedLineTools.BooleanToNumber(this.useDash);\r\n dashOptions.y = this._dashArray;\r\n dashOptions.z = this.dashOffset;\r\n dashOptions.w = this.dashRatio;\r\n uniformBuffer.updateVector4(\"grl_dashOptions\", dashOptions);\r\n\r\n const colorModeVisibilityColorsWidthUseColors = TmpVectors.Vector4[1];\r\n colorModeVisibilityColorsWidthUseColors.x = this.colorMode;\r\n colorModeVisibilityColorsWidthUseColors.y = this.visibility;\r\n colorModeVisibilityColorsWidthUseColors.z = this.colorsTexture ? this.colorsTexture.getSize().width : 0;\r\n colorModeVisibilityColorsWidthUseColors.w = GreasedLineTools.BooleanToNumber(this.useColors);\r\n uniformBuffer.updateVector4(\"grl_colorMode_visibility_colorsWidth_useColors\", colorModeVisibilityColorsWidthUseColors);\r\n\r\n if (this._color) {\r\n uniformBuffer.updateColor3(\"grl_singleColor\", this._color);\r\n }\r\n const texture = this.colorsTexture ?? GreasedLineMaterialDefaults.EmptyColorsTexture;\r\n uniformBuffer.setTexture(\"grl_colors\", texture);\r\n uniformBuffer.updateFloat2(\"grl_textureSize\", texture?.getSize().width ?? 1, texture?.getSize().height ?? 1);\r\n }\r\n\r\n /**\r\n * Prepare the defines\r\n * @param defines\r\n * @param _scene\r\n * @param _mesh\r\n */\r\n override prepareDefines(defines: MaterialGreasedLineDefines, _scene: Scene, _mesh: AbstractMesh) {\r\n defines.GREASED_LINE_HAS_COLOR = !!this.color && !this.useColors;\r\n defines.GREASED_LINE_SIZE_ATTENUATION = this._sizeAttenuation;\r\n defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE;\r\n defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = _scene.useRightHandedSystem;\r\n defines.GREASED_LINE_CAMERA_FACING = this._cameraFacing;\r\n }\r\n\r\n /**\r\n * Get the class name\r\n * @returns class name\r\n */\r\n override getClassName() {\r\n return GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME;\r\n }\r\n\r\n /**\r\n * Get shader code\r\n * @param shaderType vertex/fragment\r\n * @param shaderLanguage GLSL or WGSL\r\n * @returns shader code\r\n */\r\n override getCustomCode(shaderType: string, shaderLanguage = ShaderLanguage.GLSL): Nullable<{ [pointName: string]: string }> {\r\n if (this._isGLSL(shaderLanguage)) {\r\n return getCustomCodeGLSL(shaderType, this._cameraFacing);\r\n }\r\n return getCustomCodeWGSL(shaderType, this._cameraFacing);\r\n }\r\n\r\n /**\r\n * Disposes the plugin material.\r\n */\r\n public override dispose(): void {\r\n this.colorsTexture?.dispose();\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Returns the colors used to colorize the line\r\n */\r\n get colors() {\r\n return this._colors;\r\n }\r\n\r\n /**\r\n * Sets the colors used to colorize the line\r\n */\r\n set colors(value: Nullable<Color3[]>) {\r\n this.setColors(value);\r\n }\r\n\r\n /**\r\n * Creates or updates the colors texture\r\n * @param colors color table RGBA\r\n * @param lazy if lazy, the colors are not updated\r\n * @param forceNewTexture force creation of a new texture\r\n */\r\n public setColors(colors: Nullable<Color3[]>, lazy = false, forceNewTexture = false): void {\r\n const origColorsCount = this._colors?.length ?? 0;\r\n\r\n this._colors = colors;\r\n\r\n if (colors === null || colors.length === 0) {\r\n this.colorsTexture?.dispose();\r\n return;\r\n }\r\n\r\n if (lazy && !forceNewTexture) {\r\n return;\r\n }\r\n\r\n if (this.colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\r\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\r\n this.colorsTexture.update(colorArray);\r\n } else {\r\n this.colorsTexture?.dispose();\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, colors, this.colorsSampling, this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Updates the material. Use when material created in lazy mode.\r\n */\r\n public updateLazy() {\r\n if (this._colors) {\r\n this.setColors(this._colors, false, true);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the number of dashes in the line\r\n */\r\n get dashCount() {\r\n return this._dashCount;\r\n }\r\n /**\r\n * Sets the number of dashes in the line\r\n * @param value dash\r\n */\r\n set dashCount(value: number) {\r\n this._dashCount = value;\r\n this._dashArray = 1 / value;\r\n }\r\n\r\n /**\r\n * If set to true the line will be rendered always with the same width regardless how far it is located from the camera.\r\n * Not supported for non camera facing lines.\r\n */\r\n get sizeAttenuation() {\r\n return this._sizeAttenuation;\r\n }\r\n\r\n /**\r\n * Turn on/off size attenuation of the width option and widths array.\r\n * Not supported for non camera facing lines.\r\n * @param value If set to true the line will be rendered always with the same width regardless how far it is located from the camera.\r\n */\r\n set sizeAttenuation(value: boolean) {\r\n this._sizeAttenuation = value;\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the color of the line\r\n */\r\n get color() {\r\n return this._color;\r\n }\r\n\r\n /**\r\n * Sets the color of the line\r\n * @param value Color3 or null to clear the color. You need to clear the color if you use colors and useColors = true\r\n */\r\n set color(value: Nullable<Color3>) {\r\n this.setColor(value);\r\n }\r\n\r\n /**\r\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\r\n * @param value color\r\n * @param doNotMarkDirty if true, the material will not be marked as dirty\r\n */\r\n public setColor(value: Nullable<Color3>, doNotMarkDirty = false) {\r\n if ((this._color === null && value !== null) || (this._color !== null && value === null)) {\r\n this._color = value;\r\n !doNotMarkDirty && this.markAllDefinesAsDirty();\r\n } else {\r\n this._color = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the color distributiopn type\r\n */\r\n get colorsDistributionType() {\r\n return this._colorsDistributionType;\r\n }\r\n\r\n /**\r\n * Sets the color distribution type\r\n * @see GreasedLineMeshColorDistributionType\r\n * @param value color distribution type\r\n */\r\n set colorsDistributionType(value: GreasedLineMeshColorDistributionType) {\r\n this._colorsDistributionType = value;\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the resolution\r\n */\r\n get resolution() {\r\n return this._resolution;\r\n }\r\n\r\n /**\r\n * Sets the resolution\r\n * @param value resolution of the screen for GreasedLine\r\n */\r\n set resolution(value: Vector2) {\r\n this._aspect = value.x / value.y;\r\n this._resolution = value;\r\n }\r\n\r\n /**\r\n * Serializes this plugin material\r\n * @returns serializationObjec\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n const greasedLineMaterialOptions: GreasedLineMaterialOptions = {\r\n colorDistributionType: this._colorsDistributionType,\r\n colorsSampling: this.colorsSampling,\r\n colorMode: this.colorMode,\r\n dashCount: this._dashCount,\r\n dashOffset: this.dashOffset,\r\n dashRatio: this.dashRatio,\r\n resolution: this._resolution,\r\n sizeAttenuation: this._sizeAttenuation,\r\n useColors: this.useColors,\r\n useDash: this.useDash,\r\n visibility: this.visibility,\r\n width: this.width,\r\n };\r\n\r\n this._colors && (greasedLineMaterialOptions.colors = this._colors);\r\n this._color && (greasedLineMaterialOptions.color = this._color);\r\n\r\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a serialized objects\r\n * @param source serialized object\r\n * @param scene scene\r\n * @param rootUrl root url for textures\r\n */\r\n public override parse(source: any, scene: Scene, rootUrl: string): void {\r\n super.parse(source, scene, rootUrl);\r\n const greasedLineMaterialOptions = <GreasedLineMaterialOptions>source.greasedLineMaterialOptions;\r\n\r\n this.colorsTexture?.dispose();\r\n\r\n greasedLineMaterialOptions.color && this.setColor(greasedLineMaterialOptions.color, true);\r\n greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);\r\n greasedLineMaterialOptions.colors && (this.colors = greasedLineMaterialOptions.colors);\r\n greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);\r\n greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);\r\n greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);\r\n greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);\r\n greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);\r\n greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);\r\n greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);\r\n greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);\r\n greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);\r\n greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);\r\n greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);\r\n\r\n if (this.colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, this.colors, this.colorsSampling, scene);\r\n } else {\r\n GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public override copyTo(plugin: MaterialPluginBase): void {\r\n const dest = plugin as GreasedLinePluginMaterial;\r\n\r\n dest.colorsTexture?.dispose();\r\n\r\n if (this._colors) {\r\n dest.colorsTexture = GreasedLineTools.CreateColorsTexture(`${dest._material.name}-colors-texture`, this._colors, dest.colorsSampling, this._scene);\r\n }\r\n\r\n dest.setColor(this.color, true);\r\n dest.colorsDistributionType = this.colorsDistributionType;\r\n dest.colorsSampling = this.colorsSampling;\r\n dest.colorMode = this.colorMode;\r\n dest.useColors = this.useColors;\r\n dest.visibility = this.visibility;\r\n dest.useDash = this.useDash;\r\n dest.dashCount = this.dashCount;\r\n dest.dashRatio = this.dashRatio;\r\n dest.dashOffset = this.dashOffset;\r\n dest.width = this.width;\r\n dest.sizeAttenuation = this.sizeAttenuation;\r\n dest.resolution = this.resolution;\r\n\r\n dest.markAllDefinesAsDirty();\r\n }\r\n\r\n private _isGLSL(shaderLanguage: ShaderLanguage) {\r\n return shaderLanguage === ShaderLanguage.GLSL || this._forceGLSL;\r\n }\r\n}\r\n\r\nRegisterClass(`BABYLON.${GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME}`, GreasedLinePluginMaterial);\r\n"]}
1
+ {"version":3,"file":"greasedLinePluginMaterial.js","sourceRoot":"","sources":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yB,CAAC,CAAC","sourcesContent":["import type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport { RawTexture } from \"../Textures/rawTexture\";\r\nimport { MaterialPluginBase } from \"../materialPluginBase\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { UniformBuffer } from \"../uniformBuffer\";\r\nimport { Vector2, TmpVectors } from \"../../Maths/math.vector\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Material } from \"../material\";\r\nimport { MaterialDefines } from \"../materialDefines\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"../Textures/baseTexture\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { ShaderLanguage } from \"../shaderLanguage\";\r\n\r\nimport type { GreasedLineMaterialOptions, IGreasedLineMaterial } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshColorDistributionType, GreasedLineMeshColorMode } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport { GetCustomCode as getCustomCodeGLSL } from \"./greasedLinePluginMaterialShadersGLSL\";\r\nimport { GetCustomCode as getCustomCodeWGSL } from \"./greasedLinePluginMaterialShadersWGSL\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class MaterialGreasedLineDefines extends MaterialDefines {\r\n /**\r\n * The material has a color option specified\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_HAS_COLOR = false;\r\n /**\r\n * The material's size attenuation optiom\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_SIZE_ATTENUATION = false;\r\n /**\r\n * The type of color distribution is set to line this value equals to true.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = false;\r\n /**\r\n * True if scene is in right handed coordinate system.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = false;\r\n\r\n /**\r\n * True if the line is in camera facing mode\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n GREASED_LINE_CAMERA_FACING = true;\r\n}\r\n\r\n/**\r\n * GreasedLinePluginMaterial for GreasedLineMesh/GreasedLineRibbonMesh.\r\n * Use the GreasedLineBuilder.CreateGreasedLineMaterial function to create and instance of this class.\r\n */\r\nexport class GreasedLinePluginMaterial extends MaterialPluginBase implements IGreasedLineMaterial {\r\n /**\r\n * Plugin name\r\n */\r\n public static readonly GREASED_LINE_MATERIAL_NAME = \"GreasedLinePluginMaterial\";\r\n\r\n /**\r\n * Force all the greased lines to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static ForceGLSL = false;\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n public useColors: boolean;\r\n\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n public visibility: number;\r\n\r\n /**\r\n * Dash offset\r\n */\r\n public dashOffset: number;\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n public dashRatio: number;\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n public width: number;\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n public colorsSampling: number;\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n public useDash: boolean;\r\n\r\n /**\r\n * The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET\r\n * @see GreasedLineMeshColorMode\r\n */\r\n public colorMode: GreasedLineMeshColorMode;\r\n\r\n /**\r\n * You can provide a colorsTexture to use instead of one generated from the 'colors' option\r\n */\r\n public colorsTexture: Nullable<RawTexture> = null;\r\n\r\n private _scene: Scene;\r\n private _dashCount: number;\r\n private _dashArray: number;\r\n private _color: Nullable<Color3>;\r\n private _colors: Nullable<Color3[]>;\r\n private _colorsDistributionType: GreasedLineMeshColorDistributionType;\r\n private _resolution: Vector2;\r\n private _aspect: number;\r\n private _sizeAttenuation: boolean;\r\n\r\n private _cameraFacing: boolean;\r\n\r\n private _engine: AbstractEngine;\r\n\r\n private _forceGLSL = false;\r\n\r\n /**\r\n * Gets a boolean indicating that the plugin is compatible with a given shader language\r\n * @param _shaderLanguage The shader language to use\r\n * @returns true if the plugin is compatible with the shader language. Return always true since both GLSL and WGSL are supported\r\n */\r\n public override isCompatible(_shaderLanguage: ShaderLanguage): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Creates a new instance of the GreasedLinePluginMaterial\r\n * @param material Base material for the plugin\r\n * @param scene The scene\r\n * @param options Plugin options\r\n */\r\n constructor(material: Material, scene?: Scene, options?: GreasedLineMaterialOptions) {\r\n options = options || {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n\r\n const defines = new MaterialGreasedLineDefines();\r\n defines.GREASED_LINE_HAS_COLOR = !!options.color && !options.useColors;\r\n defines.GREASED_LINE_SIZE_ATTENUATION = options.sizeAttenuation ?? false;\r\n defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = options.colorDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE;\r\n defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = (scene ?? material.getScene()).useRightHandedSystem;\r\n defines.GREASED_LINE_CAMERA_FACING = options.cameraFacing ?? true;\r\n super(material, GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME, 200, defines, true, true);\r\n\r\n this._forceGLSL = options?.forceGLSL || GreasedLinePluginMaterial.ForceGLSL;\r\n\r\n this._scene = scene ?? material.getScene();\r\n this._engine = this._scene.getEngine();\r\n\r\n this._cameraFacing = options.cameraFacing ?? true;\r\n\r\n this.visibility = options.visibility ?? 1;\r\n this.useDash = options.useDash ?? false;\r\n this.dashRatio = options.dashRatio ?? 0.5;\r\n this.dashOffset = options.dashOffset ?? 0;\r\n this.width = options.width ? options.width : options.sizeAttenuation ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n this._sizeAttenuation = options.sizeAttenuation ?? false;\r\n this.colorMode = options.colorMode ?? GreasedLineMeshColorMode.COLOR_MODE_SET;\r\n this._color = options.color ?? null;\r\n this.useColors = options.useColors ?? false;\r\n this._colorsDistributionType = options.colorDistributionType ?? GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;\r\n this._colors = options.colors ?? null;\r\n\r\n this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter\r\n this.resolution = options.resolution ?? new Vector2(this._engine.getRenderWidth(), this._engine.getRenderHeight()); // calculate aspect call the setter\r\n\r\n if (options.colorsTexture) {\r\n this.colorsTexture = options.colorsTexture; // colorsTexture from options takes precedence\r\n } else {\r\n if (this._colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${material.name}-colors-texture`, this._colors, this.colorsSampling, this._scene);\r\n } else {\r\n this._color = this._color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n GreasedLineTools.PrepareEmptyColorsTexture(this._scene);\r\n }\r\n }\r\n\r\n this._engine.onDisposeObservable.add(() => {\r\n GreasedLineTools.DisposeEmptyColorsTexture();\r\n });\r\n }\r\n\r\n /**\r\n * Get the shader attributes\r\n * @param attributes array which will be filled with the attributes\r\n */\r\n override getAttributes(attributes: string[]) {\r\n attributes.push(\"grl_offsets\");\r\n attributes.push(\"grl_widths\");\r\n attributes.push(\"grl_colorPointers\");\r\n attributes.push(\"grl_counters\");\r\n if (this._cameraFacing) {\r\n attributes.push(\"grl_previousAndSide\");\r\n attributes.push(\"grl_nextAndCounters\");\r\n } else {\r\n attributes.push(\"grl_slopes\");\r\n }\r\n }\r\n\r\n /**\r\n * Get the shader samplers\r\n * @param samplers\r\n */\r\n override getSamplers(samplers: string[]) {\r\n samplers.push(\"grl_colors\");\r\n }\r\n\r\n /**\r\n * Get the shader textures\r\n * @param activeTextures array which will be filled with the textures\r\n */\r\n public override getActiveTextures(activeTextures: BaseTexture[]): void {\r\n if (this.colorsTexture) {\r\n activeTextures.push(this.colorsTexture);\r\n }\r\n }\r\n\r\n /**\r\n * Get the shader uniforms\r\n * @param shaderLanguage The shader language to use\r\n * @returns uniforms\r\n */\r\n override getUniforms(shaderLanguage = ShaderLanguage.GLSL) {\r\n const ubo = [\r\n { name: \"grl_singleColor\", size: 3, type: \"vec3\" },\r\n { name: \"grl_textureSize\", size: 2, type: \"vec2\" },\r\n { name: \"grl_dashOptions\", size: 4, type: \"vec4\" },\r\n { name: \"grl_colorMode_visibility_colorsWidth_useColors\", size: 4, type: \"vec4\" },\r\n ];\r\n if (this._cameraFacing) {\r\n ubo.push({ name: \"grl_projection\", size: 16, type: \"mat4\" }, { name: \"grl_aspect_resolution_lineWidth\", size: 4, type: \"vec4\" });\r\n }\r\n\r\n if (shaderLanguage === ShaderLanguage.WGSL) {\r\n ubo.push({\r\n name: \"viewProjection\",\r\n size: 16,\r\n type: \"mat4\",\r\n });\r\n }\r\n\r\n return {\r\n ubo,\r\n vertex:\r\n this._cameraFacing && this._isGLSL(shaderLanguage)\r\n ? `\r\n uniform vec4 grl_aspect_resolution_lineWidth;\r\n uniform mat4 grl_projection;\r\n `\r\n : \"\",\r\n fragment: this._isGLSL(shaderLanguage)\r\n ? `\r\n uniform vec4 grl_dashOptions;\r\n uniform vec2 grl_textureSize;\r\n uniform vec4 grl_colorMode_visibility_colorsWidth_useColors;\r\n uniform vec3 grl_singleColor;\r\n `\r\n : \"\",\r\n };\r\n }\r\n\r\n // only getter, it doesn't make sense to use this plugin on a mesh other than GreasedLineMesh\r\n // and it doesn't make sense to disable it on the mesh\r\n get isEnabled() {\r\n return true;\r\n }\r\n\r\n /**\r\n * Bind the uniform buffer\r\n * @param uniformBuffer\r\n */\r\n override bindForSubMesh(uniformBuffer: UniformBuffer) {\r\n if (this._cameraFacing) {\r\n uniformBuffer.updateMatrix(\"grl_projection\", this._scene.getProjectionMatrix());\r\n !this._isGLSL(this._material.shaderLanguage) && uniformBuffer.updateMatrix(\"viewProjection\", this._scene.getTransformMatrix());\r\n\r\n const resolutionLineWidth = TmpVectors.Vector4[0];\r\n resolutionLineWidth.x = this._aspect;\r\n resolutionLineWidth.y = this._resolution.x;\r\n resolutionLineWidth.z = this._resolution.y;\r\n resolutionLineWidth.w = this.width;\r\n uniformBuffer.updateVector4(\"grl_aspect_resolution_lineWidth\", resolutionLineWidth);\r\n }\r\n\r\n const dashOptions = TmpVectors.Vector4[0];\r\n dashOptions.x = GreasedLineTools.BooleanToNumber(this.useDash);\r\n dashOptions.y = this._dashArray;\r\n dashOptions.z = this.dashOffset;\r\n dashOptions.w = this.dashRatio;\r\n uniformBuffer.updateVector4(\"grl_dashOptions\", dashOptions);\r\n\r\n const colorModeVisibilityColorsWidthUseColors = TmpVectors.Vector4[1];\r\n colorModeVisibilityColorsWidthUseColors.x = this.colorMode;\r\n colorModeVisibilityColorsWidthUseColors.y = this.visibility;\r\n colorModeVisibilityColorsWidthUseColors.z = this.colorsTexture ? this.colorsTexture.getSize().width : 0;\r\n colorModeVisibilityColorsWidthUseColors.w = GreasedLineTools.BooleanToNumber(this.useColors);\r\n uniformBuffer.updateVector4(\"grl_colorMode_visibility_colorsWidth_useColors\", colorModeVisibilityColorsWidthUseColors);\r\n\r\n if (this._color) {\r\n uniformBuffer.updateColor3(\"grl_singleColor\", this._color);\r\n }\r\n const texture = this.colorsTexture ?? GreasedLineMaterialDefaults.EmptyColorsTexture;\r\n uniformBuffer.setTexture(\"grl_colors\", texture);\r\n uniformBuffer.updateFloat2(\"grl_textureSize\", texture?.getSize().width ?? 1, texture?.getSize().height ?? 1);\r\n }\r\n\r\n /**\r\n * Prepare the defines\r\n * @param defines\r\n * @param _scene\r\n * @param _mesh\r\n */\r\n override prepareDefines(defines: MaterialGreasedLineDefines, _scene: Scene, _mesh: AbstractMesh) {\r\n defines.GREASED_LINE_HAS_COLOR = !!this.color && !this.useColors;\r\n defines.GREASED_LINE_SIZE_ATTENUATION = this._sizeAttenuation;\r\n defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE;\r\n defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = _scene.useRightHandedSystem;\r\n defines.GREASED_LINE_CAMERA_FACING = this._cameraFacing;\r\n }\r\n\r\n /**\r\n * Get the class name\r\n * @returns class name\r\n */\r\n override getClassName() {\r\n return GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME;\r\n }\r\n\r\n /**\r\n * Get shader code\r\n * @param shaderType vertex/fragment\r\n * @param shaderLanguage GLSL or WGSL\r\n * @returns shader code\r\n */\r\n override getCustomCode(shaderType: string, shaderLanguage = ShaderLanguage.GLSL): Nullable<{ [pointName: string]: string }> {\r\n if (this._isGLSL(shaderLanguage)) {\r\n return getCustomCodeGLSL(shaderType, this._cameraFacing);\r\n }\r\n return getCustomCodeWGSL(shaderType, this._cameraFacing);\r\n }\r\n\r\n /**\r\n * Disposes the plugin material.\r\n */\r\n public override dispose(): void {\r\n this.colorsTexture?.dispose();\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Returns the colors used to colorize the line\r\n */\r\n get colors() {\r\n return this._colors;\r\n }\r\n\r\n /**\r\n * Sets the colors used to colorize the line\r\n */\r\n set colors(value: Nullable<Color3[]>) {\r\n this.setColors(value);\r\n }\r\n\r\n /**\r\n * Creates or updates the colors texture\r\n * @param colors color table RGBA\r\n * @param lazy if lazy, the colors are not updated\r\n * @param forceNewTexture force creation of a new texture\r\n */\r\n public setColors(colors: Nullable<Color3[]>, lazy = false, forceNewTexture = false): void {\r\n const origColorsCount = this._colors?.length ?? 0;\r\n\r\n this._colors = colors;\r\n\r\n if (colors === null || colors.length === 0) {\r\n this.colorsTexture?.dispose();\r\n return;\r\n }\r\n\r\n if (lazy && !forceNewTexture) {\r\n return;\r\n }\r\n\r\n if (this.colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\r\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\r\n this.colorsTexture.update(colorArray);\r\n } else {\r\n this.colorsTexture?.dispose();\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, colors, this.colorsSampling, this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Updates the material. Use when material created in lazy mode.\r\n */\r\n public updateLazy() {\r\n if (this._colors) {\r\n this.setColors(this._colors, false, true);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the number of dashes in the line\r\n */\r\n get dashCount() {\r\n return this._dashCount;\r\n }\r\n /**\r\n * Sets the number of dashes in the line\r\n * @param value dash\r\n */\r\n set dashCount(value: number) {\r\n this._dashCount = value;\r\n this._dashArray = 1 / value;\r\n }\r\n\r\n /**\r\n * If set to true the line will be rendered always with the same width regardless how far it is located from the camera.\r\n * Not supported for non camera facing lines.\r\n */\r\n get sizeAttenuation() {\r\n return this._sizeAttenuation;\r\n }\r\n\r\n /**\r\n * Turn on/off size attenuation of the width option and widths array.\r\n * Not supported for non camera facing lines.\r\n * @param value If set to true the line will be rendered always with the same width regardless how far it is located from the camera.\r\n */\r\n set sizeAttenuation(value: boolean) {\r\n this._sizeAttenuation = value;\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the color of the line\r\n */\r\n get color() {\r\n return this._color;\r\n }\r\n\r\n /**\r\n * Sets the color of the line\r\n * @param value Color3 or null to clear the color. You need to clear the color if you use colors and useColors = true\r\n */\r\n set color(value: Nullable<Color3>) {\r\n this.setColor(value);\r\n }\r\n\r\n /**\r\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\r\n * @param value color\r\n * @param doNotMarkDirty if true, the material will not be marked as dirty\r\n */\r\n public setColor(value: Nullable<Color3>, doNotMarkDirty = false) {\r\n if ((this._color === null && value !== null) || (this._color !== null && value === null)) {\r\n this._color = value;\r\n !doNotMarkDirty && this.markAllDefinesAsDirty();\r\n } else {\r\n this._color = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the color distributiopn type\r\n */\r\n get colorsDistributionType() {\r\n return this._colorsDistributionType;\r\n }\r\n\r\n /**\r\n * Sets the color distribution type\r\n * @see GreasedLineMeshColorDistributionType\r\n * @param value color distribution type\r\n */\r\n set colorsDistributionType(value: GreasedLineMeshColorDistributionType) {\r\n this._colorsDistributionType = value;\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the resolution\r\n */\r\n get resolution() {\r\n return this._resolution;\r\n }\r\n\r\n /**\r\n * Sets the resolution\r\n * @param value resolution of the screen for GreasedLine\r\n */\r\n set resolution(value: Vector2) {\r\n this._aspect = value.x / value.y;\r\n this._resolution = value;\r\n }\r\n\r\n /**\r\n * Serializes this plugin material\r\n * @returns serializationObjec\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n const greasedLineMaterialOptions: GreasedLineMaterialOptions = {\r\n colorDistributionType: this._colorsDistributionType,\r\n colorsSampling: this.colorsSampling,\r\n colorMode: this.colorMode,\r\n dashCount: this._dashCount,\r\n dashOffset: this.dashOffset,\r\n dashRatio: this.dashRatio,\r\n resolution: this._resolution,\r\n sizeAttenuation: this._sizeAttenuation,\r\n useColors: this.useColors,\r\n useDash: this.useDash,\r\n visibility: this.visibility,\r\n width: this.width,\r\n };\r\n\r\n this._colors && (greasedLineMaterialOptions.colors = this._colors);\r\n this._color && (greasedLineMaterialOptions.color = this._color);\r\n\r\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a serialized objects\r\n * @param source serialized object\r\n * @param scene scene\r\n * @param rootUrl root url for textures\r\n */\r\n public override parse(source: any, scene: Scene, rootUrl: string): void {\r\n super.parse(source, scene, rootUrl);\r\n const greasedLineMaterialOptions = <GreasedLineMaterialOptions>source.greasedLineMaterialOptions;\r\n\r\n this.colorsTexture?.dispose();\r\n\r\n greasedLineMaterialOptions.color && this.setColor(greasedLineMaterialOptions.color, true);\r\n greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);\r\n greasedLineMaterialOptions.colors && (this.colors = greasedLineMaterialOptions.colors);\r\n greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);\r\n greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);\r\n greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);\r\n greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);\r\n greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);\r\n greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);\r\n greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);\r\n greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);\r\n greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);\r\n greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);\r\n greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);\r\n\r\n if (this.colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, this.colors, this.colorsSampling, scene);\r\n } else {\r\n GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n\r\n this.markAllDefinesAsDirty();\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public override copyTo(plugin: MaterialPluginBase): void {\r\n const dest = plugin as GreasedLinePluginMaterial;\r\n\r\n dest.colorsTexture?.dispose();\r\n\r\n if (this._colors) {\r\n dest.colorsTexture = GreasedLineTools.CreateColorsTexture(`${dest._material.name}-colors-texture`, this._colors, dest.colorsSampling, this._scene);\r\n }\r\n\r\n dest.setColor(this.color, true);\r\n dest.colorsDistributionType = this.colorsDistributionType;\r\n dest.colorsSampling = this.colorsSampling;\r\n dest.colorMode = this.colorMode;\r\n dest.useColors = this.useColors;\r\n dest.visibility = this.visibility;\r\n dest.useDash = this.useDash;\r\n dest.dashCount = this.dashCount;\r\n dest.dashRatio = this.dashRatio;\r\n dest.dashOffset = this.dashOffset;\r\n dest.width = this.width;\r\n dest.sizeAttenuation = this.sizeAttenuation;\r\n dest.resolution = this.resolution;\r\n\r\n dest.markAllDefinesAsDirty();\r\n }\r\n\r\n private _isGLSL(shaderLanguage: ShaderLanguage) {\r\n return shaderLanguage === ShaderLanguage.GLSL || this._forceGLSL;\r\n }\r\n}\r\n\r\nRegisterClass(`BABYLON.${GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME}`, GreasedLinePluginMaterial);\r\n"]}
@@ -53,12 +53,24 @@ export class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial {
53
53
  serialize() {
54
54
  const serializationObject = SerializationHelper.Serialize(this);
55
55
  serializationObject.customType = "BABYLON.PBRMetallicRoughnessMaterial";
56
- serializationObject.clearCoat = this.clearCoat.serialize();
57
- serializationObject.anisotropy = this.anisotropy.serialize();
58
- serializationObject.brdf = this.brdf.serialize();
59
- serializationObject.sheen = this.sheen.serialize();
60
- serializationObject.subSurface = this.subSurface.serialize();
61
- serializationObject.iridescence = this.iridescence.serialize();
56
+ if (!this.clearCoat.doNotSerialize) {
57
+ serializationObject.clearCoat = this.clearCoat.serialize();
58
+ }
59
+ if (!this.anisotropy.doNotSerialize) {
60
+ serializationObject.anisotropy = this.anisotropy.serialize();
61
+ }
62
+ if (!this.brdf.doNotSerialize) {
63
+ serializationObject.brdf = this.brdf.serialize();
64
+ }
65
+ if (!this.sheen.doNotSerialize) {
66
+ serializationObject.sheen = this.sheen.serialize();
67
+ }
68
+ if (!this.subSurface.doNotSerialize) {
69
+ serializationObject.subSurface = this.subSurface.serialize();
70
+ }
71
+ if (!this.iridescence.doNotSerialize) {
72
+ serializationObject.iridescence = this.iridescence.serialize();
73
+ }
62
74
  return serializationObject;
63
75
  }
64
76
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pbrMetallicRoughnessMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrMetallicRoughnessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,qBAAqB;IA2CnE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,KAAa;QACnC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,qCAAqC,GAAG,KAAK,CAAC;QACnD,IAAI,CAAC,qCAAqC,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,qCAAqC,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IACzB,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,8BAA8B,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACa,KAAK,CAAC,IAAY;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AC;CACJ;AA3HU;IAFN,iBAAiB,EAAE;IACnB,gBAAgB,CAAC,kCAAkC,EAAE,cAAc,CAAC;+DAC5C;AAQlB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,gBAAgB,CAAC;iEAC7B;AAQnC;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;8DAC7B;AAQjB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;+DAC5B;AAQlB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;8EAClB;AA6F3D,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\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 type { 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/blob/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness/README.md\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 * @returns the current class name of the material.\r\n */\r\n public override 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 * @returns cloned material instance\r\n */\r\n public override 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 * @returns the JSON object\r\n */\r\n public override 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 serializationObject.iridescence = this.iridescence.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 - JSON source object.\r\n * @param scene - Defines the scene we are parsing for\r\n * @param rootUrl - Defines the rootUrl of this parsed object\r\n * @returns a new PBRMetalRoughnessMaterial\r\n */\r\n public static override 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 if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMetallicRoughnessMaterial\", PBRMetallicRoughnessMaterial);\r\n"]}
1
+ {"version":3,"file":"pbr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,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAvIU;IAFN,iBAAiB,EAAE;IACnB,gBAAgB,CAAC,kCAAkC,EAAE,cAAc,CAAC;+DAC5C;AAQlB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,gBAAgB,CAAC;iEAC7B;AAQnC;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;8DAC7B;AAQjB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;+DAC5B;AAQlB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;8EAClB;AAyG3D,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\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 type { 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/blob/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness/README.md\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 * @returns the current class name of the material.\r\n */\r\n public override 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 * @returns cloned material instance\r\n */\r\n public override 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 * @returns the JSON object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.PBRMetallicRoughnessMaterial\";\r\n\r\n if (!this.clearCoat.doNotSerialize) {\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n }\r\n if (!this.anisotropy.doNotSerialize) {\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n }\r\n if (!this.brdf.doNotSerialize) {\r\n serializationObject.brdf = this.brdf.serialize();\r\n }\r\n if (!this.sheen.doNotSerialize) {\r\n serializationObject.sheen = this.sheen.serialize();\r\n }\r\n if (!this.subSurface.doNotSerialize) {\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n }\r\n if (!this.iridescence.doNotSerialize) {\r\n serializationObject.iridescence = this.iridescence.serialize();\r\n }\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 - JSON source object.\r\n * @param scene - Defines the scene we are parsing for\r\n * @param rootUrl - Defines the rootUrl of this parsed object\r\n * @returns a new PBRMetalRoughnessMaterial\r\n */\r\n public static override 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 if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMetallicRoughnessMaterial\", PBRMetallicRoughnessMaterial);\r\n"]}
@@ -55,12 +55,24 @@ export class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial {
55
55
  serialize() {
56
56
  const serializationObject = SerializationHelper.Serialize(this);
57
57
  serializationObject.customType = "BABYLON.PBRSpecularGlossinessMaterial";
58
- serializationObject.clearCoat = this.clearCoat.serialize();
59
- serializationObject.anisotropy = this.anisotropy.serialize();
60
- serializationObject.brdf = this.brdf.serialize();
61
- serializationObject.sheen = this.sheen.serialize();
62
- serializationObject.subSurface = this.subSurface.serialize();
63
- serializationObject.iridescence = this.iridescence.serialize();
58
+ if (!this.clearCoat.doNotSerialize) {
59
+ serializationObject.clearCoat = this.clearCoat.serialize();
60
+ }
61
+ if (!this.anisotropy.doNotSerialize) {
62
+ serializationObject.anisotropy = this.anisotropy.serialize();
63
+ }
64
+ if (!this.brdf.doNotSerialize) {
65
+ serializationObject.brdf = this.brdf.serialize();
66
+ }
67
+ if (!this.sheen.doNotSerialize) {
68
+ serializationObject.sheen = this.sheen.serialize();
69
+ }
70
+ if (!this.subSurface.doNotSerialize) {
71
+ serializationObject.subSurface = this.subSurface.serialize();
72
+ }
73
+ if (!this.iridescence.doNotSerialize) {
74
+ serializationObject.iridescence = this.iridescence.serialize();
75
+ }
64
76
  return serializationObject;
65
77
  }
66
78
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pbrSpecularGlossinessMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrSpecularGlossinessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3G,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M,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACpB,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AA3HU;IAFN,iBAAiB,CAAC,SAAS,CAAC;IAC5B,gBAAgB,CAAC,kCAAkC,EAAE,cAAc,CAAC;mEACzC;AAQrB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,gBAAgB,CAAC;qEAC1B;AAOtC;IAFN,iBAAiB,CAAC,UAAU,CAAC;IAC7B,gBAAgB,CAAC,kCAAkC,EAAE,oBAAoB,CAAC;oEAC9C;AAOtB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,EAAE,eAAe,CAAC;iEAC5C;AAOnB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,sBAAsB,CAAC;gFACrB;AAgG5D,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { serialize, 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 type { Nullable } from \"../../types\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\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 * @returns the current class name of the material.\r\n */\r\n public override 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 * @returns cloned material instance\r\n */\r\n public override 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 * @returns the JSON object\r\n */\r\n public override 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 serializationObject.iridescence = this.iridescence.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 - JSON source object.\r\n * @param scene - the scene to parse to.\r\n * @param rootUrl - root url of the assets.\r\n * @returns a new PBRSpecularGlossinessMaterial.\r\n */\r\n public static override 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 if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRSpecularGlossinessMaterial\", PBRSpecularGlossinessMaterial);\r\n"]}
1
+ {"version":3,"file":"pbrSpecularGlossinessMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrSpecularGlossinessMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3G,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,OAAO,6BAA8B,SAAQ,qBAAqB;IAqCpE;;OAEG;IACH,IAAW,uCAAuC;QAC9C,OAAO,IAAI,CAAC,wCAAwC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,KAAa;QACnC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,wCAAwC,GAAG,IAAI,CAAC;IACzD,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,+BAA+B,CAAC;IA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,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACpB,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAvIU;IAFN,iBAAiB,CAAC,SAAS,CAAC;IAC5B,gBAAgB,CAAC,kCAAkC,EAAE,cAAc,CAAC;mEACzC;AAQrB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,gBAAgB,CAAC;qEAC1B;AAOtC;IAFN,iBAAiB,CAAC,UAAU,CAAC;IAC7B,gBAAgB,CAAC,kCAAkC,EAAE,oBAAoB,CAAC;oEAC9C;AAOtB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,EAAE,eAAe,CAAC;iEAC5C;AAOnB;IAFN,kBAAkB,EAAE;IACpB,gBAAgB,CAAC,kCAAkC,EAAE,sBAAsB,CAAC;gFACrB;AA4G5D,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { serialize, 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 type { Nullable } from \"../../types\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\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 * @returns the current class name of the material.\r\n */\r\n public override 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 * @returns cloned material instance\r\n */\r\n public override 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 * @returns the JSON object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.PBRSpecularGlossinessMaterial\";\r\n\r\n if (!this.clearCoat.doNotSerialize) {\r\n serializationObject.clearCoat = this.clearCoat.serialize();\r\n }\r\n if (!this.anisotropy.doNotSerialize) {\r\n serializationObject.anisotropy = this.anisotropy.serialize();\r\n }\r\n if (!this.brdf.doNotSerialize) {\r\n serializationObject.brdf = this.brdf.serialize();\r\n }\r\n if (!this.sheen.doNotSerialize) {\r\n serializationObject.sheen = this.sheen.serialize();\r\n }\r\n if (!this.subSurface.doNotSerialize) {\r\n serializationObject.subSurface = this.subSurface.serialize();\r\n }\r\n if (!this.iridescence.doNotSerialize) {\r\n serializationObject.iridescence = this.iridescence.serialize();\r\n }\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 - JSON source object.\r\n * @param scene - the scene to parse to.\r\n * @param rootUrl - root url of the assets.\r\n * @returns a new PBRSpecularGlossinessMaterial.\r\n */\r\n public static override 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 if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRSpecularGlossinessMaterial\", PBRSpecularGlossinessMaterial);\r\n"]}
@@ -289,6 +289,8 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
289
289
  * Otherwise, return null.
290
290
  */
291
291
  get depthStencilTexture(): Nullable<InternalTexture>;
292
+ /** @internal */
293
+ _disableEngineStages: boolean;
292
294
  /**
293
295
  * Instantiate a render target texture. This is mainly used to render of screen the scene to for instance apply post process
294
296
  * or used a shadow, depth texture...
@@ -323,6 +323,8 @@ export class RenderTargetTexture extends Texture {
323
323
  * It must define where the camera used to render the texture is set
324
324
  */
325
325
  this.boundingBoxPosition = Vector3.Zero();
326
+ /** @internal */
327
+ this._disableEngineStages = false; // TODO: remove this when the shadow generator task (frame graph) is reworked (see https://github.com/BabylonJS/Babylon.js/pull/15962#discussion_r1874417607)
326
328
  this._dumpToolsLoading = false;
327
329
  scene = this.getScene();
328
330
  if (!scene) {
@@ -341,8 +343,10 @@ export class RenderTargetTexture extends Texture {
341
343
  });
342
344
  this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(() => {
343
345
  // Before clear
344
- for (const step of this._scene._beforeRenderTargetClearStage) {
345
- step.action(this, this._currentFaceIndex, this._currentLayer);
346
+ if (!this._disableEngineStages) {
347
+ for (const step of this._scene._beforeRenderTargetClearStage) {
348
+ step.action(this, this._currentFaceIndex, this._currentLayer);
349
+ }
346
350
  }
347
351
  // Clear
348
352
  if (this.onClearObservable.hasObservers()) {
@@ -355,14 +359,18 @@ export class RenderTargetTexture extends Texture {
355
359
  this._scene.updateTransformMatrix(true);
356
360
  }
357
361
  // Before Camera Draw
358
- for (const step of this._scene._beforeRenderTargetDrawStage) {
359
- step.action(this, this._currentFaceIndex, this._currentLayer);
362
+ if (!this._disableEngineStages) {
363
+ for (const step of this._scene._beforeRenderTargetDrawStage) {
364
+ step.action(this, this._currentFaceIndex, this._currentLayer);
365
+ }
360
366
  }
361
367
  });
362
368
  this._objectRenderer.onAfterRenderingManagerRenderObservable.add(() => {
363
369
  // After Camera Draw
364
- for (const step of this._scene._afterRenderTargetDrawStage) {
365
- step.action(this, this._currentFaceIndex, this._currentLayer);
370
+ if (!this._disableEngineStages) {
371
+ for (const step of this._scene._afterRenderTargetDrawStage) {
372
+ step.action(this, this._currentFaceIndex, this._currentLayer);
373
+ }
366
374
  }
367
375
  const saveGenerateMipMaps = this._texture?.generateMipMaps ?? false;
368
376
  if (this._texture) {
@@ -376,8 +384,10 @@ export class RenderTargetTexture extends Texture {
376
384
  else if (this._currentUseCameraPostProcess) {
377
385
  this._scene.postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, this._currentFaceIndex);
378
386
  }
379
- for (const step of this._scene._afterRenderTargetPostProcessStage) {
380
- step.action(this, this._currentFaceIndex, this._currentLayer);
387
+ if (!this._disableEngineStages) {
388
+ for (const step of this._scene._afterRenderTargetPostProcessStage) {
389
+ step.action(this, this._currentFaceIndex, this._currentLayer);
390
+ }
381
391
  }
382
392
  if (this._texture) {
383
393
  this._texture.generateMipMaps = saveGenerateMipMaps;