@babylonjs/core 5.41.0 → 5.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/Actions/action.d.ts +2 -1
  2. package/Actions/action.js +3 -1
  3. package/Actions/action.js.map +1 -1
  4. package/Actions/actionManager.js +5 -7
  5. package/Actions/actionManager.js.map +1 -1
  6. package/Actions/directActions.js +2 -0
  7. package/Actions/directActions.js.map +1 -1
  8. package/Audio/sound.js +5 -5
  9. package/Audio/sound.js.map +1 -1
  10. package/Behaviors/Meshes/fadeInOutBehavior.d.ts +27 -4
  11. package/Behaviors/Meshes/fadeInOutBehavior.js +74 -9
  12. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  13. package/Behaviors/Meshes/pointerDragBehavior.d.ts +8 -1
  14. package/Behaviors/Meshes/pointerDragBehavior.js +8 -2
  15. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  16. package/Engines/WebGL/webGL2ShaderProcessors.js +1 -1
  17. package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
  18. package/Engines/engine.js +25 -26
  19. package/Engines/engine.js.map +1 -1
  20. package/Engines/thinEngine.d.ts +5 -1
  21. package/Engines/thinEngine.js +19 -15
  22. package/Engines/thinEngine.js.map +1 -1
  23. package/Gizmos/axisScaleGizmo.d.ts +2 -1
  24. package/Gizmos/axisScaleGizmo.js +9 -7
  25. package/Gizmos/axisScaleGizmo.js.map +1 -1
  26. package/Gizmos/boundingBoxGizmo.d.ts +3 -0
  27. package/Gizmos/boundingBoxGizmo.js +28 -25
  28. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  29. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +2 -1
  30. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +2 -1
  31. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  32. package/Materials/Node/Blocks/Input/animatedInputBlockTypes.d.ts +4 -2
  33. package/Materials/Node/Blocks/Input/animatedInputBlockTypes.js +3 -1
  34. package/Materials/Node/Blocks/Input/animatedInputBlockTypes.js.map +1 -1
  35. package/Materials/Node/Blocks/Input/inputBlock.js +7 -0
  36. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  37. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  38. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  39. package/Materials/material.d.ts +2 -0
  40. package/Materials/material.js +4 -0
  41. package/Materials/material.js.map +1 -1
  42. package/Misc/tools.js +1 -1
  43. package/Misc/tools.js.map +1 -1
  44. package/package.json +1 -1
@@ -4,6 +4,8 @@
4
4
  export declare enum AnimatedInputBlockTypes {
5
5
  /** No animation */
6
6
  None = 0,
7
- /** Time based animation. Will only work for floats */
8
- Time = 1
7
+ /** Time based animation (is incremented by 0.6 each second). Will only work for floats */
8
+ Time = 1,
9
+ /** Time elapsed (in seconds) since the engine was initialized. Will only work for floats */
10
+ RealTime = 2
9
11
  }
@@ -5,7 +5,9 @@ export var AnimatedInputBlockTypes;
5
5
  (function (AnimatedInputBlockTypes) {
6
6
  /** No animation */
7
7
  AnimatedInputBlockTypes[AnimatedInputBlockTypes["None"] = 0] = "None";
8
- /** Time based animation. Will only work for floats */
8
+ /** Time based animation (is incremented by 0.6 each second). Will only work for floats */
9
9
  AnimatedInputBlockTypes[AnimatedInputBlockTypes["Time"] = 1] = "Time";
10
+ /** Time elapsed (in seconds) since the engine was initialized. Will only work for floats */
11
+ AnimatedInputBlockTypes[AnimatedInputBlockTypes["RealTime"] = 2] = "RealTime";
10
12
  })(AnimatedInputBlockTypes || (AnimatedInputBlockTypes = {}));
11
13
  //# sourceMappingURL=animatedInputBlockTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"animatedInputBlockTypes.js","sourceRoot":"","sources":["../../../../../../../lts/core/generated/Materials/Node/Blocks/Input/animatedInputBlockTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,uBAKX;AALD,WAAY,uBAAuB;IAC/B,mBAAmB;IACnB,qEAAI,CAAA;IACJ,sDAAsD;IACtD,qEAAI,CAAA;AACR,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC","sourcesContent":["/**\r\n * Enum defining the type of animations supported by InputBlock\r\n */\r\nexport enum AnimatedInputBlockTypes {\r\n /** No animation */\r\n None,\r\n /** Time based animation. Will only work for floats */\r\n Time,\r\n}\r\n"]}
1
+ {"version":3,"file":"animatedInputBlockTypes.js","sourceRoot":"","sources":["../../../../../../../lts/core/generated/Materials/Node/Blocks/Input/animatedInputBlockTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IAC/B,mBAAmB;IACnB,qEAAI,CAAA;IACJ,0FAA0F;IAC1F,qEAAI,CAAA;IACJ,4FAA4F;IAC5F,6EAAQ,CAAA;AACZ,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,QAOlC","sourcesContent":["/**\r\n * Enum defining the type of animations supported by InputBlock\r\n */\r\nexport enum AnimatedInputBlockTypes {\r\n /** No animation */\r\n None,\r\n /** Time based animation (is incremented by 0.6 each second). Will only work for floats */\r\n Time,\r\n /** Time elapsed (in seconds) since the engine was initialized. Will only work for floats */\r\n RealTime,\r\n}\r\n"]}
@@ -9,6 +9,7 @@ import { GetClass, RegisterClass } from "../../../../Misc/typeStore.js";
9
9
  import { Color3, Color4, TmpColors } from "../../../../Maths/math.js";
10
10
  import { AnimatedInputBlockTypes } from "./animatedInputBlockTypes.js";
11
11
  import { Observable } from "../../../../Misc/observable.js";
12
+ import { PrecisionDate } from "../../../../Misc/precisionDate.js";
12
13
  const remapAttributeName = {
13
14
  position2d: "position",
14
15
  particle_uv: "vUV",
@@ -319,6 +320,12 @@ export class InputBlock extends NodeMaterialBlock {
319
320
  }
320
321
  break;
321
322
  }
323
+ case AnimatedInputBlockTypes.RealTime: {
324
+ if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {
325
+ this.value = (PrecisionDate.Now - scene.getEngine().startTime) / 1000;
326
+ }
327
+ break;
328
+ }
322
329
  }
323
330
  }
324
331
  _emitDefine(define) {
@@ -1 +1 @@
1
- {"version":3,"file":"inputBlock.js","sourceRoot":"","sources":["../../../../../../../lts/core/generated/Materials/Node/Blocks/Input/inputBlock.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGhF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,MAAM,kBAAkB,GAA+B;IACnD,UAAU,EAAE,UAAU;IACtB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,QAAQ;IACxB,oBAAoB,EAAE,aAAa;IACnC,kBAAkB,EAAE,YAAY;CACnC,CAAC;AAEF,MAAM,uBAAuB,GAAgC;IACzD,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,IAAI;IACpB,oBAAoB,EAAE,IAAI;IAC1B,kBAAkB,EAAE,IAAI;CAC3B,CAAC;AAEF,MAAM,kBAAkB,GAAgC;IACpD,oBAAoB,EAAE,IAAI;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mBAAmB,CAAC,SAAS,EAAE;YAChC,OAAO;SACV;QAED,IAAI,mBAAmB,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC5C,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC;SACjD;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport { NodeMaterialBlockConnectionPointMode } from \"../../Enums/nodeMaterialBlockConnectionPointMode\";\r\nimport { NodeMaterialSystemValues } from \"../../Enums/nodeMaterialSystemValues\";\r\nimport type { Nullable } from \"../../../../types\";\r\nimport type { Effect } from \"../../../../Materials/effect\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../../Maths/math.vector\";\r\nimport type { Scene } from \"../../../../scene\";\r\nimport type { NodeMaterialConnectionPoint } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport type { NodeMaterialBuildState } from \"../../nodeMaterialBuildState\";\r\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets\";\r\nimport { GetClass, RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { Color3, Color4, TmpColors } from \"../../../../Maths/math\";\r\nimport { AnimatedInputBlockTypes } from \"./animatedInputBlockTypes\";\r\nimport { Observable } from \"../../../../Misc/observable\";\r\nimport type { NodeMaterial } from \"../../nodeMaterial\";\r\n\r\nconst remapAttributeName: { [name: string]: string } = {\r\n position2d: \"position\",\r\n particle_uv: \"vUV\",\r\n particle_color: \"vColor\",\r\n particle_texturemask: \"textureMask\",\r\n particle_positionw: \"vPositionW\",\r\n};\r\n\r\nconst attributeInFragmentOnly: { [name: string]: boolean } = {\r\n particle_uv: true,\r\n particle_color: true,\r\n particle_texturemask: true,\r\n particle_positionw: true,\r\n};\r\n\r\nconst attributeAsUniform: { [name: string]: boolean } = {\r\n particle_texturemask: true,\r\n};\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class InputBlock extends NodeMaterialBlock {\r\n private _mode = NodeMaterialBlockConnectionPointMode.Undefined;\r\n private _associatedVariableName: string;\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeMaterialBlockConnectionPointTypes;\r\n private _animationType = AnimatedInputBlockTypes.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or set a value indicating that this input can only get 0 and 1 values */\r\n public isBoolean: boolean = false;\r\n\r\n /** Gets or sets a value used by the Node Material editor to determine how to configure the current value if it is a matrix */\r\n public matrixMode: number = 0;\r\n\r\n /** @internal */\r\n public _systemValue: Nullable<NodeMaterialSystemValues> = null;\r\n\r\n /** Gets or sets a boolean indicating that the value of this input will not change after a build */\r\n public isConstant = false;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<InputBlock>();\r\n\r\n /** Gets or sets a boolean indicating if content needs to be converted to gamma space (for color3/4 only) */\r\n public convertToGammaSpace = false;\r\n\r\n /** Gets or sets a boolean indicating if content needs to be converted to linear space (for color3/4 only) */\r\n public convertToLinearSpace = false;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeMaterialBlockConnectionPointTypes {\r\n if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {\r\n if (this.isUniform && this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeMaterialBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Color3\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color3;\r\n return this._type;\r\n case \"Color4\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n\r\n if (this.isAttribute) {\r\n switch (this.name) {\r\n case \"position\":\r\n case \"normal\":\r\n case \"particle_positionw\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"uv\":\r\n case \"uv2\":\r\n case \"uv3\":\r\n case \"uv4\":\r\n case \"uv5\":\r\n case \"uv6\":\r\n case \"position2d\":\r\n case \"particle_uv\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"matricesIndices\":\r\n case \"matricesWeights\":\r\n case \"world0\":\r\n case \"world1\":\r\n case \"world2\":\r\n case \"world3\":\r\n case \"tangent\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"color\":\r\n case \"instanceColor\":\r\n case \"particle_color\":\r\n case \"particle_texturemask\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color4;\r\n return this._type;\r\n }\r\n }\r\n\r\n if (this.isSystemValue) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n case NodeMaterialSystemValues.WorldView:\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n case NodeMaterialSystemValues.View:\r\n case NodeMaterialSystemValues.ViewProjection:\r\n case NodeMaterialSystemValues.Projection:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n case NodeMaterialSystemValues.CameraPosition:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case NodeMaterialSystemValues.FogColor:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color3;\r\n return this._type;\r\n case NodeMaterialSystemValues.DeltaTime:\r\n case NodeMaterialSystemValues.MaterialAlpha:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Float;\r\n return this._type;\r\n case NodeMaterialSystemValues.CameraParameters:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param target defines the target of that block (Vertex by default)\r\n * @param type defines the type of the input (can be set to NodeMaterialBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, target = NodeMaterialBlockTargets.Vertex, type: NodeMaterialBlockConnectionPointTypes = NodeMaterialBlockConnectionPointTypes.AutoDetect) {\r\n super(name, target, false, true);\r\n\r\n this._type = type;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Validates if a name is a reserve word.\r\n * @param newName the new name to be given to the node.\r\n * @returns false if the name is a reserve word, else true.\r\n */\r\n public validateBlockName(newName: string) {\r\n if (!this.isAttribute) {\r\n return super.validateBlockName(newName);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the source of this connection point to a vertex attribute\r\n * @param attributeName defines the attribute name (position, uv, normal, etc...). If not specified it will take the connection point name\r\n * @returns the current connection point\r\n */\r\n public setAsAttribute(attributeName?: string): InputBlock {\r\n this._mode = NodeMaterialBlockConnectionPointMode.Attribute;\r\n if (attributeName) {\r\n this.name = attributeName;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the source of this connection point to a system value\r\n * @param value define the system value to use (world, view, etc...) or null to switch to manual value\r\n * @returns the current connection point\r\n */\r\n public setAsSystemValue(value: Nullable<NodeMaterialSystemValues>): InputBlock {\r\n this.systemValue = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n if (this.isBoolean) {\r\n value = value ? 1 : 0;\r\n } else if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n }\r\n\r\n /**\r\n * Gets or sets the associated variable name in the shader\r\n */\r\n public get associatedVariableName(): string {\r\n return this._associatedVariableName;\r\n }\r\n\r\n public set associatedVariableName(value: string) {\r\n this._associatedVariableName = value;\r\n }\r\n\r\n /** Gets or sets the type of animation applied to the input */\r\n public get animationType() {\r\n return this._animationType;\r\n }\r\n\r\n public set animationType(value: AnimatedInputBlockTypes) {\r\n this._animationType = value;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that this connection point not defined yet\r\n */\r\n public get isUndefined(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is coming from an uniform.\r\n * In this case the connection point name must be the name of the uniform to use.\r\n * Can only be set on inputs\r\n */\r\n public get isUniform(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Uniform;\r\n }\r\n\r\n public set isUniform(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Uniform : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is coming from an attribute.\r\n * In this case the connection point name must be the name of the attribute to use\r\n * Can only be set on inputs\r\n */\r\n public get isAttribute(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Attribute;\r\n }\r\n\r\n public set isAttribute(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Attribute : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is generating a varying variable.\r\n * Can only be set on exit points\r\n */\r\n public get isVarying(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Varying;\r\n }\r\n\r\n public set isVarying(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Varying : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a system value\r\n */\r\n public get isSystemValue(): boolean {\r\n return this._systemValue != null;\r\n }\r\n\r\n /**\r\n * Gets or sets the current well known value or null if not defined as a system value\r\n */\r\n public get systemValue(): Nullable<NodeMaterialSystemValues> {\r\n return this._systemValue;\r\n }\r\n\r\n public set systemValue(value: Nullable<NodeMaterialSystemValues>) {\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n this.associatedVariableName = \"\";\r\n this._systemValue = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"InputBlock\";\r\n }\r\n\r\n /**\r\n * Animate the input if animationType !== None\r\n * @param scene defines the rendering scene\r\n */\r\n public animate(scene: Scene) {\r\n switch (this._animationType) {\r\n case AnimatedInputBlockTypes.Time: {\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n this.value += scene.getAnimationRatio() * 0.01;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private _emitDefine(define: string): string {\r\n if (define[0] === \"!\") {\r\n return `#ifndef ${define.substring(1)}\\r\\n`;\r\n }\r\n\r\n return `#ifdef ${define}\\r\\n`;\r\n }\r\n\r\n public initialize() {\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n this.value = Color3.White();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n this.value = new Color4(1, 1, 1, 1);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n private _emitConstant(state: NodeMaterialBuildState) {\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n return `${state._emitFloat(this.value)}`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n return `vec2(${this.value.x}, ${this.value.y})`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n return `vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n return `vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n TmpColors.Color3[0].set(this.value.r, this.value.g, this.value.b);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color3[0].toGammaSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color3[0].toLinearSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n return `vec3(${TmpColors.Color3[0].r}, ${TmpColors.Color3[0].g}, ${TmpColors.Color3[0].b})`;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n TmpColors.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color4[0].toGammaSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color4[0].toLinearSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n return `vec4(${TmpColors.Color4[0].r}, ${TmpColors.Color4[0].g}, ${TmpColors.Color4[0].b}, ${TmpColors.Color4[0].a})`;\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n /** @internal */\r\n public get _noContextSwitch(): boolean {\r\n return attributeInFragmentOnly[this.name];\r\n }\r\n\r\n private _emit(state: NodeMaterialBuildState, define?: string) {\r\n // Uniforms\r\n if (this.isUniform) {\r\n if (!this.associatedVariableName) {\r\n this.associatedVariableName = state._getFreeVariableName(\"u_\" + this.name);\r\n }\r\n\r\n if (this.isConstant) {\r\n if (state.constants.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n state.constants.push(this.associatedVariableName);\r\n state._constantDeclaration += this._declareOutput(this.output, state) + ` = ${this._emitConstant(state)};\\r\\n`;\r\n return;\r\n }\r\n\r\n if (state.uniforms.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n\r\n state.uniforms.push(this.associatedVariableName);\r\n if (define) {\r\n state._uniformDeclaration += this._emitDefine(define);\r\n }\r\n state._uniformDeclaration += `uniform ${state._getGLType(this.type)} ${this.associatedVariableName};\\r\\n`;\r\n if (define) {\r\n state._uniformDeclaration += `#endif\\r\\n`;\r\n }\r\n\r\n // well known\r\n const hints = state.sharedData.hints;\r\n if (this._systemValue !== null && this._systemValue !== undefined) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.WorldView:\r\n hints.needWorldViewMatrix = true;\r\n break;\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n hints.needWorldViewProjectionMatrix = true;\r\n break;\r\n }\r\n } else {\r\n if (this._animationType !== AnimatedInputBlockTypes.None) {\r\n state.sharedData.animatedInputs.push(this);\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n // Attribute\r\n if (this.isAttribute) {\r\n this.associatedVariableName = remapAttributeName[this.name] ?? this.name;\r\n\r\n if (this.target === NodeMaterialBlockTargets.Vertex && state._vertexState) {\r\n // Attribute for fragment need to be carried over by varyings\r\n if (attributeInFragmentOnly[this.name]) {\r\n if (attributeAsUniform[this.name]) {\r\n state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n } else {\r\n state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n }\r\n } else {\r\n this._emit(state._vertexState, define);\r\n }\r\n return;\r\n }\r\n\r\n if (state.attributes.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n\r\n state.attributes.push(this.associatedVariableName);\r\n\r\n if (attributeInFragmentOnly[this.name]) {\r\n if (attributeAsUniform[this.name]) {\r\n state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n } else {\r\n state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n }\r\n } else {\r\n if (define) {\r\n state._attributeDeclaration += this._emitDefine(define);\r\n }\r\n state._attributeDeclaration += `attribute ${state._getGLType(this.type)} ${this.associatedVariableName};\\r\\n`;\r\n if (define) {\r\n state._attributeDeclaration += `#endif\\r\\n`;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _transmitWorld(effect: Effect, world: Matrix, worldView: Matrix, worldViewProjection: Matrix) {\r\n if (!this._systemValue) {\r\n return;\r\n }\r\n\r\n const variableName = this.associatedVariableName;\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n effect.setMatrix(variableName, world);\r\n break;\r\n case NodeMaterialSystemValues.WorldView:\r\n effect.setMatrix(variableName, worldView);\r\n break;\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n effect.setMatrix(variableName, worldViewProjection);\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _transmit(effect: Effect, scene: Scene, material: NodeMaterial) {\r\n if (this.isAttribute) {\r\n return;\r\n }\r\n\r\n const variableName = this.associatedVariableName;\r\n if (this._systemValue) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n case NodeMaterialSystemValues.WorldView:\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n return;\r\n case NodeMaterialSystemValues.View:\r\n effect.setMatrix(variableName, scene.getViewMatrix());\r\n break;\r\n case NodeMaterialSystemValues.Projection:\r\n effect.setMatrix(variableName, scene.getProjectionMatrix());\r\n break;\r\n case NodeMaterialSystemValues.ViewProjection:\r\n effect.setMatrix(variableName, scene.getTransformMatrix());\r\n break;\r\n case NodeMaterialSystemValues.CameraPosition:\r\n scene.bindEyePosition(effect, variableName, true);\r\n break;\r\n case NodeMaterialSystemValues.FogColor:\r\n effect.setColor3(variableName, scene.fogColor);\r\n break;\r\n case NodeMaterialSystemValues.DeltaTime:\r\n effect.setFloat(variableName, scene.deltaTime / 1000.0);\r\n break;\r\n case NodeMaterialSystemValues.CameraParameters:\r\n if (scene.activeCamera) {\r\n effect.setFloat4(\r\n variableName,\r\n scene.getEngine().hasOriginBottomLeft ? -1 : 1,\r\n scene.activeCamera.minZ,\r\n scene.activeCamera.maxZ,\r\n 1 / scene.activeCamera.maxZ\r\n );\r\n }\r\n break;\r\n case NodeMaterialSystemValues.MaterialAlpha:\r\n effect.setFloat(variableName, material.alpha);\r\n break;\r\n }\r\n return;\r\n }\r\n\r\n const value = this._valueCallback ? this._valueCallback() : this._storedValue;\r\n\r\n if (value === null) {\r\n return;\r\n }\r\n\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n effect.setFloat(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Int:\r\n effect.setInt(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n TmpColors.Color3[0].set(this.value.r, this.value.g, this.value.b);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color3[0].toGammaSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color3[0].toLinearSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n effect.setColor3(variableName, TmpColors.Color3[0]);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n TmpColors.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color4[0].toGammaSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color4[0].toLinearSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n effect.setDirectColor4(variableName, TmpColors.Color4[0]);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n effect.setVector2(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n effect.setVector3(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n effect.setVector4(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n effect.setMatrix(variableName, value);\r\n break;\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isUniform || this.isSystemValue) {\r\n state.sharedData.inputBlocks.push(this);\r\n }\r\n\r\n this._emit(state);\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isAttribute) {\r\n return super._dumpPropertiesCode() + `${variableName}.setAsAttribute(\"${this.name}\");\\r\\n`;\r\n }\r\n if (this.isSystemValue) {\r\n return super._dumpPropertiesCode() + `${variableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue!]});\\r\\n`;\r\n }\r\n if (this.isUniform) {\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n valueString = `new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`;\r\n if (this.convertToGammaSpace) {\r\n valueString += \".toGammaSpace()\";\r\n }\r\n if (this.convertToLinearSpace) {\r\n valueString += \".toLinearSpace()\";\r\n }\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;\r\n if (this.convertToGammaSpace) {\r\n valueString += \".toGammaSpace()\";\r\n }\r\n if (this.convertToLinearSpace) {\r\n valueString += \".toLinearSpace()\";\r\n }\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n valueString = `BABYLON.Matrix.FromArray([${(this.value as Matrix).m}])`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n codes.push(\r\n `${variableName}.min = ${this.min}`,\r\n `${variableName}.max = ${this.max}`,\r\n `${variableName}.isBoolean = ${this.isBoolean}`,\r\n `${variableName}.matrixMode = ${this.matrixMode}`,\r\n `${variableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]}`\r\n );\r\n }\r\n\r\n // Common Property \"Type\"\r\n codes.push(`${variableName}.isConstant = ${this.isConstant}`);\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\r\\n\");\r\n }\r\n return super._dumpPropertiesCode();\r\n }\r\n\r\n public dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.mode = this._mode;\r\n serializationObject.systemValue = this._systemValue;\r\n serializationObject.animationType = this._animationType;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.isBoolean = this.isBoolean;\r\n serializationObject.matrixMode = this.matrixMode;\r\n serializationObject.isConstant = this.isConstant;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n serializationObject.convertToGammaSpace = this.convertToGammaSpace;\r\n serializationObject.convertToLinearSpace = this.convertToLinearSpace;\r\n\r\n if (this._storedValue != null && this._mode === NodeMaterialBlockConnectionPointMode.Uniform) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n this._mode = serializationObject.mode;\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this._type = serializationObject.type;\r\n\r\n this._systemValue = serializationObject.systemValue || serializationObject.wellKnownValue;\r\n this._animationType = serializationObject.animationType;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.isBoolean = !!serializationObject.isBoolean;\r\n this.matrixMode = serializationObject.matrixMode || 0;\r\n this.isConstant = !!serializationObject.isConstant;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n this.convertToGammaSpace = !!serializationObject.convertToGammaSpace;\r\n this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;\r\n\r\n // Tangents back compat\r\n if (\r\n serializationObject.name === \"tangent\" &&\r\n serializationObject.mode === NodeMaterialBlockConnectionPointMode.Attribute &&\r\n serializationObject.type === NodeMaterialBlockConnectionPointTypes.Vector3\r\n ) {\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n }\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InputBlock\", InputBlock);\r\n"]}
1
+ {"version":3,"file":"inputBlock.js","sourceRoot":"","sources":["../../../../../../../lts/core/generated/Materials/Node/Blocks/Input/inputBlock.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AACxG,OAAO,EAAE,w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;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport { NodeMaterialBlockConnectionPointMode } from \"../../Enums/nodeMaterialBlockConnectionPointMode\";\r\nimport { NodeMaterialSystemValues } from \"../../Enums/nodeMaterialSystemValues\";\r\nimport type { Nullable } from \"../../../../types\";\r\nimport type { Effect } from \"../../../../Materials/effect\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../../Maths/math.vector\";\r\nimport type { Scene } from \"../../../../scene\";\r\nimport type { NodeMaterialConnectionPoint } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport type { NodeMaterialBuildState } from \"../../nodeMaterialBuildState\";\r\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets\";\r\nimport { GetClass, RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { Color3, Color4, TmpColors } from \"../../../../Maths/math\";\r\nimport { AnimatedInputBlockTypes } from \"./animatedInputBlockTypes\";\r\nimport { Observable } from \"../../../../Misc/observable\";\r\nimport type { NodeMaterial } from \"../../nodeMaterial\";\r\nimport { PrecisionDate } from \"core/Misc/precisionDate\";\r\n\r\nconst remapAttributeName: { [name: string]: string } = {\r\n position2d: \"position\",\r\n particle_uv: \"vUV\",\r\n particle_color: \"vColor\",\r\n particle_texturemask: \"textureMask\",\r\n particle_positionw: \"vPositionW\",\r\n};\r\n\r\nconst attributeInFragmentOnly: { [name: string]: boolean } = {\r\n particle_uv: true,\r\n particle_color: true,\r\n particle_texturemask: true,\r\n particle_positionw: true,\r\n};\r\n\r\nconst attributeAsUniform: { [name: string]: boolean } = {\r\n particle_texturemask: true,\r\n};\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class InputBlock extends NodeMaterialBlock {\r\n private _mode = NodeMaterialBlockConnectionPointMode.Undefined;\r\n private _associatedVariableName: string;\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeMaterialBlockConnectionPointTypes;\r\n private _animationType = AnimatedInputBlockTypes.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or set a value indicating that this input can only get 0 and 1 values */\r\n public isBoolean: boolean = false;\r\n\r\n /** Gets or sets a value used by the Node Material editor to determine how to configure the current value if it is a matrix */\r\n public matrixMode: number = 0;\r\n\r\n /** @internal */\r\n public _systemValue: Nullable<NodeMaterialSystemValues> = null;\r\n\r\n /** Gets or sets a boolean indicating that the value of this input will not change after a build */\r\n public isConstant = false;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<InputBlock>();\r\n\r\n /** Gets or sets a boolean indicating if content needs to be converted to gamma space (for color3/4 only) */\r\n public convertToGammaSpace = false;\r\n\r\n /** Gets or sets a boolean indicating if content needs to be converted to linear space (for color3/4 only) */\r\n public convertToLinearSpace = false;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeMaterialBlockConnectionPointTypes {\r\n if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {\r\n if (this.isUniform && this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeMaterialBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Color3\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color3;\r\n return this._type;\r\n case \"Color4\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n\r\n if (this.isAttribute) {\r\n switch (this.name) {\r\n case \"position\":\r\n case \"normal\":\r\n case \"particle_positionw\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"uv\":\r\n case \"uv2\":\r\n case \"uv3\":\r\n case \"uv4\":\r\n case \"uv5\":\r\n case \"uv6\":\r\n case \"position2d\":\r\n case \"particle_uv\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"matricesIndices\":\r\n case \"matricesWeights\":\r\n case \"world0\":\r\n case \"world1\":\r\n case \"world2\":\r\n case \"world3\":\r\n case \"tangent\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"color\":\r\n case \"instanceColor\":\r\n case \"particle_color\":\r\n case \"particle_texturemask\":\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color4;\r\n return this._type;\r\n }\r\n }\r\n\r\n if (this.isSystemValue) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n case NodeMaterialSystemValues.WorldView:\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n case NodeMaterialSystemValues.View:\r\n case NodeMaterialSystemValues.ViewProjection:\r\n case NodeMaterialSystemValues.Projection:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n case NodeMaterialSystemValues.CameraPosition:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case NodeMaterialSystemValues.FogColor:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Color3;\r\n return this._type;\r\n case NodeMaterialSystemValues.DeltaTime:\r\n case NodeMaterialSystemValues.MaterialAlpha:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Float;\r\n return this._type;\r\n case NodeMaterialSystemValues.CameraParameters:\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param target defines the target of that block (Vertex by default)\r\n * @param type defines the type of the input (can be set to NodeMaterialBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, target = NodeMaterialBlockTargets.Vertex, type: NodeMaterialBlockConnectionPointTypes = NodeMaterialBlockConnectionPointTypes.AutoDetect) {\r\n super(name, target, false, true);\r\n\r\n this._type = type;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Validates if a name is a reserve word.\r\n * @param newName the new name to be given to the node.\r\n * @returns false if the name is a reserve word, else true.\r\n */\r\n public validateBlockName(newName: string) {\r\n if (!this.isAttribute) {\r\n return super.validateBlockName(newName);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the source of this connection point to a vertex attribute\r\n * @param attributeName defines the attribute name (position, uv, normal, etc...). If not specified it will take the connection point name\r\n * @returns the current connection point\r\n */\r\n public setAsAttribute(attributeName?: string): InputBlock {\r\n this._mode = NodeMaterialBlockConnectionPointMode.Attribute;\r\n if (attributeName) {\r\n this.name = attributeName;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the source of this connection point to a system value\r\n * @param value define the system value to use (world, view, etc...) or null to switch to manual value\r\n * @returns the current connection point\r\n */\r\n public setAsSystemValue(value: Nullable<NodeMaterialSystemValues>): InputBlock {\r\n this.systemValue = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n if (this.isBoolean) {\r\n value = value ? 1 : 0;\r\n } else if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n }\r\n\r\n /**\r\n * Gets or sets the associated variable name in the shader\r\n */\r\n public get associatedVariableName(): string {\r\n return this._associatedVariableName;\r\n }\r\n\r\n public set associatedVariableName(value: string) {\r\n this._associatedVariableName = value;\r\n }\r\n\r\n /** Gets or sets the type of animation applied to the input */\r\n public get animationType() {\r\n return this._animationType;\r\n }\r\n\r\n public set animationType(value: AnimatedInputBlockTypes) {\r\n this._animationType = value;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that this connection point not defined yet\r\n */\r\n public get isUndefined(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is coming from an uniform.\r\n * In this case the connection point name must be the name of the uniform to use.\r\n * Can only be set on inputs\r\n */\r\n public get isUniform(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Uniform;\r\n }\r\n\r\n public set isUniform(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Uniform : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is coming from an attribute.\r\n * In this case the connection point name must be the name of the attribute to use\r\n * Can only be set on inputs\r\n */\r\n public get isAttribute(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Attribute;\r\n }\r\n\r\n public set isAttribute(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Attribute : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is generating a varying variable.\r\n * Can only be set on exit points\r\n */\r\n public get isVarying(): boolean {\r\n return this._mode === NodeMaterialBlockConnectionPointMode.Varying;\r\n }\r\n\r\n public set isVarying(value: boolean) {\r\n this._mode = value ? NodeMaterialBlockConnectionPointMode.Varying : NodeMaterialBlockConnectionPointMode.Undefined;\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a system value\r\n */\r\n public get isSystemValue(): boolean {\r\n return this._systemValue != null;\r\n }\r\n\r\n /**\r\n * Gets or sets the current well known value or null if not defined as a system value\r\n */\r\n public get systemValue(): Nullable<NodeMaterialSystemValues> {\r\n return this._systemValue;\r\n }\r\n\r\n public set systemValue(value: Nullable<NodeMaterialSystemValues>) {\r\n this._mode = NodeMaterialBlockConnectionPointMode.Uniform;\r\n this.associatedVariableName = \"\";\r\n this._systemValue = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"InputBlock\";\r\n }\r\n\r\n /**\r\n * Animate the input if animationType !== None\r\n * @param scene defines the rendering scene\r\n */\r\n public animate(scene: Scene) {\r\n switch (this._animationType) {\r\n case AnimatedInputBlockTypes.Time: {\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n this.value += scene.getAnimationRatio() * 0.01;\r\n }\r\n break;\r\n }\r\n case AnimatedInputBlockTypes.RealTime: {\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n this.value = (PrecisionDate.Now - scene.getEngine().startTime) / 1000;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private _emitDefine(define: string): string {\r\n if (define[0] === \"!\") {\r\n return `#ifndef ${define.substring(1)}\\r\\n`;\r\n }\r\n\r\n return `#ifdef ${define}\\r\\n`;\r\n }\r\n\r\n public initialize() {\r\n this.associatedVariableName = \"\";\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n this.value = Color3.White();\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n this.value = new Color4(1, 1, 1, 1);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n private _emitConstant(state: NodeMaterialBuildState) {\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n return `${state._emitFloat(this.value)}`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n return `vec2(${this.value.x}, ${this.value.y})`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n return `vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n return `vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n TmpColors.Color3[0].set(this.value.r, this.value.g, this.value.b);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color3[0].toGammaSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color3[0].toLinearSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n return `vec3(${TmpColors.Color3[0].r}, ${TmpColors.Color3[0].g}, ${TmpColors.Color3[0].b})`;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n TmpColors.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color4[0].toGammaSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color4[0].toLinearSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n return `vec4(${TmpColors.Color4[0].r}, ${TmpColors.Color4[0].g}, ${TmpColors.Color4[0].b}, ${TmpColors.Color4[0].a})`;\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n /** @internal */\r\n public get _noContextSwitch(): boolean {\r\n return attributeInFragmentOnly[this.name];\r\n }\r\n\r\n private _emit(state: NodeMaterialBuildState, define?: string) {\r\n // Uniforms\r\n if (this.isUniform) {\r\n if (!this.associatedVariableName) {\r\n this.associatedVariableName = state._getFreeVariableName(\"u_\" + this.name);\r\n }\r\n\r\n if (this.isConstant) {\r\n if (state.constants.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n state.constants.push(this.associatedVariableName);\r\n state._constantDeclaration += this._declareOutput(this.output, state) + ` = ${this._emitConstant(state)};\\r\\n`;\r\n return;\r\n }\r\n\r\n if (state.uniforms.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n\r\n state.uniforms.push(this.associatedVariableName);\r\n if (define) {\r\n state._uniformDeclaration += this._emitDefine(define);\r\n }\r\n state._uniformDeclaration += `uniform ${state._getGLType(this.type)} ${this.associatedVariableName};\\r\\n`;\r\n if (define) {\r\n state._uniformDeclaration += `#endif\\r\\n`;\r\n }\r\n\r\n // well known\r\n const hints = state.sharedData.hints;\r\n if (this._systemValue !== null && this._systemValue !== undefined) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.WorldView:\r\n hints.needWorldViewMatrix = true;\r\n break;\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n hints.needWorldViewProjectionMatrix = true;\r\n break;\r\n }\r\n } else {\r\n if (this._animationType !== AnimatedInputBlockTypes.None) {\r\n state.sharedData.animatedInputs.push(this);\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n // Attribute\r\n if (this.isAttribute) {\r\n this.associatedVariableName = remapAttributeName[this.name] ?? this.name;\r\n\r\n if (this.target === NodeMaterialBlockTargets.Vertex && state._vertexState) {\r\n // Attribute for fragment need to be carried over by varyings\r\n if (attributeInFragmentOnly[this.name]) {\r\n if (attributeAsUniform[this.name]) {\r\n state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n } else {\r\n state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n }\r\n } else {\r\n this._emit(state._vertexState, define);\r\n }\r\n return;\r\n }\r\n\r\n if (state.attributes.indexOf(this.associatedVariableName) !== -1) {\r\n return;\r\n }\r\n\r\n state.attributes.push(this.associatedVariableName);\r\n\r\n if (attributeInFragmentOnly[this.name]) {\r\n if (attributeAsUniform[this.name]) {\r\n state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n } else {\r\n state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define);\r\n }\r\n } else {\r\n if (define) {\r\n state._attributeDeclaration += this._emitDefine(define);\r\n }\r\n state._attributeDeclaration += `attribute ${state._getGLType(this.type)} ${this.associatedVariableName};\\r\\n`;\r\n if (define) {\r\n state._attributeDeclaration += `#endif\\r\\n`;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _transmitWorld(effect: Effect, world: Matrix, worldView: Matrix, worldViewProjection: Matrix) {\r\n if (!this._systemValue) {\r\n return;\r\n }\r\n\r\n const variableName = this.associatedVariableName;\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n effect.setMatrix(variableName, world);\r\n break;\r\n case NodeMaterialSystemValues.WorldView:\r\n effect.setMatrix(variableName, worldView);\r\n break;\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n effect.setMatrix(variableName, worldViewProjection);\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _transmit(effect: Effect, scene: Scene, material: NodeMaterial) {\r\n if (this.isAttribute) {\r\n return;\r\n }\r\n\r\n const variableName = this.associatedVariableName;\r\n if (this._systemValue) {\r\n switch (this._systemValue) {\r\n case NodeMaterialSystemValues.World:\r\n case NodeMaterialSystemValues.WorldView:\r\n case NodeMaterialSystemValues.WorldViewProjection:\r\n return;\r\n case NodeMaterialSystemValues.View:\r\n effect.setMatrix(variableName, scene.getViewMatrix());\r\n break;\r\n case NodeMaterialSystemValues.Projection:\r\n effect.setMatrix(variableName, scene.getProjectionMatrix());\r\n break;\r\n case NodeMaterialSystemValues.ViewProjection:\r\n effect.setMatrix(variableName, scene.getTransformMatrix());\r\n break;\r\n case NodeMaterialSystemValues.CameraPosition:\r\n scene.bindEyePosition(effect, variableName, true);\r\n break;\r\n case NodeMaterialSystemValues.FogColor:\r\n effect.setColor3(variableName, scene.fogColor);\r\n break;\r\n case NodeMaterialSystemValues.DeltaTime:\r\n effect.setFloat(variableName, scene.deltaTime / 1000.0);\r\n break;\r\n case NodeMaterialSystemValues.CameraParameters:\r\n if (scene.activeCamera) {\r\n effect.setFloat4(\r\n variableName,\r\n scene.getEngine().hasOriginBottomLeft ? -1 : 1,\r\n scene.activeCamera.minZ,\r\n scene.activeCamera.maxZ,\r\n 1 / scene.activeCamera.maxZ\r\n );\r\n }\r\n break;\r\n case NodeMaterialSystemValues.MaterialAlpha:\r\n effect.setFloat(variableName, material.alpha);\r\n break;\r\n }\r\n return;\r\n }\r\n\r\n const value = this._valueCallback ? this._valueCallback() : this._storedValue;\r\n\r\n if (value === null) {\r\n return;\r\n }\r\n\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n effect.setFloat(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Int:\r\n effect.setInt(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n TmpColors.Color3[0].set(this.value.r, this.value.g, this.value.b);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color3[0].toGammaSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color3[0].toLinearSpaceToRef(TmpColors.Color3[0]);\r\n }\r\n effect.setColor3(variableName, TmpColors.Color3[0]);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n TmpColors.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);\r\n if (this.convertToGammaSpace) {\r\n TmpColors.Color4[0].toGammaSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n if (this.convertToLinearSpace) {\r\n TmpColors.Color4[0].toLinearSpaceToRef(TmpColors.Color4[0]);\r\n }\r\n effect.setDirectColor4(variableName, TmpColors.Color4[0]);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n effect.setVector2(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n effect.setVector3(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n effect.setVector4(variableName, value);\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n effect.setMatrix(variableName, value);\r\n break;\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isUniform || this.isSystemValue) {\r\n state.sharedData.inputBlocks.push(this);\r\n }\r\n\r\n this._emit(state);\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isAttribute) {\r\n return super._dumpPropertiesCode() + `${variableName}.setAsAttribute(\"${this.name}\");\\r\\n`;\r\n }\r\n if (this.isSystemValue) {\r\n return super._dumpPropertiesCode() + `${variableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue!]});\\r\\n`;\r\n }\r\n if (this.isUniform) {\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n valueString = `new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`;\r\n if (this.convertToGammaSpace) {\r\n valueString += \".toGammaSpace()\";\r\n }\r\n if (this.convertToLinearSpace) {\r\n valueString += \".toLinearSpace()\";\r\n }\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;\r\n if (this.convertToGammaSpace) {\r\n valueString += \".toGammaSpace()\";\r\n }\r\n if (this.convertToLinearSpace) {\r\n valueString += \".toLinearSpace()\";\r\n }\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Matrix:\r\n valueString = `BABYLON.Matrix.FromArray([${(this.value as Matrix).m}])`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n codes.push(\r\n `${variableName}.min = ${this.min}`,\r\n `${variableName}.max = ${this.max}`,\r\n `${variableName}.isBoolean = ${this.isBoolean}`,\r\n `${variableName}.matrixMode = ${this.matrixMode}`,\r\n `${variableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]}`\r\n );\r\n }\r\n\r\n // Common Property \"Type\"\r\n codes.push(`${variableName}.isConstant = ${this.isConstant}`);\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\r\\n\");\r\n }\r\n return super._dumpPropertiesCode();\r\n }\r\n\r\n public dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.mode = this._mode;\r\n serializationObject.systemValue = this._systemValue;\r\n serializationObject.animationType = this._animationType;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.isBoolean = this.isBoolean;\r\n serializationObject.matrixMode = this.matrixMode;\r\n serializationObject.isConstant = this.isConstant;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n serializationObject.convertToGammaSpace = this.convertToGammaSpace;\r\n serializationObject.convertToLinearSpace = this.convertToLinearSpace;\r\n\r\n if (this._storedValue != null && this._mode === NodeMaterialBlockConnectionPointMode.Uniform) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n this._mode = serializationObject.mode;\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this._type = serializationObject.type;\r\n\r\n this._systemValue = serializationObject.systemValue || serializationObject.wellKnownValue;\r\n this._animationType = serializationObject.animationType;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.isBoolean = !!serializationObject.isBoolean;\r\n this.matrixMode = serializationObject.matrixMode || 0;\r\n this.isConstant = !!serializationObject.isConstant;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n this.convertToGammaSpace = !!serializationObject.convertToGammaSpace;\r\n this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;\r\n\r\n // Tangents back compat\r\n if (\r\n serializationObject.name === \"tangent\" &&\r\n serializationObject.mode === NodeMaterialBlockConnectionPointMode.Attribute &&\r\n serializationObject.type === NodeMaterialBlockConnectionPointTypes.Vector3\r\n ) {\r\n this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n }\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InputBlock\", InputBlock);\r\n"]}
@@ -1428,7 +1428,7 @@ export class PBRBaseMaterial extends PushMaterial {
1428
1428
  defines.BUMP = false;
1429
1429
  defines.PARALLAX = false;
1430
1430
  defines.PARALLAXOCCLUSION = false;
1431
- defines.PARALLAOBJECTSPACE_NORMALMAP = false;
1431
+ defines.OBJECTSPACE_NORMALMAP = false;
1432
1432
  }
1433
1433
  if (this._environmentBRDFTexture && MaterialFlags.ReflectionTextureEnabled) {
1434
1434
  defines.ENVIRONMENTBRDF = true;