@babylonjs/gui 6.39.0 → 6.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/2D/advancedDynamicTexture.d.ts +1 -1
  2. package/2D/advancedDynamicTexture.js +2 -1
  3. package/2D/advancedDynamicTexture.js.map +1 -1
  4. package/2D/controls/button.d.ts +2 -5
  5. package/2D/controls/button.js +6 -6
  6. package/2D/controls/button.js.map +1 -1
  7. package/2D/controls/checkbox.js +2 -1
  8. package/2D/controls/checkbox.js.map +1 -1
  9. package/2D/controls/container.d.ts +6 -1
  10. package/2D/controls/container.js +31 -5
  11. package/2D/controls/container.js.map +1 -1
  12. package/2D/controls/control.d.ts +9 -1
  13. package/2D/controls/control.js +16 -2
  14. package/2D/controls/control.js.map +1 -1
  15. package/2D/controls/focusableButton.d.ts +1 -1
  16. package/2D/controls/focusableButton.js +1 -1
  17. package/2D/controls/focusableButton.js.map +1 -1
  18. package/2D/controls/gradient/BaseGradient.d.ts +17 -5
  19. package/2D/controls/gradient/BaseGradient.js +17 -5
  20. package/2D/controls/gradient/BaseGradient.js.map +1 -1
  21. package/2D/controls/grid.d.ts +2 -1
  22. package/2D/controls/grid.js +6 -2
  23. package/2D/controls/grid.js.map +1 -1
  24. package/2D/controls/image.d.ts +2 -1
  25. package/2D/controls/image.js +2 -1
  26. package/2D/controls/image.js.map +1 -1
  27. package/2D/controls/stackPanel.d.ts +2 -1
  28. package/2D/controls/stackPanel.js +6 -2
  29. package/2D/controls/stackPanel.js.map +1 -1
  30. package/2D/xmlLoader.js +9 -0
  31. package/2D/xmlLoader.js.map +1 -1
  32. package/3D/controls/button3D.d.ts +1 -0
  33. package/3D/controls/button3D.js +1 -0
  34. package/3D/controls/button3D.js.map +1 -1
  35. package/3D/controls/control3D.d.ts +1 -1
  36. package/3D/controls/control3D.js +1 -1
  37. package/3D/controls/control3D.js.map +1 -1
  38. package/3D/controls/holographicSlate.d.ts +1 -1
  39. package/3D/controls/holographicSlate.js +1 -1
  40. package/3D/controls/holographicSlate.js.map +1 -1
  41. package/3D/controls/touchHolographicMenu.d.ts +2 -2
  42. package/3D/controls/touchHolographicMenu.js +2 -2
  43. package/3D/controls/touchHolographicMenu.js.map +1 -1
  44. package/3D/materials/fluent/fluentMaterial.js +5 -4
  45. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  46. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +4 -3
  47. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  48. package/3D/materials/fluentButton/fluentButtonMaterial.js +4 -3
  49. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  50. package/3D/materials/mrdl/mrdlBackglowMaterial.js +4 -3
  51. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
  52. package/3D/materials/mrdl/mrdlBackplateMaterial.js +4 -3
  53. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  54. package/3D/materials/mrdl/mrdlFrontplateMaterial.js +4 -3
  55. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
  56. package/3D/materials/mrdl/mrdlInnerquadMaterial.js +4 -3
  57. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
  58. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +4 -3
  59. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  60. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +4 -3
  61. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  62. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"mrdlBackglowMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlBackglowMaterial.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAA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mB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACjH,CAAC;CACJ;AAnTU;IADN,SAAS,EAAE;yDACc;AAMnB;IADN,SAAS,EAAE;uDACY;AAOjB;IADN,SAAS,EAAE;2DACiB;AAMtB;IADN,SAAS,EAAE;0DACc;AAMnB;IADN,SAAS,EAAE;oDACQ;AAMb;IADN,SAAS,EAAE;0DACc;AAMnB;IADN,SAAS,EAAE;qEACyB;AAM9B;IADN,SAAS,EAAE;4DACiB;AAMtB;IADN,SAAS,EAAE;0DACe;AAMpB;IADN,SAAS,EAAE;mDACgD;AAMrD;IADN,SAAS,EAAE;wDAC4D;AAMjE;IADN,SAAS,EAAE;2DACe;AAMpB;IADN,SAAS,EAAE;qDACS;AAMd;IADN,SAAS,EAAE;kDACM;AAsOtB,aAAa,CAAC,kCAAkC,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\n\r\nimport \"./shaders/mrdlBackglow.fragment\";\r\nimport \"./shaders/mrdlBackglow.vertex\";\r\n\r\n/** @hidden */\r\nclass MRDLBackglowMaterialDefines extends MaterialDefines {\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLBackglowMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the bevel radius on the backglow. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public bevelRadius = 0.16;\r\n\r\n /**\r\n * Gets or sets the line width of the backglow.\r\n */\r\n @serialize()\r\n public lineWidth = 0.16;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backglow.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /**\r\n * Gets or sets the tuning motion of the backglow.\r\n */\r\n @serialize()\r\n public tuningMotion = 0.0;\r\n\r\n /**\r\n * Gets or sets the motion of the backglow.\r\n */\r\n @serialize()\r\n public motion = 1.0;\r\n\r\n /**\r\n * Gets or sets the maximum intensity of the backglow.\r\n */\r\n @serialize()\r\n public maxIntensity = 0.7;\r\n\r\n /**\r\n * Gets or sets the fade-in exponent of the intensity of the backglow.\r\n */\r\n @serialize()\r\n public intensityFadeInExponent = 2.0;\r\n\r\n /**\r\n * Gets or sets the start of the outer fuzz effect on the backglow.\r\n */\r\n @serialize()\r\n public outerFuzzStart = 0.04;\r\n\r\n /**\r\n * Gets or sets the end of the outer fuzz effect on the backglow.\r\n */\r\n @serialize()\r\n public outerFuzzEnd = 0.04;\r\n\r\n /**\r\n * Gets or sets the color of the backglow.\r\n */\r\n @serialize()\r\n public color: Color4 = new Color4(0.682353, 0.698039, 1, 1);\r\n\r\n /**\r\n * Gets or sets the inner color of the backglow.\r\n */\r\n @serialize()\r\n public innerColor: Color4 = new Color4(0.356863, 0.392157, 0.796078, 1);\r\n\r\n /**\r\n * Gets or sets the blend exponent of the backglow.\r\n */\r\n @serialize()\r\n public blendExponent = 1.5;\r\n\r\n /**\r\n * Gets or sets the falloff of the backglow.\r\n */\r\n @serialize()\r\n public falloff = 2.0;\r\n\r\n /**\r\n * Gets or sets the bias of the backglow.\r\n */\r\n @serialize()\r\n public bias = 0.5;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_ADD;\r\n this.disableDepthWrite = true;\r\n this.backFaceCulling = false;\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLBackglowMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLBackglowMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlBackglow\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Bevel_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Tuning_Motion_\",\r\n \"_Motion_\",\r\n \"_Max_Intensity_\",\r\n \"_Intensity_Fade_In_Exponent_\",\r\n \"_Outer_Fuzz_Start_\",\r\n \"_Outer_Fuzz_End_\",\r\n \"_Color_\",\r\n \"_Inner_Color_\",\r\n \"_Blend_Exponent_\",\r\n \"_Falloff_\",\r\n \"_Bias_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLBackglowMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Rounded Rectangle\"\r\n this._activeEffect.setFloat(\"_Bevel_Radius_\", this.bevelRadius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n\r\n // \"Animation\"\r\n this._activeEffect.setFloat(\"_Tuning_Motion_\", this.tuningMotion);\r\n this._activeEffect.setFloat(\"_Motion_\", this.motion);\r\n this._activeEffect.setFloat(\"_Max_Intensity_\", this.maxIntensity);\r\n this._activeEffect.setFloat(\"_Intensity_Fade_In_Exponent_\", this.intensityFadeInExponent);\r\n this._activeEffect.setFloat(\"_Outer_Fuzz_Start_\", this.outerFuzzStart);\r\n this._activeEffect.setFloat(\"_Outer_Fuzz_End_\", this.outerFuzzEnd);\r\n\r\n // \"Color\"\r\n this._activeEffect.setDirectColor4(\"_Color_\", this.color);\r\n this._activeEffect.setDirectColor4(\"_Inner_Color_\", this.innerColor);\r\n this._activeEffect.setFloat(\"_Blend_Exponent_\", this.blendExponent);\r\n\r\n // \"Inner Transition\"\r\n this._activeEffect.setFloat(\"_Falloff_\", this.falloff);\r\n this._activeEffect.setFloat(\"_Bias_\", this.bias);\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLBackglowMaterial {\r\n return SerializationHelper.Clone(() => new MRDLBackglowMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLBackglowMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLBackglowMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLBackglowMaterial {\r\n return SerializationHelper.Parse(() => new MRDLBackglowMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLBackglowMaterial\", MRDLBackglowMaterial);\r\n"]}
1
+ {"version":3,"file":"mrdlBackglowMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlBackglowMaterial.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AACt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AE,OAAO,CAAC,CAAC;IACjH,CAAC;CACJ;AArTU;IADN,SAAS,EAAE;yDACc;AAMnB;IADN,SAAS,EAAE;uDACY;AAOjB;IADN,SAAS,EAAE;2DACiB;AAMtB;IADN,SAAS,EAAE;0DACc;AAMnB;IADN,SAAS,EAAE;oDACQ;AAMb;IADN,SAAS,EAAE;0DACc;AAMnB;IADN,SAAS,EAAE;qEACyB;AAM9B;IADN,SAAS,EAAE;4DACiB;AAMtB;IADN,SAAS,EAAE;0DACe;AAMpB;IADN,SAAS,EAAE;mDACgD;AAMrD;IADN,SAAS,EAAE;wDAC4D;AAMjE;IADN,SAAS,EAAE;2DACe;AAMpB;IADN,SAAS,EAAE;qDACS;AAMd;IADN,SAAS,EAAE;kDACM;AAwOtB,aAAa,CAAC,kCAAkC,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\n\r\nimport \"./shaders/mrdlBackglow.fragment\";\r\nimport \"./shaders/mrdlBackglow.vertex\";\r\n\r\n/** @hidden */\r\nclass MRDLBackglowMaterialDefines extends MaterialDefines {\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLBackglowMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the bevel radius on the backglow. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public bevelRadius = 0.16;\r\n\r\n /**\r\n * Gets or sets the line width of the backglow.\r\n */\r\n @serialize()\r\n public lineWidth = 0.16;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backglow.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /**\r\n * Gets or sets the tuning motion of the backglow.\r\n */\r\n @serialize()\r\n public tuningMotion = 0.0;\r\n\r\n /**\r\n * Gets or sets the motion of the backglow.\r\n */\r\n @serialize()\r\n public motion = 1.0;\r\n\r\n /**\r\n * Gets or sets the maximum intensity of the backglow.\r\n */\r\n @serialize()\r\n public maxIntensity = 0.7;\r\n\r\n /**\r\n * Gets or sets the fade-in exponent of the intensity of the backglow.\r\n */\r\n @serialize()\r\n public intensityFadeInExponent = 2.0;\r\n\r\n /**\r\n * Gets or sets the start of the outer fuzz effect on the backglow.\r\n */\r\n @serialize()\r\n public outerFuzzStart = 0.04;\r\n\r\n /**\r\n * Gets or sets the end of the outer fuzz effect on the backglow.\r\n */\r\n @serialize()\r\n public outerFuzzEnd = 0.04;\r\n\r\n /**\r\n * Gets or sets the color of the backglow.\r\n */\r\n @serialize()\r\n public color: Color4 = new Color4(0.682353, 0.698039, 1, 1);\r\n\r\n /**\r\n * Gets or sets the inner color of the backglow.\r\n */\r\n @serialize()\r\n public innerColor: Color4 = new Color4(0.356863, 0.392157, 0.796078, 1);\r\n\r\n /**\r\n * Gets or sets the blend exponent of the backglow.\r\n */\r\n @serialize()\r\n public blendExponent = 1.5;\r\n\r\n /**\r\n * Gets or sets the falloff of the backglow.\r\n */\r\n @serialize()\r\n public falloff = 2.0;\r\n\r\n /**\r\n * Gets or sets the bias of the backglow.\r\n */\r\n @serialize()\r\n public bias = 0.5;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_ADD;\r\n this.disableDepthWrite = true;\r\n this.backFaceCulling = false;\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLBackglowMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLBackglowMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlBackglow\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Bevel_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Tuning_Motion_\",\r\n \"_Motion_\",\r\n \"_Max_Intensity_\",\r\n \"_Intensity_Fade_In_Exponent_\",\r\n \"_Outer_Fuzz_Start_\",\r\n \"_Outer_Fuzz_End_\",\r\n \"_Color_\",\r\n \"_Inner_Color_\",\r\n \"_Blend_Exponent_\",\r\n \"_Falloff_\",\r\n \"_Bias_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLBackglowMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Rounded Rectangle\"\r\n this._activeEffect.setFloat(\"_Bevel_Radius_\", this.bevelRadius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n\r\n // \"Animation\"\r\n this._activeEffect.setFloat(\"_Tuning_Motion_\", this.tuningMotion);\r\n this._activeEffect.setFloat(\"_Motion_\", this.motion);\r\n this._activeEffect.setFloat(\"_Max_Intensity_\", this.maxIntensity);\r\n this._activeEffect.setFloat(\"_Intensity_Fade_In_Exponent_\", this.intensityFadeInExponent);\r\n this._activeEffect.setFloat(\"_Outer_Fuzz_Start_\", this.outerFuzzStart);\r\n this._activeEffect.setFloat(\"_Outer_Fuzz_End_\", this.outerFuzzEnd);\r\n\r\n // \"Color\"\r\n this._activeEffect.setDirectColor4(\"_Color_\", this.color);\r\n this._activeEffect.setDirectColor4(\"_Inner_Color_\", this.innerColor);\r\n this._activeEffect.setFloat(\"_Blend_Exponent_\", this.blendExponent);\r\n\r\n // \"Inner Transition\"\r\n this._activeEffect.setFloat(\"_Falloff_\", this.falloff);\r\n this._activeEffect.setFloat(\"_Bias_\", this.bias);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLBackglowMaterial {\r\n return SerializationHelper.Clone(() => new MRDLBackglowMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLBackglowMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLBackglowMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLBackglowMaterial {\r\n return SerializationHelper.Parse(() => new MRDLBackglowMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLBackglowMaterial\", MRDLBackglowMaterial);\r\n"]}
@@ -155,8 +155,9 @@ export class MRDLBackplateMaterial extends PushMaterial {
155
155
  }
156
156
  // Methods
157
157
  isReadyForSubMesh(mesh, subMesh) {
158
+ const drawWrapper = subMesh._drawWrapper;
158
159
  if (this.isFrozen) {
159
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
160
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
160
161
  return true;
161
162
  }
162
163
  }
@@ -265,7 +266,7 @@ export class MRDLBackplateMaterial extends PushMaterial {
265
266
  return false;
266
267
  }
267
268
  defines._renderId = scene.getRenderId();
268
- subMesh.effect._wasPreviouslyReady = true;
269
+ drawWrapper._wasPreviouslyReady = true;
269
270
  return true;
270
271
  }
271
272
  bindForSubMesh(world, mesh, subMesh) {
@@ -324,7 +325,7 @@ export class MRDLBackplateMaterial extends PushMaterial {
324
325
  this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
325
326
  // "Antialiasing"
326
327
  //define SMOOTH_EDGES true;
327
- this._afterBind(mesh, this._activeEffect);
328
+ this._afterBind(mesh, this._activeEffect, subMesh);
328
329
  }
329
330
  /**
330
331
  * Get the list of animatables in the material.
@@ -1 +1 @@
1
- {"version":3,"file":"mrdlBackplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AAEtE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAC1D,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAE/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAKnD,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,SAAS,EAAE,6CAA+B;AAEnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AAExC,gBAAgB;AAChB,MAAM,4BAA6B,SAAQ,eAAe;IAOtD;QACI,KAAK,EAAE,CAAC;QAPZ;;UAEE;QACK,uBAAkB,GAAG,IAAI,CAAC;QAC1B,iBAAY,GAAG,IAAI,CAAC;QAIvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IA0KnD,YAAY,IAAY,EAAE,KAAa;QACnC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QApKvB;;WAEG;QAEI,WAAM,GAAG,GAAG,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import type { Nullable } from \"core/types\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector4 } from \"core/Maths/math.vector\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\nimport \"./shaders/mrdlBackplate.fragment\";\r\nimport \"./shaders/mrdlBackplate.vertex\";\r\n\r\n/** @internal */\r\nclass MRDLBackplateMaterialDefines extends MaterialDefines {\r\n /*\r\n \"IRIDESCENCE_ENABLE\", \"SMOOTH_EDGES\"\r\n */\r\n public IRIDESCENCE_ENABLE = true;\r\n public SMOOTH_EDGES = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\n/**\r\n * Class used to render backplate material with MRDL\r\n */\r\nexport class MRDLBackplateMaterial extends PushMaterial {\r\n /**\r\n * URL pointing to the texture used to define the coloring for the Iridescent Map effect.\r\n */\r\n public static IRIDESCENT_MAP_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png\";\r\n private _iridescentMapTexture: Texture;\r\n\r\n /**\r\n * Gets or sets the corner radius on the backplate. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.3;\r\n\r\n /**\r\n * Gets or sets the line width of the backplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.003;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backplate.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /** @internal */\r\n public _filterWidth = 1;\r\n\r\n /**\r\n * Gets or sets the base color of the backplate.\r\n */\r\n @serialize()\r\n public baseColor = new Color4(0, 0, 0, 1);\r\n\r\n /**\r\n * Gets or sets the line color of the backplate.\r\n */\r\n @serialize()\r\n public lineColor = new Color4(0.2, 0.262745, 0.4, 1);\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusTopLeft = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusTopRight = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusBottomLeft = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusBottomRight = 1.0;\r\n\r\n /** @internal */\r\n public _rate = 0;\r\n\r\n /**\r\n * Gets or sets the color of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightColor = new Color4(0.239216, 0.435294, 0.827451, 1);\r\n\r\n /**\r\n * Gets or sets the width of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightWidth = 0;\r\n\r\n /** @internal */\r\n public _highlightTransform = new Vector4(1, 1, 0, 0);\r\n\r\n /** @internal */\r\n public _highlight = 1;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect.\r\n */\r\n @serialize()\r\n public iridescenceIntensity = 0.45;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect on the backplate edges.\r\n */\r\n @serialize()\r\n public iridescenceEdgeIntensity = 1;\r\n\r\n /**\r\n * Gets or sets the Tint of the iridescence effect on the backplate.\r\n */\r\n @serialize()\r\n public iridescenceTint = new Color4(1, 1, 1, 1);\r\n\r\n /** @internal */\r\n public _angle = -45;\r\n\r\n /**\r\n * Gets or sets the opacity of the backplate (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public fadeOut = 1;\r\n\r\n /** @internal */\r\n public _reflected = true;\r\n\r\n /** @internal */\r\n public _frequency = 1;\r\n\r\n /** @internal */\r\n public _verticalOffset = 0;\r\n\r\n /**\r\n * Gets or sets the gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public gradientColor = new Color4(0.74902, 0.74902, 0.74902, 1);\r\n\r\n /**\r\n * Gets or sets the top left gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public topLeftGradientColor = new Color4(0.00784314, 0.294118, 0.580392, 1);\r\n\r\n /**\r\n * Gets or sets the top right gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public topRightGradientColor = new Color4(0.305882, 0, 1, 1);\r\n\r\n /**\r\n * Gets or sets the bottom left gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public bottomLeftGradientColor = new Color4(0.133333, 0.258824, 0.992157, 1);\r\n\r\n /**\r\n * Gets or sets the bottom right gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public bottomRightGradientColor = new Color4(0.176471, 0.176471, 0.619608, 1);\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgeWidth = 0.5;\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgePower = 1;\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgeLineGradientBlend = 0.5;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_DISABLE;\r\n this.backFaceCulling = false;\r\n\r\n this._iridescentMapTexture = new Texture(MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return false;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLBackplateMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLBackplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlBackplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Filter_Width_\",\r\n \"_Base_Color_\",\r\n \"_Line_Color_\",\r\n \"_Radius_Top_Left_\",\r\n \"_Radius_Top_Right_\",\r\n \"_Radius_Bottom_Left_\",\r\n \"_Radius_Bottom_Right_\",\r\n \"_Rate_\",\r\n \"_Highlight_Color_\",\r\n \"_Highlight_Width_\",\r\n \"_Highlight_Transform_\",\r\n \"_Highlight_\",\r\n \"_Iridescence_Intensity_\",\r\n \"_Iridescence_Edge_Intensity_\",\r\n \"_Iridescence_Tint_\",\r\n \"_Iridescent_Map_\",\r\n \"_Angle_\",\r\n \"_Reflected_\",\r\n \"_Frequency_\",\r\n \"_Vertical_Offset_\",\r\n \"_Gradient_Color_\",\r\n \"_Top_Left_\",\r\n \"_Top_Right_\",\r\n \"_Bottom_Left_\",\r\n \"_Bottom_Right_\",\r\n \"_Edge_Width_\",\r\n \"_Edge_Power_\",\r\n \"_Line_Gradient_Blend_\",\r\n \"_Fade_Out_\",\r\n ];\r\n const samplers: string[] = [\"_Iridescent_Map_\"];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const defines = <MRDLBackplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", this.getScene().activeCamera!.position);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Base_Color_\", this.baseColor);\r\n this._activeEffect.setDirectColor4(\"_Line_Color_\", this.lineColor);\r\n\r\n // \"Radii Multipliers\"\r\n this._activeEffect.setFloat(\"_Radius_Top_Left_\", this.radiusTopLeft);\r\n this._activeEffect.setFloat(\"_Radius_Top_Right_\", this.radiusTopRight);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Left_\", this.radiusBottomLeft);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Right_\", this.radiusBottomRight);\r\n\r\n // \"Line Highlight\"\r\n this._activeEffect.setFloat(\"_Rate_\", this._rate);\r\n this._activeEffect.setDirectColor4(\"_Highlight_Color_\", this.highlightColor);\r\n this._activeEffect.setFloat(\"_Highlight_Width_\", this.highlightWidth);\r\n this._activeEffect.setVector4(\"_Highlight_Transform_\", this._highlightTransform);\r\n this._activeEffect.setFloat(\"_Highlight_\", this._highlight);\r\n\r\n // \"Iridescence\"\r\n //define IRIDESCENCE_ENABLE true;\r\n this._activeEffect.setFloat(\"_Iridescence_Intensity_\", this.iridescenceIntensity);\r\n this._activeEffect.setFloat(\"_Iridescence_Edge_Intensity_\", this.iridescenceEdgeIntensity);\r\n this._activeEffect.setDirectColor4(\"_Iridescence_Tint_\", this.iridescenceTint);\r\n this._activeEffect.setTexture(\"_Iridescent_Map_\", this._iridescentMapTexture);\r\n this._activeEffect.setFloat(\"_Angle_\", this._angle);\r\n this._activeEffect.setFloat(\"_Reflected_\", this._reflected ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Frequency_\", this._frequency);\r\n this._activeEffect.setFloat(\"_Vertical_Offset_\", this._verticalOffset);\r\n\r\n // \"Gradient\"\r\n this._activeEffect.setDirectColor4(\"_Gradient_Color_\", this.gradientColor);\r\n this._activeEffect.setDirectColor4(\"_Top_Left_\", this.topLeftGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Top_Right_\", this.topRightGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Bottom_Left_\", this.bottomLeftGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Bottom_Right_\", this.bottomRightGradientColor);\r\n //define EDGE_ONLY false;\r\n this._activeEffect.setFloat(\"_Edge_Width_\", this.edgeWidth);\r\n this._activeEffect.setFloat(\"_Edge_Power_\", this.edgePower);\r\n this._activeEffect.setFloat(\"_Line_Gradient_Blend_\", this.edgeLineGradientBlend);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLBackplateMaterial {\r\n return SerializationHelper.Clone(() => new MRDLBackplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.MRDLBackplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLBackplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLBackplateMaterial {\r\n return SerializationHelper.Parse(() => new MRDLBackplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLBackplateMaterial\", MRDLBackplateMaterial);\r\n"]}
1
+ {"version":3,"file":"mrdlBackplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AAEtE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAC1D,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAE/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAKnD,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,SAAS,EAAE,6CAA+B;AAEnD,OAAO,kCAAkC,CAA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ADN,SAAS,EAAE;6DACc;AAYnB;IADN,SAAS,EAAE;mEACuB;AAM5B;IADN,SAAS,EAAE;uEACwB;AAM7B;IADN,SAAS,EAAE;8DACoC;AASzC;IADN,SAAS,EAAE;sDACO;AAeZ;IADN,SAAS,EAAE;4DACoD;AAMzD;IADN,SAAS,EAAE;mEACgE;AAMrE;IADN,SAAS,EAAE;oEACiD;AAMtD;IADN,SAAS,EAAE;sEACiE;AAMtE;IADN,SAAS,EAAE;uEACkE;AAMvE;IADN,SAAS,EAAE;wDACW;AAMhB;IADN,SAAS,EAAE;wDACS;AAMd;IADN,SAAS,EAAE;oEACuB;AAgRvC,aAAa,CAAC,mCAAmC,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector4 } from \"core/Maths/math.vector\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\nimport \"./shaders/mrdlBackplate.fragment\";\r\nimport \"./shaders/mrdlBackplate.vertex\";\r\n\r\n/** @internal */\r\nclass MRDLBackplateMaterialDefines extends MaterialDefines {\r\n /*\r\n \"IRIDESCENCE_ENABLE\", \"SMOOTH_EDGES\"\r\n */\r\n public IRIDESCENCE_ENABLE = true;\r\n public SMOOTH_EDGES = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\n/**\r\n * Class used to render backplate material with MRDL\r\n */\r\nexport class MRDLBackplateMaterial extends PushMaterial {\r\n /**\r\n * URL pointing to the texture used to define the coloring for the Iridescent Map effect.\r\n */\r\n public static IRIDESCENT_MAP_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png\";\r\n private _iridescentMapTexture: Texture;\r\n\r\n /**\r\n * Gets or sets the corner radius on the backplate. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.3;\r\n\r\n /**\r\n * Gets or sets the line width of the backplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.003;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backplate.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /** @internal */\r\n public _filterWidth = 1;\r\n\r\n /**\r\n * Gets or sets the base color of the backplate.\r\n */\r\n @serialize()\r\n public baseColor = new Color4(0, 0, 0, 1);\r\n\r\n /**\r\n * Gets or sets the line color of the backplate.\r\n */\r\n @serialize()\r\n public lineColor = new Color4(0.2, 0.262745, 0.4, 1);\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusTopLeft = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusTopRight = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusBottomLeft = 1.0;\r\n\r\n /**\r\n * Gets or sets the top left Radii Multiplier.\r\n */\r\n @serialize()\r\n public radiusBottomRight = 1.0;\r\n\r\n /** @internal */\r\n public _rate = 0;\r\n\r\n /**\r\n * Gets or sets the color of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightColor = new Color4(0.239216, 0.435294, 0.827451, 1);\r\n\r\n /**\r\n * Gets or sets the width of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightWidth = 0;\r\n\r\n /** @internal */\r\n public _highlightTransform = new Vector4(1, 1, 0, 0);\r\n\r\n /** @internal */\r\n public _highlight = 1;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect.\r\n */\r\n @serialize()\r\n public iridescenceIntensity = 0.45;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect on the backplate edges.\r\n */\r\n @serialize()\r\n public iridescenceEdgeIntensity = 1;\r\n\r\n /**\r\n * Gets or sets the Tint of the iridescence effect on the backplate.\r\n */\r\n @serialize()\r\n public iridescenceTint = new Color4(1, 1, 1, 1);\r\n\r\n /** @internal */\r\n public _angle = -45;\r\n\r\n /**\r\n * Gets or sets the opacity of the backplate (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public fadeOut = 1;\r\n\r\n /** @internal */\r\n public _reflected = true;\r\n\r\n /** @internal */\r\n public _frequency = 1;\r\n\r\n /** @internal */\r\n public _verticalOffset = 0;\r\n\r\n /**\r\n * Gets or sets the gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public gradientColor = new Color4(0.74902, 0.74902, 0.74902, 1);\r\n\r\n /**\r\n * Gets or sets the top left gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public topLeftGradientColor = new Color4(0.00784314, 0.294118, 0.580392, 1);\r\n\r\n /**\r\n * Gets or sets the top right gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public topRightGradientColor = new Color4(0.305882, 0, 1, 1);\r\n\r\n /**\r\n * Gets or sets the bottom left gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public bottomLeftGradientColor = new Color4(0.133333, 0.258824, 0.992157, 1);\r\n\r\n /**\r\n * Gets or sets the bottom right gradient color effect on the backplate.\r\n */\r\n @serialize()\r\n public bottomRightGradientColor = new Color4(0.176471, 0.176471, 0.619608, 1);\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgeWidth = 0.5;\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgePower = 1;\r\n\r\n /**\r\n * Gets or sets the edge width of the backplate.\r\n */\r\n @serialize()\r\n public edgeLineGradientBlend = 0.5;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_DISABLE;\r\n this.backFaceCulling = false;\r\n\r\n this._iridescentMapTexture = new Texture(MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return false;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLBackplateMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLBackplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlBackplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Filter_Width_\",\r\n \"_Base_Color_\",\r\n \"_Line_Color_\",\r\n \"_Radius_Top_Left_\",\r\n \"_Radius_Top_Right_\",\r\n \"_Radius_Bottom_Left_\",\r\n \"_Radius_Bottom_Right_\",\r\n \"_Rate_\",\r\n \"_Highlight_Color_\",\r\n \"_Highlight_Width_\",\r\n \"_Highlight_Transform_\",\r\n \"_Highlight_\",\r\n \"_Iridescence_Intensity_\",\r\n \"_Iridescence_Edge_Intensity_\",\r\n \"_Iridescence_Tint_\",\r\n \"_Iridescent_Map_\",\r\n \"_Angle_\",\r\n \"_Reflected_\",\r\n \"_Frequency_\",\r\n \"_Vertical_Offset_\",\r\n \"_Gradient_Color_\",\r\n \"_Top_Left_\",\r\n \"_Top_Right_\",\r\n \"_Bottom_Left_\",\r\n \"_Bottom_Right_\",\r\n \"_Edge_Width_\",\r\n \"_Edge_Power_\",\r\n \"_Line_Gradient_Blend_\",\r\n \"_Fade_Out_\",\r\n ];\r\n const samplers: string[] = [\"_Iridescent_Map_\"];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const defines = <MRDLBackplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", this.getScene().activeCamera!.position);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Base_Color_\", this.baseColor);\r\n this._activeEffect.setDirectColor4(\"_Line_Color_\", this.lineColor);\r\n\r\n // \"Radii Multipliers\"\r\n this._activeEffect.setFloat(\"_Radius_Top_Left_\", this.radiusTopLeft);\r\n this._activeEffect.setFloat(\"_Radius_Top_Right_\", this.radiusTopRight);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Left_\", this.radiusBottomLeft);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Right_\", this.radiusBottomRight);\r\n\r\n // \"Line Highlight\"\r\n this._activeEffect.setFloat(\"_Rate_\", this._rate);\r\n this._activeEffect.setDirectColor4(\"_Highlight_Color_\", this.highlightColor);\r\n this._activeEffect.setFloat(\"_Highlight_Width_\", this.highlightWidth);\r\n this._activeEffect.setVector4(\"_Highlight_Transform_\", this._highlightTransform);\r\n this._activeEffect.setFloat(\"_Highlight_\", this._highlight);\r\n\r\n // \"Iridescence\"\r\n //define IRIDESCENCE_ENABLE true;\r\n this._activeEffect.setFloat(\"_Iridescence_Intensity_\", this.iridescenceIntensity);\r\n this._activeEffect.setFloat(\"_Iridescence_Edge_Intensity_\", this.iridescenceEdgeIntensity);\r\n this._activeEffect.setDirectColor4(\"_Iridescence_Tint_\", this.iridescenceTint);\r\n this._activeEffect.setTexture(\"_Iridescent_Map_\", this._iridescentMapTexture);\r\n this._activeEffect.setFloat(\"_Angle_\", this._angle);\r\n this._activeEffect.setFloat(\"_Reflected_\", this._reflected ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Frequency_\", this._frequency);\r\n this._activeEffect.setFloat(\"_Vertical_Offset_\", this._verticalOffset);\r\n\r\n // \"Gradient\"\r\n this._activeEffect.setDirectColor4(\"_Gradient_Color_\", this.gradientColor);\r\n this._activeEffect.setDirectColor4(\"_Top_Left_\", this.topLeftGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Top_Right_\", this.topRightGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Bottom_Left_\", this.bottomLeftGradientColor);\r\n this._activeEffect.setDirectColor4(\"_Bottom_Right_\", this.bottomRightGradientColor);\r\n //define EDGE_ONLY false;\r\n this._activeEffect.setFloat(\"_Edge_Width_\", this.edgeWidth);\r\n this._activeEffect.setFloat(\"_Edge_Power_\", this.edgePower);\r\n this._activeEffect.setFloat(\"_Line_Gradient_Blend_\", this.edgeLineGradientBlend);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLBackplateMaterial {\r\n return SerializationHelper.Clone(() => new MRDLBackplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.MRDLBackplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLBackplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLBackplateMaterial {\r\n return SerializationHelper.Parse(() => new MRDLBackplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLBackplateMaterial\", MRDLBackplateMaterial);\r\n"]}
@@ -194,8 +194,9 @@ export class MRDLFrontplateMaterial extends PushMaterial {
194
194
  }
195
195
  // Methods
196
196
  isReadyForSubMesh(mesh, subMesh) {
197
+ const drawWrapper = subMesh._drawWrapper;
197
198
  if (this.isFrozen) {
198
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
199
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
199
200
  return true;
200
201
  }
201
202
  }
@@ -318,7 +319,7 @@ export class MRDLFrontplateMaterial extends PushMaterial {
318
319
  return false;
319
320
  }
320
321
  defines._renderId = scene.getRenderId();
321
- subMesh.effect._wasPreviouslyReady = true;
322
+ drawWrapper._wasPreviouslyReady = true;
322
323
  return true;
323
324
  }
324
325
  bindForSubMesh(world, mesh, subMesh) {
@@ -386,7 +387,7 @@ export class MRDLFrontplateMaterial extends PushMaterial {
386
387
  this._activeEffect.setFloat("_Use_Global_Right_Index_", this.useGlobalRightIndex ? 1.0 : 0.0);
387
388
  // "Antialiasing"
388
389
  //define SMOOTH_EDGES true;
389
- this._afterBind(mesh, this._activeEffect);
390
+ this._afterBind(mesh, this._activeEffect, subMesh);
390
391
  }
391
392
  /**
392
393
  * Get the list of animatables in the material.
@@ -1 +1 @@
1
- {"version":3,"file":"mrdlFrontplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlFrontplateMaterial.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AACtE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,YAAY,EAAE,0CAA4B;AACnD,OAAO,EAAE,O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AAS,EAAE;0DACY;AAMjB;IADN,SAAS,EAAE;yDACW;AAMhB;IADN,SAAS,EAAE;6DACe;AAMpB;IADN,SAAS,EAAE;yDACW;AAMhB;IADN,SAAS,EAAE;6DACe;AAMpB;IADN,SAAS,EAAE;wDACU;AAMf;IADN,SAAS,EAAE;6DACe;AAMpB;IADN,SAAS,EAAE;iEACmB;AAMxB;IADN,SAAS,EAAE;gEACmB;AAMxB;IADN,SAAS,EAAE;kEACqB;AAM1B;IADN,SAAS,EAAE;qEACwB;AAM7B;IADN,SAAS,EAAE;oEACuB;AAM5B;IADN,SAAS,EAAE;mEACuB;AAM5B;IADN,SAAS,EAAE;mEACqB;AAM1B;IADN,SAAS,EAAE;kEACqB;AAM1B;IADN,SAAS,EAAE;mEACsB;AAqTtC,aAAa,CAAC,oCAAoC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\nimport \"./shaders/mrdlFrontplate.fragment\";\r\nimport \"./shaders/mrdlFrontplate.vertex\";\r\n\r\n/** @hidden */\r\nclass MRDLFrontplateMaterialDefines extends MaterialDefines {\r\n /**\r\n * Sets default value for \"SMOOTH_EDGES\"\r\n */\r\n public SMOOTH_EDGES = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLFrontplateMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the corner radius on the frontplate. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.12;\r\n\r\n /**\r\n * Gets or sets the line width of the frontplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.01;\r\n\r\n /**\r\n * Gets or sets whether the scale is relative to the frontplate height.\r\n */\r\n @serialize()\r\n public relativeToHeight = false;\r\n\r\n /** @hidden */\r\n public _filterWidth = 1.0;\r\n\r\n /**\r\n * Gets or sets the edge color of the frontplate.\r\n */\r\n @serialize()\r\n public edgeColor: Color4 = new Color4(0.53, 0.53, 0.53, 1);\r\n\r\n /**\r\n * Gets or sets whether to enable blob effects on the frontplate.\r\n */\r\n @serialize()\r\n public blobEnable = true;\r\n\r\n /**\r\n * Gets or sets the blob position on the frontplate.\r\n */\r\n @serialize()\r\n public blobPosition: Vector3 = new Vector3(100, 100, 100);\r\n\r\n /**\r\n * Gets or sets the blob intensity of the frontplate.\r\n */\r\n @serialize()\r\n public blobIntensity = 0.5;\r\n\r\n /**\r\n * Gets or sets the blob near size of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearSize = 0.032;\r\n\r\n /**\r\n * Gets or sets the blob far size of the frontplate.\r\n */\r\n @serialize()\r\n public blobFarSize = 0.048;\r\n\r\n /**\r\n * Gets or sets the blob near distance of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearDistance = 0.008;\r\n\r\n /**\r\n * Gets or sets the blob far distance of the frontplate.\r\n */\r\n @serialize()\r\n public blobFarDistance = 0.064;\r\n\r\n /**\r\n * Gets or sets the blob fade length of the frontplate.\r\n */\r\n @serialize()\r\n public blobFadeLength = 0.04;\r\n\r\n /**\r\n * Gets or sets the blob inner fade of the frontplate.\r\n */\r\n @serialize()\r\n public blobInnerFade = 0.01;\r\n\r\n /**\r\n * Gets or sets the blob pulse of the frontplate.\r\n */\r\n @serialize()\r\n public blobPulse = 0.0;\r\n\r\n /**\r\n * Gets or sets the blob fade effect on the frontplate.\r\n */\r\n @serialize()\r\n public blobFade = 1.0;\r\n\r\n /**\r\n * Gets or sets the maximum size of the blob pulse on the frontplate.\r\n */\r\n @serialize()\r\n public blobPulseMaxSize = 0.05;\r\n\r\n /**\r\n * Gets or sets whether to enable extra blob effects of the frontplate.\r\n */\r\n @serialize()\r\n public blobEnable2 = true;\r\n\r\n /**\r\n * Gets or sets blob2 position of the frontplate.\r\n */\r\n @serialize()\r\n public blobPosition2: Vector3 = new Vector3(10, 10.1, -0.6);\r\n\r\n /**\r\n * Gets or sets the blob2 near size of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearSize2 = 0.008;\r\n\r\n /**\r\n * Gets or sets the blob2 inner fade of the frontplate.\r\n */\r\n @serialize()\r\n public blobInnerFade2 = 0.1;\r\n\r\n /**\r\n * Gets or sets the blob2 pulse of the frontplate.\r\n */\r\n @serialize()\r\n public blobPulse2 = 0.0;\r\n\r\n /**\r\n * Gets or sets the blob2 fade effect on the frontplate.\r\n */\r\n @serialize()\r\n public blobFade2 = 1.0;\r\n\r\n /**\r\n * Gets or sets the gaze intensity of the frontplate.\r\n */\r\n @serialize()\r\n public gazeIntensity = 0.8;\r\n\r\n /**\r\n * Gets or sets the gaze focus of the frontplate.\r\n */\r\n @serialize()\r\n public gazeFocus = 0.0;\r\n\r\n /**\r\n * Gets or sets the selection fuzz of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFuzz = 0.5;\r\n\r\n /**\r\n * Gets or sets the fade intensity of the frontplate.\r\n */\r\n @serialize()\r\n public selected = 1.0;\r\n\r\n /**\r\n * Gets or sets the selection fade intensity of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFade = 0.2;\r\n\r\n /**\r\n * Gets or sets the selection fade size of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFadeSize = 0.0;\r\n\r\n /**\r\n * Gets or sets the selected distance of the frontplate.\r\n */\r\n @serialize()\r\n public selectedDistance = 0.08;\r\n\r\n /**\r\n * Gets or sets the selected fade length of the frontplate.\r\n */\r\n @serialize()\r\n public selectedFadeLength = 0.08;\r\n\r\n /**\r\n * Gets or sets the proximity maximum intensity of the frontplate.\r\n */\r\n @serialize()\r\n public proximityMaxIntensity = 0.45;\r\n\r\n /**\r\n * Gets or sets the proximity far distance of the frontplate.\r\n */\r\n @serialize()\r\n public proximityFarDistance = 0.16;\r\n\r\n /**\r\n * Gets or sets the proximity near radius of the frontplate.\r\n */\r\n @serialize()\r\n public proximityNearRadius = 0.016;\r\n\r\n /**\r\n * Gets or sets the proximity anisotropy of the frontplate.\r\n */\r\n @serialize()\r\n public proximityAnisotropy = 1.0;\r\n\r\n /**\r\n * Gets or sets whether to use global left index on the frontplate.\r\n */\r\n @serialize()\r\n public useGlobalLeftIndex = true;\r\n\r\n /**\r\n * Gets or sets whether to use global right index of the frontplate.\r\n */\r\n @serialize()\r\n public useGlobalRightIndex = true;\r\n\r\n /**\r\n * URL pointing to the texture used to define the coloring for the BLOB.\r\n */\r\n public static BLOB_TEXTURE_URL = \"\";\r\n\r\n /**\r\n * Gets or sets the opacity of the frontplate (0.0 - 1.0).\r\n */\r\n public fadeOut = 1.0;\r\n\r\n private _blobTexture: Texture;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_ADD;\r\n this.disableDepthWrite = true;\r\n this.backFaceCulling = false;\r\n this._blobTexture = new Texture(MRDLFrontplateMaterial.BLOB_TEXTURE_URL, scene, true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLFrontplateMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLFrontplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlFrontplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Relative_To_Height_\",\r\n \"_Filter_Width_\",\r\n \"_Edge_Color_\",\r\n \"_Fade_Out_\",\r\n \"_Smooth_Edges_\",\r\n \"_Blob_Enable_\",\r\n \"_Blob_Position_\",\r\n \"_Blob_Intensity_\",\r\n \"_Blob_Near_Size_\",\r\n \"_Blob_Far_Size_\",\r\n \"_Blob_Near_Distance_\",\r\n \"_Blob_Far_Distance_\",\r\n \"_Blob_Fade_Length_\",\r\n \"_Blob_Inner_Fade_\",\r\n \"_Blob_Pulse_\",\r\n \"_Blob_Fade_\",\r\n \"_Blob_Pulse_Max_Size_\",\r\n \"_Blob_Enable_2_\",\r\n \"_Blob_Position_2_\",\r\n \"_Blob_Near_Size_2_\",\r\n \"_Blob_Inner_Fade_2_\",\r\n \"_Blob_Pulse_2_\",\r\n \"_Blob_Fade_2_\",\r\n \"_Gaze_Intensity_\",\r\n \"_Gaze_Focus_\",\r\n \"_Blob_Texture_\",\r\n \"_Selection_Fuzz_\",\r\n \"_Selected_\",\r\n \"_Selection_Fade_\",\r\n \"_Selection_Fade_Size_\",\r\n \"_Selected_Distance_\",\r\n \"_Selected_Fade_Length_\",\r\n \"_Proximity_Max_Intensity_\",\r\n \"_Proximity_Far_Distance_\",\r\n \"_Proximity_Near_Radius_\",\r\n \"_Proximity_Anisotropy_\",\r\n \"Global_Left_Index_Tip_Position\",\r\n \"Global_Right_Index_Tip_Position\",\r\n \"_Use_Global_Left_Index_\",\r\n \"_Use_Global_Right_Index_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLFrontplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Relative_To_Height_\", this.relativeToHeight ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Edge_Color_\", this.edgeColor);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Blob\"\r\n this._activeEffect.setFloat(\"_Blob_Enable_\", this.blobEnable ? 1.0 : 0.0);\r\n this._activeEffect.setVector3(\"_Blob_Position_\", this.blobPosition);\r\n this._activeEffect.setFloat(\"_Blob_Intensity_\", this.blobIntensity);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_\", this.blobNearSize);\r\n this._activeEffect.setFloat(\"_Blob_Far_Size_\", this.blobFarSize);\r\n this._activeEffect.setFloat(\"_Blob_Near_Distance_\", this.blobNearDistance);\r\n this._activeEffect.setFloat(\"_Blob_Far_Distance_\", this.blobFarDistance);\r\n this._activeEffect.setFloat(\"_Blob_Fade_Length_\", this.blobFadeLength);\r\n this._activeEffect.setFloat(\"_Blob_Inner_Fade_\", this.blobInnerFade);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_\", this.blobPulse);\r\n this._activeEffect.setFloat(\"_Blob_Fade_\", this.blobFade);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_Max_Size_\", this.blobPulseMaxSize);\r\n\r\n // \"Blob 2\"\r\n this._activeEffect.setFloat(\"_Blob_Enable_2_\", this.blobEnable2 ? 1.0 : 0.0);\r\n this._activeEffect.setVector3(\"_Blob_Position_2_\", this.blobPosition2);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_2_\", this.blobNearSize2);\r\n this._activeEffect.setFloat(\"_Blob_Inner_Fade_2_\", this.blobInnerFade2);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_2_\", this.blobPulse2);\r\n this._activeEffect.setFloat(\"_Blob_Fade_2_\", this.blobFade2);\r\n\r\n // \"Gaze\"\r\n this._activeEffect.setFloat(\"_Gaze_Intensity_\", this.gazeIntensity);\r\n this._activeEffect.setFloat(\"_Gaze_Focus_\", this.gazeFocus);\r\n\r\n // \"Blob Texture\"\r\n this._activeEffect.setTexture(\"_Blob_Texture_\", this._blobTexture);\r\n\r\n // \"Selection\"\r\n this._activeEffect.setFloat(\"_Selection_Fuzz_\", this.selectionFuzz);\r\n this._activeEffect.setFloat(\"_Selected_\", this.selected);\r\n this._activeEffect.setFloat(\"_Selection_Fade_\", this.selectionFade);\r\n this._activeEffect.setFloat(\"_Selection_Fade_Size_\", this.selectionFadeSize);\r\n this._activeEffect.setFloat(\"_Selected_Distance_\", this.selectedDistance);\r\n this._activeEffect.setFloat(\"_Selected_Fade_Length_\", this.selectedFadeLength);\r\n\r\n // \"Proximity\"\r\n this._activeEffect.setFloat(\"_Proximity_Max_Intensity_\", this.proximityMaxIntensity);\r\n this._activeEffect.setFloat(\"_Proximity_Far_Distance_\", this.proximityFarDistance);\r\n this._activeEffect.setFloat(\"_Proximity_Near_Radius_\", this.proximityNearRadius);\r\n this._activeEffect.setFloat(\"_Proximity_Anisotropy_\", this.proximityAnisotropy);\r\n\r\n // \"Global\"\r\n this._activeEffect.setFloat(\"_Use_Global_Left_Index_\", this.useGlobalLeftIndex ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Use_Global_Right_Index_\", this.useGlobalRightIndex ? 1.0 : 0.0);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLFrontplateMaterial {\r\n return SerializationHelper.Clone(() => new MRDLFrontplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLFrontplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLFrontplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLFrontplateMaterial {\r\n return SerializationHelper.Parse(() => new MRDLFrontplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLFrontplateMaterial\", MRDLFrontplateMaterial);\r\n"]}
1
+ {"version":3,"file":"mrdlFrontplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlFrontplateMaterial.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AACtE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,YAAY,EAAE,0CAA4B;AACnD,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAE1D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,iCAAiC,CAAC;AAEzC,cAAc;AACd,MAAM,6BAA8B,SAAQ,eAAe;IAMvD;QACI,KAAK,EAAE,CAAC;QANZ;;WAEG;QACI,iBAAY,GAAG,IAAI,CAAC;QAIvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAwOpD,YAAY,IAAY,EAAE,KAAY;QAClC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAxOvB;;WAEG;QAEI,WAAM,GAAG,IAAI,CAAC;QAErB;;WAEG;QAEI,cAAS,GAAG,IAAI,CAA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C,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\nimport \"./shaders/mrdlFrontplate.fragment\";\r\nimport \"./shaders/mrdlFrontplate.vertex\";\r\n\r\n/** @hidden */\r\nclass MRDLFrontplateMaterialDefines extends MaterialDefines {\r\n /**\r\n * Sets default value for \"SMOOTH_EDGES\"\r\n */\r\n public SMOOTH_EDGES = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLFrontplateMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the corner radius on the frontplate. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.12;\r\n\r\n /**\r\n * Gets or sets the line width of the frontplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.01;\r\n\r\n /**\r\n * Gets or sets whether the scale is relative to the frontplate height.\r\n */\r\n @serialize()\r\n public relativeToHeight = false;\r\n\r\n /** @hidden */\r\n public _filterWidth = 1.0;\r\n\r\n /**\r\n * Gets or sets the edge color of the frontplate.\r\n */\r\n @serialize()\r\n public edgeColor: Color4 = new Color4(0.53, 0.53, 0.53, 1);\r\n\r\n /**\r\n * Gets or sets whether to enable blob effects on the frontplate.\r\n */\r\n @serialize()\r\n public blobEnable = true;\r\n\r\n /**\r\n * Gets or sets the blob position on the frontplate.\r\n */\r\n @serialize()\r\n public blobPosition: Vector3 = new Vector3(100, 100, 100);\r\n\r\n /**\r\n * Gets or sets the blob intensity of the frontplate.\r\n */\r\n @serialize()\r\n public blobIntensity = 0.5;\r\n\r\n /**\r\n * Gets or sets the blob near size of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearSize = 0.032;\r\n\r\n /**\r\n * Gets or sets the blob far size of the frontplate.\r\n */\r\n @serialize()\r\n public blobFarSize = 0.048;\r\n\r\n /**\r\n * Gets or sets the blob near distance of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearDistance = 0.008;\r\n\r\n /**\r\n * Gets or sets the blob far distance of the frontplate.\r\n */\r\n @serialize()\r\n public blobFarDistance = 0.064;\r\n\r\n /**\r\n * Gets or sets the blob fade length of the frontplate.\r\n */\r\n @serialize()\r\n public blobFadeLength = 0.04;\r\n\r\n /**\r\n * Gets or sets the blob inner fade of the frontplate.\r\n */\r\n @serialize()\r\n public blobInnerFade = 0.01;\r\n\r\n /**\r\n * Gets or sets the blob pulse of the frontplate.\r\n */\r\n @serialize()\r\n public blobPulse = 0.0;\r\n\r\n /**\r\n * Gets or sets the blob fade effect on the frontplate.\r\n */\r\n @serialize()\r\n public blobFade = 1.0;\r\n\r\n /**\r\n * Gets or sets the maximum size of the blob pulse on the frontplate.\r\n */\r\n @serialize()\r\n public blobPulseMaxSize = 0.05;\r\n\r\n /**\r\n * Gets or sets whether to enable extra blob effects of the frontplate.\r\n */\r\n @serialize()\r\n public blobEnable2 = true;\r\n\r\n /**\r\n * Gets or sets blob2 position of the frontplate.\r\n */\r\n @serialize()\r\n public blobPosition2: Vector3 = new Vector3(10, 10.1, -0.6);\r\n\r\n /**\r\n * Gets or sets the blob2 near size of the frontplate.\r\n */\r\n @serialize()\r\n public blobNearSize2 = 0.008;\r\n\r\n /**\r\n * Gets or sets the blob2 inner fade of the frontplate.\r\n */\r\n @serialize()\r\n public blobInnerFade2 = 0.1;\r\n\r\n /**\r\n * Gets or sets the blob2 pulse of the frontplate.\r\n */\r\n @serialize()\r\n public blobPulse2 = 0.0;\r\n\r\n /**\r\n * Gets or sets the blob2 fade effect on the frontplate.\r\n */\r\n @serialize()\r\n public blobFade2 = 1.0;\r\n\r\n /**\r\n * Gets or sets the gaze intensity of the frontplate.\r\n */\r\n @serialize()\r\n public gazeIntensity = 0.8;\r\n\r\n /**\r\n * Gets or sets the gaze focus of the frontplate.\r\n */\r\n @serialize()\r\n public gazeFocus = 0.0;\r\n\r\n /**\r\n * Gets or sets the selection fuzz of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFuzz = 0.5;\r\n\r\n /**\r\n * Gets or sets the fade intensity of the frontplate.\r\n */\r\n @serialize()\r\n public selected = 1.0;\r\n\r\n /**\r\n * Gets or sets the selection fade intensity of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFade = 0.2;\r\n\r\n /**\r\n * Gets or sets the selection fade size of the frontplate.\r\n */\r\n @serialize()\r\n public selectionFadeSize = 0.0;\r\n\r\n /**\r\n * Gets or sets the selected distance of the frontplate.\r\n */\r\n @serialize()\r\n public selectedDistance = 0.08;\r\n\r\n /**\r\n * Gets or sets the selected fade length of the frontplate.\r\n */\r\n @serialize()\r\n public selectedFadeLength = 0.08;\r\n\r\n /**\r\n * Gets or sets the proximity maximum intensity of the frontplate.\r\n */\r\n @serialize()\r\n public proximityMaxIntensity = 0.45;\r\n\r\n /**\r\n * Gets or sets the proximity far distance of the frontplate.\r\n */\r\n @serialize()\r\n public proximityFarDistance = 0.16;\r\n\r\n /**\r\n * Gets or sets the proximity near radius of the frontplate.\r\n */\r\n @serialize()\r\n public proximityNearRadius = 0.016;\r\n\r\n /**\r\n * Gets or sets the proximity anisotropy of the frontplate.\r\n */\r\n @serialize()\r\n public proximityAnisotropy = 1.0;\r\n\r\n /**\r\n * Gets or sets whether to use global left index on the frontplate.\r\n */\r\n @serialize()\r\n public useGlobalLeftIndex = true;\r\n\r\n /**\r\n * Gets or sets whether to use global right index of the frontplate.\r\n */\r\n @serialize()\r\n public useGlobalRightIndex = true;\r\n\r\n /**\r\n * URL pointing to the texture used to define the coloring for the BLOB.\r\n */\r\n public static BLOB_TEXTURE_URL = \"\";\r\n\r\n /**\r\n * Gets or sets the opacity of the frontplate (0.0 - 1.0).\r\n */\r\n public fadeOut = 1.0;\r\n\r\n private _blobTexture: Texture;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_ADD;\r\n this.disableDepthWrite = true;\r\n this.backFaceCulling = false;\r\n this._blobTexture = new Texture(MRDLFrontplateMaterial.BLOB_TEXTURE_URL, scene, true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLFrontplateMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLFrontplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlFrontplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Relative_To_Height_\",\r\n \"_Filter_Width_\",\r\n \"_Edge_Color_\",\r\n \"_Fade_Out_\",\r\n \"_Smooth_Edges_\",\r\n \"_Blob_Enable_\",\r\n \"_Blob_Position_\",\r\n \"_Blob_Intensity_\",\r\n \"_Blob_Near_Size_\",\r\n \"_Blob_Far_Size_\",\r\n \"_Blob_Near_Distance_\",\r\n \"_Blob_Far_Distance_\",\r\n \"_Blob_Fade_Length_\",\r\n \"_Blob_Inner_Fade_\",\r\n \"_Blob_Pulse_\",\r\n \"_Blob_Fade_\",\r\n \"_Blob_Pulse_Max_Size_\",\r\n \"_Blob_Enable_2_\",\r\n \"_Blob_Position_2_\",\r\n \"_Blob_Near_Size_2_\",\r\n \"_Blob_Inner_Fade_2_\",\r\n \"_Blob_Pulse_2_\",\r\n \"_Blob_Fade_2_\",\r\n \"_Gaze_Intensity_\",\r\n \"_Gaze_Focus_\",\r\n \"_Blob_Texture_\",\r\n \"_Selection_Fuzz_\",\r\n \"_Selected_\",\r\n \"_Selection_Fade_\",\r\n \"_Selection_Fade_Size_\",\r\n \"_Selected_Distance_\",\r\n \"_Selected_Fade_Length_\",\r\n \"_Proximity_Max_Intensity_\",\r\n \"_Proximity_Far_Distance_\",\r\n \"_Proximity_Near_Radius_\",\r\n \"_Proximity_Anisotropy_\",\r\n \"Global_Left_Index_Tip_Position\",\r\n \"Global_Right_Index_Tip_Position\",\r\n \"_Use_Global_Left_Index_\",\r\n \"_Use_Global_Right_Index_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLFrontplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Relative_To_Height_\", this.relativeToHeight ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Edge_Color_\", this.edgeColor);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Blob\"\r\n this._activeEffect.setFloat(\"_Blob_Enable_\", this.blobEnable ? 1.0 : 0.0);\r\n this._activeEffect.setVector3(\"_Blob_Position_\", this.blobPosition);\r\n this._activeEffect.setFloat(\"_Blob_Intensity_\", this.blobIntensity);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_\", this.blobNearSize);\r\n this._activeEffect.setFloat(\"_Blob_Far_Size_\", this.blobFarSize);\r\n this._activeEffect.setFloat(\"_Blob_Near_Distance_\", this.blobNearDistance);\r\n this._activeEffect.setFloat(\"_Blob_Far_Distance_\", this.blobFarDistance);\r\n this._activeEffect.setFloat(\"_Blob_Fade_Length_\", this.blobFadeLength);\r\n this._activeEffect.setFloat(\"_Blob_Inner_Fade_\", this.blobInnerFade);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_\", this.blobPulse);\r\n this._activeEffect.setFloat(\"_Blob_Fade_\", this.blobFade);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_Max_Size_\", this.blobPulseMaxSize);\r\n\r\n // \"Blob 2\"\r\n this._activeEffect.setFloat(\"_Blob_Enable_2_\", this.blobEnable2 ? 1.0 : 0.0);\r\n this._activeEffect.setVector3(\"_Blob_Position_2_\", this.blobPosition2);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_2_\", this.blobNearSize2);\r\n this._activeEffect.setFloat(\"_Blob_Inner_Fade_2_\", this.blobInnerFade2);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_2_\", this.blobPulse2);\r\n this._activeEffect.setFloat(\"_Blob_Fade_2_\", this.blobFade2);\r\n\r\n // \"Gaze\"\r\n this._activeEffect.setFloat(\"_Gaze_Intensity_\", this.gazeIntensity);\r\n this._activeEffect.setFloat(\"_Gaze_Focus_\", this.gazeFocus);\r\n\r\n // \"Blob Texture\"\r\n this._activeEffect.setTexture(\"_Blob_Texture_\", this._blobTexture);\r\n\r\n // \"Selection\"\r\n this._activeEffect.setFloat(\"_Selection_Fuzz_\", this.selectionFuzz);\r\n this._activeEffect.setFloat(\"_Selected_\", this.selected);\r\n this._activeEffect.setFloat(\"_Selection_Fade_\", this.selectionFade);\r\n this._activeEffect.setFloat(\"_Selection_Fade_Size_\", this.selectionFadeSize);\r\n this._activeEffect.setFloat(\"_Selected_Distance_\", this.selectedDistance);\r\n this._activeEffect.setFloat(\"_Selected_Fade_Length_\", this.selectedFadeLength);\r\n\r\n // \"Proximity\"\r\n this._activeEffect.setFloat(\"_Proximity_Max_Intensity_\", this.proximityMaxIntensity);\r\n this._activeEffect.setFloat(\"_Proximity_Far_Distance_\", this.proximityFarDistance);\r\n this._activeEffect.setFloat(\"_Proximity_Near_Radius_\", this.proximityNearRadius);\r\n this._activeEffect.setFloat(\"_Proximity_Anisotropy_\", this.proximityAnisotropy);\r\n\r\n // \"Global\"\r\n this._activeEffect.setFloat(\"_Use_Global_Left_Index_\", this.useGlobalLeftIndex ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Use_Global_Right_Index_\", this.useGlobalRightIndex ? 1.0 : 0.0);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLFrontplateMaterial {\r\n return SerializationHelper.Clone(() => new MRDLFrontplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLFrontplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLFrontplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLFrontplateMaterial {\r\n return SerializationHelper.Parse(() => new MRDLFrontplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLFrontplateMaterial\", MRDLFrontplateMaterial);\r\n"]}
@@ -61,8 +61,9 @@ export class MRDLInnerquadMaterial extends PushMaterial {
61
61
  }
62
62
  // Methods
63
63
  isReadyForSubMesh(mesh, subMesh) {
64
+ const drawWrapper = subMesh._drawWrapper;
64
65
  if (this.isFrozen) {
65
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
66
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
66
67
  return true;
67
68
  }
68
69
  }
@@ -150,7 +151,7 @@ export class MRDLInnerquadMaterial extends PushMaterial {
150
151
  return false;
151
152
  }
152
153
  defines._renderId = scene.getRenderId();
153
- subMesh.effect._wasPreviouslyReady = true;
154
+ drawWrapper._wasPreviouslyReady = true;
154
155
  return true;
155
156
  }
156
157
  bindForSubMesh(world, mesh, subMesh) {
@@ -178,7 +179,7 @@ export class MRDLInnerquadMaterial extends PushMaterial {
178
179
  this._activeEffect.setFloat("_Glow_Fraction_", this.glowFraction);
179
180
  this._activeEffect.setFloat("_Glow_Max_", this.glowMax);
180
181
  this._activeEffect.setFloat("_Glow_Falloff_", this.glowFalloff);
181
- this._afterBind(mesh, this._activeEffect);
182
+ this._afterBind(mesh, this._activeEffect, subMesh);
182
183
  }
183
184
  /**
184
185
  * Get the list of animatables in the material.
@@ -1 +1 @@
1
- {"version":3,"file":"mrdlInnerquadMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlInnerquadMaterial.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AACtE,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAEnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AAExC,MAAM,4BAA6B,SAAQ,eAAe;IACtD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ;AAED,MAAM,OAAO,qBAAsB,SAAQ,Y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/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\n\r\nimport \"./shaders/mrdlInnerquad.fragment\";\r\nimport \"./shaders/mrdlInnerquad.vertex\";\r\n\r\nclass MRDLInnerquadMaterialDefines extends MaterialDefines {\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLInnerquadMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the color of the innerquad.\r\n */\r\n @serialize()\r\n public color: Color4 = new Color4(1, 1, 1, 0.05);\r\n /**\r\n * Gets or sets the corner radius on the innerquad. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.12;\r\n\r\n /**\r\n * Gets or sets whether the radius of the innerquad should be fixed.\r\n */\r\n @serialize()\r\n public fixedRadius = true;\r\n\r\n /** @hidden */\r\n public _filterWidth = 1.0;\r\n\r\n /**\r\n * Gets or sets the glow fraction of the innerquad.\r\n */\r\n @serialize()\r\n public glowFraction = 0.0;\r\n\r\n /**\r\n * Gets or sets the maximum glow intensity of the innerquad.\r\n */\r\n @serialize()\r\n public glowMax = 0.5;\r\n\r\n /**\r\n * Gets or sets the glow falloff effect of the innerquad.\r\n */\r\n @serialize()\r\n public glowFalloff = 2.0;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_COMBINE;\r\n this.backFaceCulling = false;\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLInnerquadMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLInnerquadMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlInnerquad\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Color_\",\r\n \"_Radius_\",\r\n \"_Fixed_Radius_\",\r\n \"_Filter_Width_\",\r\n \"_Glow_Fraction_\",\r\n \"_Glow_Max_\",\r\n \"_Glow_Falloff_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLInnerquadMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Color\"\r\n this._activeEffect.setDirectColor4(\"_Color_\", this.color);\r\n\r\n // \"Shape\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Fixed_Radius_\", this.fixedRadius ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n\r\n // \"Glow\"\r\n this._activeEffect.setFloat(\"_Glow_Fraction_\", this.glowFraction);\r\n this._activeEffect.setFloat(\"_Glow_Max_\", this.glowMax);\r\n this._activeEffect.setFloat(\"_Glow_Falloff_\", this.glowFalloff);\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLInnerquadMaterial {\r\n return SerializationHelper.Clone(() => new MRDLInnerquadMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLInnerquadMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLInnerquadMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLInnerquadMaterial {\r\n return SerializationHelper.Parse(() => new MRDLInnerquadMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLInnerquadMaterial\", MRDLInnerquadMaterial);\r\n"]}
1
+ {"version":3,"file":"mrdlInnerquadMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/mrdl/mrdlInnerquadMaterial.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,2CAA6B;AACtE,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAEnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AAExC,MAAM,4BAA6B,SAAQ,eAAe;IACtD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ;AAED,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IAuCnD,YAAY,IAAY,EAAE,KAAY;QAClC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAvCvB;;WAEG;QAEI,UAAK,GAAW,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD;;WAEG;QAEI,WAAM,GAAG,IAAI,CAAC;QAErB;;WAEG;QAEI,gBAAW,GAAG,IAAI,CAAC;QAE1B,cAAc;QACP,iBAAY,GAAG,GAAG,CAAC;QAE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BAAkB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,IAAY;QACrB,OAAO,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACnG,CAAC;IAEM,SAAS;QACZ,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAChE,mBAAmB,CAAC,UAAU,GAAG,+BAA+B,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;IAED,UAAU;IACH,MAAM,CAAC,KAAK,CAAC,MAAW,EAAE,KAAY,EAAE,OAAe;QAC1D,OAAO,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAClH,CAAC;CACJ;AArPU;IADN,SAAS,EAAE;oDACqC;AAK1C;IADN,SAAS,EAAE;qDACS;AAMd;IADN,SAAS,EAAE;0DACc;AASnB;IADN,SAAS,EAAE;2DACc;AAMnB;IADN,SAAS,EAAE;sDACS;AAMd;IADN,SAAS,EAAE;0DACa;AAuN7B,aAAa,CAAC,mCAAmC,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"core/Misc/decorators\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\n\r\nimport \"./shaders/mrdlInnerquad.fragment\";\r\nimport \"./shaders/mrdlInnerquad.vertex\";\r\n\r\nclass MRDLInnerquadMaterialDefines extends MaterialDefines {\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this._needUVs = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class MRDLInnerquadMaterial extends PushMaterial {\r\n /**\r\n * Gets or sets the color of the innerquad.\r\n */\r\n @serialize()\r\n public color: Color4 = new Color4(1, 1, 1, 0.05);\r\n /**\r\n * Gets or sets the corner radius on the innerquad. If this value is changed, update the lineWidth to match.\r\n */\r\n @serialize()\r\n public radius = 0.12;\r\n\r\n /**\r\n * Gets or sets whether the radius of the innerquad should be fixed.\r\n */\r\n @serialize()\r\n public fixedRadius = true;\r\n\r\n /** @hidden */\r\n public _filterWidth = 1.0;\r\n\r\n /**\r\n * Gets or sets the glow fraction of the innerquad.\r\n */\r\n @serialize()\r\n public glowFraction = 0.0;\r\n\r\n /**\r\n * Gets or sets the maximum glow intensity of the innerquad.\r\n */\r\n @serialize()\r\n public glowMax = 0.5;\r\n\r\n /**\r\n * Gets or sets the glow falloff effect of the innerquad.\r\n */\r\n @serialize()\r\n public glowFalloff = 2.0;\r\n\r\n constructor(name: string, scene: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_COMBINE;\r\n this.backFaceCulling = false;\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return true;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new MRDLInnerquadMaterialDefines();\r\n }\r\n\r\n const defines = <MRDLInnerquadMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"mrdlInnerquad\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"worldView\",\r\n \"worldViewProjection\",\r\n \"view\",\r\n \"projection\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Color_\",\r\n \"_Radius_\",\r\n \"_Fixed_Radius_\",\r\n \"_Filter_Width_\",\r\n \"_Glow_Fraction_\",\r\n \"_Glow_Max_\",\r\n \"_Glow_Falloff_\",\r\n ];\r\n const samplers: string[] = [];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <MRDLInnerquadMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", scene.activeCamera!.position);\r\n\r\n // \"Color\"\r\n this._activeEffect.setDirectColor4(\"_Color_\", this.color);\r\n\r\n // \"Shape\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Fixed_Radius_\", this.fixedRadius ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n\r\n // \"Glow\"\r\n this._activeEffect.setFloat(\"_Glow_Fraction_\", this.glowFraction);\r\n this._activeEffect.setFloat(\"_Glow_Max_\", this.glowMax);\r\n this._activeEffect.setFloat(\"_Glow_Falloff_\", this.glowFalloff);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public clone(name: string): MRDLInnerquadMaterial {\r\n return SerializationHelper.Clone(() => new MRDLInnerquadMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): unknown {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.MRDLInnerquadMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"MRDLInnerquadMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): MRDLInnerquadMaterial {\r\n return SerializationHelper.Parse(() => new MRDLInnerquadMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.MRDLInnerquadMaterial\", MRDLInnerquadMaterial);\r\n"]}
@@ -345,8 +345,9 @@ export class MRDLSliderBarMaterial extends PushMaterial {
345
345
  }
346
346
  // Methods
347
347
  isReadyForSubMesh(mesh, subMesh) {
348
+ const drawWrapper = subMesh._drawWrapper;
348
349
  if (this.isFrozen) {
349
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
350
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
350
351
  return true;
351
352
  }
352
353
  }
@@ -501,7 +502,7 @@ export class MRDLSliderBarMaterial extends PushMaterial {
501
502
  return false;
502
503
  }
503
504
  defines._renderId = scene.getRenderId();
504
- subMesh.effect._wasPreviouslyReady = true;
505
+ drawWrapper._wasPreviouslyReady = true;
505
506
  return true;
506
507
  }
507
508
  bindForSubMesh(world, mesh, subMesh) {
@@ -622,7 +623,7 @@ export class MRDLSliderBarMaterial extends PushMaterial {
622
623
  this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition);
623
624
  this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity);
624
625
  this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity);
625
- this._afterBind(mesh, this._activeEffect);
626
+ this._afterBind(mesh, this._activeEffect, subMesh);
626
627
  }
627
628
  /**
628
629
  * Get the list of animatables in the material.