@babylonjs/core 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +4 -2
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +1 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +11 -7
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +1 -1
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +2 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +28 -17
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.d.ts +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +3 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.d.ts +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +34 -27
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +1 -0
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +1 -0
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -1
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/TBNBlock.d.ts +47 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js +154 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js.map +1 -0
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +5 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +20 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +2 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +6 -5
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +9 -9
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -1
- package/Materials/Textures/renderTargetTexture.js +24 -20
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +2 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Maths/math.vector.js +2 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/instancedMesh.js +0 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +32 -4
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +3 -2
- package/Misc/sceneOptimizer.js +4 -1
- package/Misc/sceneOptimizer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +2 -2
- package/scene.js.map +1 -1
|
@@ -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,IAAM,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,IAAM,uBAAuB,GAAgC;IACzD,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,IAAI;IACp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AAmB,GAAG,CAAC,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;QACrE,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,mBAAmB,CAAC,oBAAoB,CAAC;QAEvE,IAAI,CAAC,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,IAAM,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;IACL,iBAAC;AAAD,CAAC,AArxBD,CAAgC,iBAAiB,GAqxBhD;;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 /** @hidden */\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 \"tangent\":\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 this._type = NodeMaterialBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"color\":\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 /** @hidden */\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 * @param effect\r\n * @param world\r\n * @param worldView\r\n * @param worldViewProjection\r\n * @hidden\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 * @param effect\r\n * @param scene\r\n * @param material\r\n * @hidden\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 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,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;aACtE;SACJ;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AArxBD,CAAgC,iBAAiB,GAqxBhD;;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 /** @hidden */\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 \"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 /** @hidden */\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 * @param effect\r\n * @param world\r\n * @param worldView\r\n * @param worldViewProjection\r\n * @hidden\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 * @param effect\r\n * @param scene\r\n * @param material\r\n * @hidden\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 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"]}
|
|
@@ -47,6 +47,10 @@ export declare class AnisotropyBlock extends NodeMaterialBlock {
|
|
|
47
47
|
* Gets the worldTangent input component
|
|
48
48
|
*/
|
|
49
49
|
get worldTangent(): NodeMaterialConnectionPoint;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the TBN input component
|
|
52
|
+
*/
|
|
53
|
+
get TBN(): NodeMaterialConnectionPoint;
|
|
50
54
|
/**
|
|
51
55
|
* Gets the anisotropy object output component
|
|
52
56
|
*/
|
|
@@ -5,6 +5,7 @@ import { NodeMaterialConnectionPointDirection } from "../../nodeMaterialBlockCon
|
|
|
5
5
|
import { NodeMaterialBlockTargets } from "../../Enums/nodeMaterialBlockTargets.js";
|
|
6
6
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
7
7
|
import { NodeMaterialConnectionPointCustomObject } from "../../nodeMaterialConnectionPointCustomObject.js";
|
|
8
|
+
import { TBNBlock } from "../Dual/TBNBlock.js";
|
|
8
9
|
/**
|
|
9
10
|
* Block used to implement the anisotropy module of the PBR material
|
|
10
11
|
*/
|
|
@@ -21,6 +22,7 @@ var AnisotropyBlock = /** @class */ (function (_super) {
|
|
|
21
22
|
_this.registerInput("direction", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Fragment);
|
|
22
23
|
_this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, true); // need this property and the next one in case there's no PerturbNormal block connected to the main PBR block
|
|
23
24
|
_this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, true);
|
|
25
|
+
_this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", _this, NodeMaterialConnectionPointDirection.Input, TBNBlock, "TBNBlock"));
|
|
24
26
|
_this.registerOutput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("anisotropy", _this, NodeMaterialConnectionPointDirection.Output, AnisotropyBlock, "AnisotropyBlock"));
|
|
25
27
|
return _this;
|
|
26
28
|
}
|
|
@@ -79,6 +81,17 @@ var AnisotropyBlock = /** @class */ (function (_super) {
|
|
|
79
81
|
enumerable: false,
|
|
80
82
|
configurable: true
|
|
81
83
|
});
|
|
84
|
+
Object.defineProperty(AnisotropyBlock.prototype, "TBN", {
|
|
85
|
+
/**
|
|
86
|
+
* Gets the TBN input component
|
|
87
|
+
*/
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
89
|
+
get: function () {
|
|
90
|
+
return this._inputs[4];
|
|
91
|
+
},
|
|
92
|
+
enumerable: false,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
82
95
|
Object.defineProperty(AnisotropyBlock.prototype, "anisotropy", {
|
|
83
96
|
/**
|
|
84
97
|
* Gets the anisotropy object output component
|
|
@@ -104,7 +117,11 @@ var AnisotropyBlock = /** @class */ (function (_super) {
|
|
|
104
117
|
}
|
|
105
118
|
state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
|
|
106
119
|
var tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" };
|
|
107
|
-
|
|
120
|
+
var TBN = this.TBN;
|
|
121
|
+
if (TBN.isConnected) {
|
|
122
|
+
state.compilationString += "\n #ifdef TBNBLOCK\n mat3 vTBN = ".concat(TBN.associatedVariableName, ";\n #endif\n ");
|
|
123
|
+
}
|
|
124
|
+
else if (worldTangent.isConnected) {
|
|
108
125
|
code += "vec3 tbnNormal = normalize(".concat(worldNormal.associatedVariableName, ".xyz);\r\n");
|
|
109
126
|
code += "vec3 tbnTangent = normalize(".concat(worldTangent.associatedVariableName, ".xyz);\r\n");
|
|
110
127
|
code += "vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anisotropyBlock.js","sourceRoot":"","sources":["../../../../../../../../lts/core/generated/Materials/Node/Blocks/PBR/anisotropyBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAG1G,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAC;AAExG;;GAEG;AACH;IAAqC,mCAAiB;IAYlD;;;OAGG;IACH,yBAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,QAAQ,CAAC,SAejD;QAbG,KAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,KAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACtH,KAAI,CAAC,aAAa,CAAC,WA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D;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,sBAAC;AAAD,CAAC,AA9KD,CAAqC,iBAAiB,GA8KrD;;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import type { NodeMaterial, NodeMaterialDefines } from \"../../nodeMaterial\";\r\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialConnectionPointDirection } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { AbstractMesh } from \"../../../../Meshes/abstractMesh\";\r\nimport { NodeMaterialConnectionPointCustomObject } from \"../../nodeMaterialConnectionPointCustomObject\";\r\n\r\n/**\r\n * Block used to implement the anisotropy module of the PBR material\r\n */\r\nexport class AnisotropyBlock extends NodeMaterialBlock {\r\n /**\r\n * The two properties below are set by the main PBR block prior to calling methods of this class.\r\n * This is to avoid having to add them as inputs here whereas they are already inputs of the main block, so already known.\r\n * It's less burden on the user side in the editor part.\r\n */\r\n\r\n /** @hidden */\r\n public worldPositionConnectionPoint: NodeMaterialConnectionPoint;\r\n /** @hidden */\r\n public worldNormalConnectionPoint: NodeMaterialConnectionPoint;\r\n\r\n /**\r\n * Create a new AnisotropyBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Fragment);\r\n\r\n this._isUnique = true;\r\n\r\n this.registerInput(\"intensity\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\r\n this.registerInput(\"direction\", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Fragment);\r\n this.registerInput(\"uv\", NodeMaterialBlockConnectionPointTypes.Vector2, true); // need this property and the next one in case there's no PerturbNormal block connected to the main PBR block\r\n this.registerInput(\"worldTangent\", NodeMaterialBlockConnectionPointTypes.Vector4, true);\r\n\r\n this.registerOutput(\r\n \"anisotropy\",\r\n NodeMaterialBlockConnectionPointTypes.Object,\r\n NodeMaterialBlockTargets.Fragment,\r\n new NodeMaterialConnectionPointCustomObject(\"anisotropy\", this, NodeMaterialConnectionPointDirection.Output, AnisotropyBlock, \"AnisotropyBlock\")\r\n );\r\n }\r\n\r\n /**\r\n * Initialize the block and prepare the context for build\r\n * @param state defines the state that will be used for the build\r\n */\r\n public initialize(state: NodeMaterialBuildState) {\r\n state._excludeVariableName(\"anisotropicOut\");\r\n state._excludeVariableName(\"TBN\");\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 \"AnisotropyBlock\";\r\n }\r\n\r\n /**\r\n * Gets the intensity input component\r\n */\r\n public get intensity(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get direction(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the uv input component\r\n */\r\n public get uv(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the worldTangent input component\r\n */\r\n public get worldTangent(): NodeMaterialConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the anisotropy object output component\r\n */\r\n public get anisotropy(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _generateTBNSpace(state: NodeMaterialBuildState) {\r\n let code = \"\";\r\n\r\n const comments = `//${this.name}`;\r\n const uv = this.uv;\r\n const worldPosition = this.worldPositionConnectionPoint;\r\n const worldNormal = this.worldNormalConnectionPoint;\r\n const worldTangent = this.worldTangent;\r\n\r\n if (!uv.isConnected) {\r\n // we must set the uv input as optional because we may not end up in this method (in case a PerturbNormal block is linked to the PBR material)\r\n // in which case uv is not required. But if we do come here, we do need the uv, so we have to raise an error but not with throw, else\r\n // it will stop the building of the node material and will lead to errors in the editor!\r\n console.error(\"You must connect the 'uv' input of the Anisotropy block!\");\r\n }\r\n\r\n state._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\r\n\r\n const tangentReplaceString = { search: /defined\\(TANGENT\\)/g, replace: worldTangent.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\r\n\r\n if (worldTangent.isConnected) {\r\n code += `vec3 tbnNormal = normalize(${worldNormal.associatedVariableName}.xyz);\\r\\n`;\r\n code += `vec3 tbnTangent = normalize(${worldTangent.associatedVariableName}.xyz);\\r\\n`;\r\n code += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\\n`;\r\n code += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\\n`;\r\n }\r\n\r\n code += `\r\n #if defined(${worldTangent.isConnected ? \"TANGENT\" : \"IGNORE\"}) && defined(NORMAL)\r\n mat3 TBN = vTBN;\r\n #else\r\n mat3 TBN = cotangent_frame(${worldNormal.associatedVariableName + \".xyz\"}, ${\"v_\" + worldPosition.associatedVariableName + \".xyz\"}, ${\r\n uv.isConnected ? uv.associatedVariableName : \"vec2(0.)\"\r\n }, vec2(1., 1.));\r\n #endif\\r\\n`;\r\n\r\n state._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", comments, {\r\n replaceStrings: [tangentReplaceString],\r\n });\r\n\r\n return code;\r\n }\r\n\r\n /**\r\n * Gets the main code of the block (fragment side)\r\n * @param state current state of the node material building\r\n * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated\r\n * @returns the shader code\r\n */\r\n public getCode(state: NodeMaterialBuildState, generateTBNSpace = false): string {\r\n let code = \"\";\r\n\r\n if (generateTBNSpace) {\r\n code += this._generateTBNSpace(state);\r\n }\r\n\r\n const intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.0\";\r\n const direction = this.direction.isConnected ? this.direction.associatedVariableName : \"vec2(1., 0.)\";\r\n\r\n code += `anisotropicOutParams anisotropicOut;\r\n anisotropicBlock(\r\n vec3(${direction}, ${intensity}),\r\n #ifdef ANISOTROPIC_TEXTURE\r\n vec3(0.),\r\n #endif\r\n TBN,\r\n normalW,\r\n viewDirectionW,\r\n anisotropicOut\r\n );\\r\\n`;\r\n\r\n return code;\r\n }\r\n\r\n public prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines) {\r\n super.prepareDefines(mesh, nodeMaterial, defines);\r\n\r\n defines.setValue(\"ANISOTROPIC\", true);\r\n defines.setValue(\"ANISOTROPIC_TEXTURE\", false, true);\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n if (state.target === NodeMaterialBlockTargets.Fragment) {\r\n state.sharedData.blocksWithDefines.push(this);\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.AnisotropyBlock\", AnisotropyBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"anisotropyBlock.js","sourceRoot":"","sources":["../../../../../../../../lts/core/generated/Materials/Node/Blocks/PBR/anisotropyBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAG1G,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;GAEG;AACH;IAAqC,mC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AS,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7F,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC,cAAc,CAAC;QAEtG,IAAI,IAAI,oGAEO,SAAS,eAAK,SAAS,mOAQ3B,CAAC;QAEZ,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,wCAAc,GAArB,UAAsB,IAAkB,EAAE,YAA0B,EAAE,OAA4B;QAC9F,iBAAM,cAAc,YAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAElD,OAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAES,qCAAW,GAArB,UAAsB,KAA6B;QAC/C,IAAI,KAAK,CAAC,MAAM,KAAK,wBAAwB,CAAC,QAAQ,EAAE;YACpD,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,sBAAC;AAAD,CAAC,AApMD,CAAqC,iBAAiB,GAoMrD;;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import type { NodeMaterial, NodeMaterialDefines } from \"../../nodeMaterial\";\r\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialConnectionPointDirection } from \"../../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { AbstractMesh } from \"../../../../Meshes/abstractMesh\";\r\nimport { NodeMaterialConnectionPointCustomObject } from \"../../nodeMaterialConnectionPointCustomObject\";\r\nimport { TBNBlock } from \"../Dual/TBNBlock\";\r\n\r\n/**\r\n * Block used to implement the anisotropy module of the PBR material\r\n */\r\nexport class AnisotropyBlock extends NodeMaterialBlock {\r\n /**\r\n * The two properties below are set by the main PBR block prior to calling methods of this class.\r\n * This is to avoid having to add them as inputs here whereas they are already inputs of the main block, so already known.\r\n * It's less burden on the user side in the editor part.\r\n */\r\n\r\n /** @hidden */\r\n public worldPositionConnectionPoint: NodeMaterialConnectionPoint;\r\n /** @hidden */\r\n public worldNormalConnectionPoint: NodeMaterialConnectionPoint;\r\n\r\n /**\r\n * Create a new AnisotropyBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Fragment);\r\n\r\n this._isUnique = true;\r\n\r\n this.registerInput(\"intensity\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\r\n this.registerInput(\"direction\", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Fragment);\r\n this.registerInput(\"uv\", NodeMaterialBlockConnectionPointTypes.Vector2, true); // need this property and the next one in case there's no PerturbNormal block connected to the main PBR block\r\n this.registerInput(\"worldTangent\", NodeMaterialBlockConnectionPointTypes.Vector4, true);\r\n this.registerInput(\r\n \"TBN\",\r\n NodeMaterialBlockConnectionPointTypes.Object,\r\n true,\r\n NodeMaterialBlockTargets.VertexAndFragment,\r\n new NodeMaterialConnectionPointCustomObject(\"TBN\", this, NodeMaterialConnectionPointDirection.Input, TBNBlock, \"TBNBlock\")\r\n );\r\n\r\n this.registerOutput(\r\n \"anisotropy\",\r\n NodeMaterialBlockConnectionPointTypes.Object,\r\n NodeMaterialBlockTargets.Fragment,\r\n new NodeMaterialConnectionPointCustomObject(\"anisotropy\", this, NodeMaterialConnectionPointDirection.Output, AnisotropyBlock, \"AnisotropyBlock\")\r\n );\r\n }\r\n\r\n /**\r\n * Initialize the block and prepare the context for build\r\n * @param state defines the state that will be used for the build\r\n */\r\n public initialize(state: NodeMaterialBuildState) {\r\n state._excludeVariableName(\"anisotropicOut\");\r\n state._excludeVariableName(\"TBN\");\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 \"AnisotropyBlock\";\r\n }\r\n\r\n /**\r\n * Gets the intensity input component\r\n */\r\n public get intensity(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get direction(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the uv input component\r\n */\r\n public get uv(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the worldTangent input component\r\n */\r\n public get worldTangent(): NodeMaterialConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the TBN input component\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public get TBN(): NodeMaterialConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the anisotropy object output component\r\n */\r\n public get anisotropy(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _generateTBNSpace(state: NodeMaterialBuildState) {\r\n let code = \"\";\r\n\r\n const comments = `//${this.name}`;\r\n const uv = this.uv;\r\n const worldPosition = this.worldPositionConnectionPoint;\r\n const worldNormal = this.worldNormalConnectionPoint;\r\n const worldTangent = this.worldTangent;\r\n\r\n if (!uv.isConnected) {\r\n // we must set the uv input as optional because we may not end up in this method (in case a PerturbNormal block is linked to the PBR material)\r\n // in which case uv is not required. But if we do come here, we do need the uv, so we have to raise an error but not with throw, else\r\n // it will stop the building of the node material and will lead to errors in the editor!\r\n console.error(\"You must connect the 'uv' input of the Anisotropy block!\");\r\n }\r\n\r\n state._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\r\n\r\n const tangentReplaceString = { search: /defined\\(TANGENT\\)/g, replace: worldTangent.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\r\n\r\n const TBN = this.TBN;\r\n if (TBN.isConnected) {\r\n state.compilationString += `\r\n #ifdef TBNBLOCK\r\n mat3 vTBN = ${TBN.associatedVariableName};\r\n #endif\r\n `;\r\n } else if (worldTangent.isConnected) {\r\n code += `vec3 tbnNormal = normalize(${worldNormal.associatedVariableName}.xyz);\\r\\n`;\r\n code += `vec3 tbnTangent = normalize(${worldTangent.associatedVariableName}.xyz);\\r\\n`;\r\n code += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\\n`;\r\n code += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\\n`;\r\n }\r\n\r\n code += `\r\n #if defined(${worldTangent.isConnected ? \"TANGENT\" : \"IGNORE\"}) && defined(NORMAL)\r\n mat3 TBN = vTBN;\r\n #else\r\n mat3 TBN = cotangent_frame(${worldNormal.associatedVariableName + \".xyz\"}, ${\"v_\" + worldPosition.associatedVariableName + \".xyz\"}, ${\r\n uv.isConnected ? uv.associatedVariableName : \"vec2(0.)\"\r\n }, vec2(1., 1.));\r\n #endif\\r\\n`;\r\n\r\n state._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", comments, {\r\n replaceStrings: [tangentReplaceString],\r\n });\r\n\r\n return code;\r\n }\r\n\r\n /**\r\n * Gets the main code of the block (fragment side)\r\n * @param state current state of the node material building\r\n * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated\r\n * @returns the shader code\r\n */\r\n public getCode(state: NodeMaterialBuildState, generateTBNSpace = false): string {\r\n let code = \"\";\r\n\r\n if (generateTBNSpace) {\r\n code += this._generateTBNSpace(state);\r\n }\r\n\r\n const intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.0\";\r\n const direction = this.direction.isConnected ? this.direction.associatedVariableName : \"vec2(1., 0.)\";\r\n\r\n code += `anisotropicOutParams anisotropicOut;\r\n anisotropicBlock(\r\n vec3(${direction}, ${intensity}),\r\n #ifdef ANISOTROPIC_TEXTURE\r\n vec3(0.),\r\n #endif\r\n TBN,\r\n normalW,\r\n viewDirectionW,\r\n anisotropicOut\r\n );\\r\\n`;\r\n\r\n return code;\r\n }\r\n\r\n public prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines) {\r\n super.prepareDefines(mesh, nodeMaterial, defines);\r\n\r\n defines.setValue(\"ANISOTROPIC\", true);\r\n defines.setValue(\"ANISOTROPIC_TEXTURE\", false, true);\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n if (state.target === NodeMaterialBlockTargets.Fragment) {\r\n state.sharedData.blocksWithDefines.push(this);\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.AnisotropyBlock\", AnisotropyBlock);\r\n"]}
|
|
@@ -72,6 +72,10 @@ export declare class ClearCoatBlock extends NodeMaterialBlock {
|
|
|
72
72
|
* Gets the world normal input component
|
|
73
73
|
*/
|
|
74
74
|
get worldNormal(): NodeMaterialConnectionPoint;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the TBN input component
|
|
77
|
+
*/
|
|
78
|
+
get TBN(): NodeMaterialConnectionPoint;
|
|
75
79
|
/**
|
|
76
80
|
* Gets the clear coat object output component
|
|
77
81
|
*/
|
|
@@ -8,6 +8,7 @@ import { InputBlock } from "../Input/inputBlock.js";
|
|
|
8
8
|
import { NodeMaterialConnectionPointCustomObject } from "../../nodeMaterialConnectionPointCustomObject.js";
|
|
9
9
|
import { PBRClearCoatConfiguration } from "../../../PBR/pbrClearCoatConfiguration.js";
|
|
10
10
|
import { editableInPropertyPage, PropertyTypeForEdition } from "../../nodeMaterialDecorator.js";
|
|
11
|
+
import { TBNBlock } from "../Dual/TBNBlock.js";
|
|
11
12
|
/**
|
|
12
13
|
* Block used to implement the clear coat module of the PBR material
|
|
13
14
|
*/
|
|
@@ -35,6 +36,7 @@ var ClearCoatBlock = /** @class */ (function (_super) {
|
|
|
35
36
|
_this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, true);
|
|
36
37
|
_this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, true);
|
|
37
38
|
_this.worldNormal.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector3);
|
|
39
|
+
_this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", _this, NodeMaterialConnectionPointDirection.Input, TBNBlock, "TBNBlock"));
|
|
38
40
|
_this.registerOutput("clearcoat", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("clearcoat", _this, NodeMaterialConnectionPointDirection.Output, ClearCoatBlock, "ClearCoatBlock"));
|
|
39
41
|
return _this;
|
|
40
42
|
}
|
|
@@ -157,6 +159,17 @@ var ClearCoatBlock = /** @class */ (function (_super) {
|
|
|
157
159
|
enumerable: false,
|
|
158
160
|
configurable: true
|
|
159
161
|
});
|
|
162
|
+
Object.defineProperty(ClearCoatBlock.prototype, "TBN", {
|
|
163
|
+
/**
|
|
164
|
+
* Gets the TBN input component
|
|
165
|
+
*/
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
167
|
+
get: function () {
|
|
168
|
+
return this._inputs[10];
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
160
173
|
Object.defineProperty(ClearCoatBlock.prototype, "clearcoat", {
|
|
161
174
|
/**
|
|
162
175
|
* Gets the clear coat object output component
|
|
@@ -210,7 +223,11 @@ var ClearCoatBlock = /** @class */ (function (_super) {
|
|
|
210
223
|
var worldTangent = this.worldTangent;
|
|
211
224
|
state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
|
|
212
225
|
var tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" };
|
|
213
|
-
|
|
226
|
+
var TBN = this.TBN;
|
|
227
|
+
if (TBN.isConnected) {
|
|
228
|
+
state.compilationString += "\n #ifdef TBNBLOCK\n mat3 vTBN = ".concat(TBN.associatedVariableName, ";\n #endif\n ");
|
|
229
|
+
}
|
|
230
|
+
else if (worldTangent.isConnected) {
|
|
214
231
|
code += "vec3 tbnNormal = normalize(".concat(worldNormalVarName, ".xyz);\r\n");
|
|
215
232
|
code += "vec3 tbnTangent = normalize(".concat(worldTangent.associatedVariableName, ".xyz);\r\n");
|
|
216
233
|
code += "vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n";
|