Просмотр исходного кода

Merge pull request #8143 from BabylonJS/master

Nightly
mergify[bot] 5 лет назад
Родитель
Сommit
8a2f64a3d8

Разница между файлами не показана из-за своего большого размера
+ 36061 - 36057
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/babylon.js


+ 14 - 7
dist/preview release/babylon.max.js

@@ -8095,17 +8095,19 @@ var Sound = /** @class */ (function () {
         }
         }
     };
     };
     Sound.prototype._onRegisterAfterWorldMatrixUpdate = function (node) {
     Sound.prototype._onRegisterAfterWorldMatrixUpdate = function (node) {
-        if (!node.getBoundingInfo) {
-            return;
-        }
-        var mesh = node;
         if (this._positionInEmitterSpace) {
         if (this._positionInEmitterSpace) {
-            mesh.worldMatrixFromCache.invertToRef(_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["TmpVectors"].Matrix[0]);
+            node.worldMatrixFromCache.invertToRef(_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["TmpVectors"].Matrix[0]);
             this.setPosition(_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["TmpVectors"].Matrix[0].getTranslation());
             this.setPosition(_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["TmpVectors"].Matrix[0].getTranslation());
         }
         }
         else {
         else {
-            var boundingInfo = mesh.getBoundingInfo();
-            this.setPosition(boundingInfo.boundingSphere.centerWorld);
+            if (!node.getBoundingInfo) {
+                this.setPosition(node.absolutePosition);
+            }
+            else {
+                var mesh = node;
+                var boundingInfo = mesh.getBoundingInfo();
+                this.setPosition(boundingInfo.boundingSphere.centerWorld);
+            }
         }
         }
         if (_Engines_engine__WEBPACK_IMPORTED_MODULE_3__["Engine"].audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying) {
         if (_Engines_engine__WEBPACK_IMPORTED_MODULE_3__["Engine"].audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying) {
             this._updateDirection();
             this._updateDirection();
@@ -77138,6 +77140,7 @@ var NodeMaterial = /** @class */ (function (_super) {
         this._processDefines(dummyMesh, defines);
         this._processDefines(dummyMesh, defines);
         _effect__WEBPACK_IMPORTED_MODULE_25__["Effect"].RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);
         _effect__WEBPACK_IMPORTED_MODULE_25__["Effect"].RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);
         var postProcess = new _PostProcesses_postProcess__WEBPACK_IMPORTED_MODULE_26__["PostProcess"](this.name + "PostProcess", tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, false, textureFormat);
         var postProcess = new _PostProcesses_postProcess__WEBPACK_IMPORTED_MODULE_26__["PostProcess"](this.name + "PostProcess", tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, false, textureFormat);
+        postProcess.nodeMaterialSource = this;
         postProcess.onApplyObservable.add(function (effect) {
         postProcess.onApplyObservable.add(function (effect) {
             if (buildId !== _this._buildId) {
             if (buildId !== _this._buildId) {
                 delete _effect__WEBPACK_IMPORTED_MODULE_25__["Effect"].ShadersStore[tempName + "VertexShader"];
                 delete _effect__WEBPACK_IMPORTED_MODULE_25__["Effect"].ShadersStore[tempName + "VertexShader"];
@@ -166932,6 +166935,10 @@ var PostProcess = /** @class */ (function () {
         */
         */
         this.height = -1;
         this.height = -1;
         /**
         /**
+         * Gets the node material used to create this postprocess (null if the postprocess was manually created)
+         */
+        this.nodeMaterialSource = null;
+        /**
         * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)
         * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)
         * @hidden
         * @hidden
         */
         */

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/babylon.max.js.map


Разница между файлами не показана из-за своего большого размера
+ 92186 - 92177
dist/preview release/babylon.module.d.ts


Разница между файлами не показана из-за своего большого размера
+ 36061 - 36057
dist/preview release/documentation.d.ts


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js


+ 13 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -64641,6 +64641,10 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonPostProcessPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/postProcesses/commonPostProcessPropertyGridComponent.tsx");
 /* harmony import */ var _commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonPostProcessPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/postProcesses/commonPostProcessPropertyGridComponent.tsx");
+/* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
+/* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
+
+
 
 
 
 
 
 
@@ -64649,10 +64653,18 @@ var PostProcessPropertyGridComponent = /** @class */ (function (_super) {
     function PostProcessPropertyGridComponent(props) {
     function PostProcessPropertyGridComponent(props) {
         return _super.call(this, props) || this;
         return _super.call(this, props) || this;
     }
     }
+    PostProcessPropertyGridComponent.prototype.edit = function () {
+        var postProcess = this.props.postProcess;
+        postProcess.nodeMaterialSource.edit();
+    };
     PostProcessPropertyGridComponent.prototype.render = function () {
     PostProcessPropertyGridComponent.prototype.render = function () {
+        var _this = this;
         var postProcess = this.props.postProcess;
         var postProcess = this.props.postProcess;
         return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "pane" },
         return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "pane" },
-            react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__["CommonPostProcessPropertyGridComponent"], { globalState: this.props.globalState, lockObject: this.props.lockObject, postProcess: postProcess, onPropertyChangedObservable: this.props.onPropertyChangedObservable })));
+            react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__["CommonPostProcessPropertyGridComponent"], { globalState: this.props.globalState, lockObject: this.props.lockObject, postProcess: postProcess, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+            postProcess.nodeMaterialSource &&
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "CONFIGURATION" },
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Node Material Editor", onClick: function () { return _this.edit(); } }))));
     };
     };
     return PostProcessPropertyGridComponent;
     return PostProcessPropertyGridComponent;
 }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
 }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 1 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -1356,6 +1356,7 @@ declare module INSPECTOR {
     }
     }
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
         constructor(props: IPostProcessPropertyGridComponentProps);
         constructor(props: IPostProcessPropertyGridComponentProps);
+        edit(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }

+ 2 - 0
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -1697,6 +1697,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/pos
     }
     }
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
         constructor(props: IPostProcessPropertyGridComponentProps);
         constructor(props: IPostProcessPropertyGridComponentProps);
+        edit(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -4399,6 +4400,7 @@ declare module INSPECTOR {
     }
     }
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
     export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
         constructor(props: IPostProcessPropertyGridComponentProps);
         constructor(props: IPostProcessPropertyGridComponentProps);
+        edit(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }

Разница между файлами не показана из-за своего большого размера
+ 92186 - 92177
dist/preview release/viewer/babylon.module.d.ts


Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/viewer/babylon.viewer.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 0
dist/preview release/what's new.md

@@ -36,6 +36,7 @@
 - Can now rename and re-order frame inputs and outputs ([belfortk](https://github.com/belfortk))
 - Can now rename and re-order frame inputs and outputs ([belfortk](https://github.com/belfortk))
 - Can now edit Node port names ([belfortk](https://github.com/belfortk))
 - Can now edit Node port names ([belfortk](https://github.com/belfortk))
 - Updated which node ports are shown on frames by default so that only node ports connected to outside nodes are by default exposed on the frame ([belfortk](https://github.com/belfortk))
 - Updated which node ports are shown on frames by default so that only node ports connected to outside nodes are by default exposed on the frame ([belfortk](https://github.com/belfortk))
+- Added a modulo block ([ageneau](https://github.com/ageneau))
 
 
 ### Inspector
 ### Inspector
 
 

+ 13 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/postProcesses/postProcessPropertyGridComponent.tsx

@@ -7,6 +7,8 @@ import { PropertyChangedEvent } from "../../../../propertyChangedEvent";
 import { LockObject } from "../lockObject";
 import { LockObject } from "../lockObject";
 import { CommonPostProcessPropertyGridComponent } from './commonPostProcessPropertyGridComponent';
 import { CommonPostProcessPropertyGridComponent } from './commonPostProcessPropertyGridComponent';
 import { GlobalState } from '../../../../globalState';
 import { GlobalState } from '../../../../globalState';
+import { LineContainerComponent } from '../../../lineContainerComponent';
+import { ButtonLineComponent } from '../../../lines/buttonLineComponent';
 
 
 interface IPostProcessPropertyGridComponentProps {
 interface IPostProcessPropertyGridComponentProps {
     globalState: GlobalState;
     globalState: GlobalState;
@@ -20,12 +22,23 @@ export class PostProcessPropertyGridComponent extends React.Component<IPostProce
         super(props);
         super(props);
     }
     }
 
 
+    edit() {        
+        const postProcess = this.props.postProcess;
+        postProcess.nodeMaterialSource!.edit();
+    }
+
     render() {
     render() {
         const postProcess = this.props.postProcess;
         const postProcess = this.props.postProcess;
 
 
         return (
         return (
             <div className="pane">
             <div className="pane">
                 <CommonPostProcessPropertyGridComponent globalState={this.props.globalState} lockObject={this.props.lockObject} postProcess={postProcess} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                 <CommonPostProcessPropertyGridComponent globalState={this.props.globalState} lockObject={this.props.lockObject} postProcess={postProcess} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                {
+                    postProcess.nodeMaterialSource &&
+                    <LineContainerComponent globalState={this.props.globalState} title="CONFIGURATION">
+                        <ButtonLineComponent label="Node Material Editor" onClick={() => this.edit()} />
+                    </LineContainerComponent>                
+                }
             </div>
             </div>
         );
         );
     }
     }

+ 3 - 0
nodeEditor/src/blockTools.ts

@@ -16,6 +16,7 @@ import { VertexOutputBlock } from 'babylonjs/Materials/Node/Blocks/Vertex/vertex
 import { FragmentOutputBlock } from 'babylonjs/Materials/Node/Blocks/Fragment/fragmentOutputBlock';
 import { FragmentOutputBlock } from 'babylonjs/Materials/Node/Blocks/Fragment/fragmentOutputBlock';
 import { NormalizeBlock } from 'babylonjs/Materials/Node/Blocks/normalizeBlock';
 import { NormalizeBlock } from 'babylonjs/Materials/Node/Blocks/normalizeBlock';
 import { AddBlock } from 'babylonjs/Materials/Node/Blocks/addBlock';
 import { AddBlock } from 'babylonjs/Materials/Node/Blocks/addBlock';
+import { ModBlock } from 'babylonjs/Materials/Node/Blocks/modBlock';
 import { ScaleBlock } from 'babylonjs/Materials/Node/Blocks/scaleBlock';
 import { ScaleBlock } from 'babylonjs/Materials/Node/Blocks/scaleBlock';
 import { TrigonometryBlock, TrigonometryBlockOperations } from 'babylonjs/Materials/Node/Blocks/trigonometryBlock';
 import { TrigonometryBlock, TrigonometryBlockOperations } from 'babylonjs/Materials/Node/Blocks/trigonometryBlock';
 import { ClampBlock } from 'babylonjs/Materials/Node/Blocks/clampBlock';
 import { ClampBlock } from 'babylonjs/Materials/Node/Blocks/clampBlock';
@@ -158,6 +159,8 @@ export class BlockTools {
                 return new DivideBlock("Divide");
                 return new DivideBlock("Divide");
             case "SubtractBlock":
             case "SubtractBlock":
                 return new SubtractBlock("Subtract");
                 return new SubtractBlock("Subtract");
+            case "ModBlock":
+                return new ModBlock("Mod");
             case "StepBlock":
             case "StepBlock":
                 return new StepBlock("Step");
                 return new StepBlock("Step");
             case "SmoothStepBlock":
             case "SmoothStepBlock":

+ 2 - 1
nodeEditor/src/components/nodeList/nodeListComponent.tsx

@@ -81,6 +81,7 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
         "CeilingBlock": "Outputs fractional values as the next higher whole number",
         "CeilingBlock": "Outputs fractional values as the next higher whole number",
         "FloorBlock": "Outputs fractional values as the next lower whole number",
         "FloorBlock": "Outputs fractional values as the next lower whole number",
         "RoundBlock": "Outputs fractional values rounded to the nearest whole number",
         "RoundBlock": "Outputs fractional values rounded to the nearest whole number",
+        "ModBlock": "Outputs the value of one parameter modulo another",
         "CameraPositionBlock": "Outputs a Vector3 position of the active scene camera",
         "CameraPositionBlock": "Outputs a Vector3 position of the active scene camera",
         "FogBlock": "Applies fog to the scene with an increasing opacity based on distance from the camera",
         "FogBlock": "Applies fog to the scene with an increasing opacity based on distance from the camera",
         "FogColorBlock": "The system value for fog color pulled from the scene",
         "FogColorBlock": "The system value for fog color pulled from the scene",
@@ -168,7 +169,7 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
             Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
             Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
             Inputs: ["Float", "Vector2", "Vector3", "Vector4", "Color3", "Color4", "TextureBlock", "ReflectionTextureBlock", "TimeBlock", "DeltaTimeBlock"],
             Inputs: ["Float", "Vector2", "Vector3", "Vector4", "Color3", "Color4", "TextureBlock", "ReflectionTextureBlock", "TimeBlock", "DeltaTimeBlock"],
             Interpolation: ["LerpBlock", "StepBlock", "SmoothStepBlock", "NLerpBlock"],
             Interpolation: ["LerpBlock", "StepBlock", "SmoothStepBlock", "NLerpBlock"],
-            Math__Standard: ["AddBlock", "DivideBlock", "MaxBlock", "MinBlock", "MultiplyBlock", "NegateBlock", "OneMinusBlock", "ReciprocalBlock", "ScaleBlock", "SignBlock", "SqrtBlock", "SubtractBlock"],
+            Math__Standard: ["AddBlock", "DivideBlock", "MaxBlock", "MinBlock", "ModBlock", "MultiplyBlock", "NegateBlock", "OneMinusBlock", "ReciprocalBlock", "ScaleBlock", "SignBlock", "SqrtBlock", "SubtractBlock"],
             Math__Scientific: ["AbsBlock", "ArcCosBlock", "ArcSinBlock", "ArcTanBlock", "ArcTan2Block", "CosBlock", "DegreesToRadiansBlock", "ExpBlock", "Exp2Block", "FractBlock", "LogBlock", "PowBlock", "RadiansToDegreesBlock", "SawToothWaveBlock", "SinBlock", "SquareWaveBlock", "TanBlock", "TriangleWaveBlock"],
             Math__Scientific: ["AbsBlock", "ArcCosBlock", "ArcSinBlock", "ArcTanBlock", "ArcTan2Block", "CosBlock", "DegreesToRadiansBlock", "ExpBlock", "Exp2Block", "FractBlock", "LogBlock", "PowBlock", "RadiansToDegreesBlock", "SawToothWaveBlock", "SinBlock", "SquareWaveBlock", "TanBlock", "TriangleWaveBlock"],
             Math__Vector: ["CrossBlock", "DerivativeBlock", "DistanceBlock", "DotBlock", "FresnelBlock", "LengthBlock", "ReflectBlock", "RefractBlock", "Rotate2dBlock", "TransformBlock", ],
             Math__Vector: ["CrossBlock", "DerivativeBlock", "DistanceBlock", "DotBlock", "FresnelBlock", "LengthBlock", "ReflectBlock", "RefractBlock", "Rotate2dBlock", "TransformBlock", ],
             Matrices: ["Matrix", "WorldMatrixBlock", "WorldViewMatrixBlock", "WorldViewProjectionMatrixBlock", "ViewMatrixBlock", "ViewProjectionMatrixBlock", "ProjectionMatrixBlock"],
             Matrices: ["Matrix", "WorldMatrixBlock", "WorldViewMatrixBlock", "WorldViewProjectionMatrixBlock", "ViewMatrixBlock", "ViewProjectionMatrixBlock", "ProjectionMatrixBlock"],

+ 1 - 0
src/Materials/Node/Blocks/index.ts

@@ -47,3 +47,4 @@ export * from "./refractBlock";
 export * from "./desaturateBlock";
 export * from "./desaturateBlock";
 export * from "./PBR/index";
 export * from "./PBR/index";
 export * from "./Particle/index";
 export * from "./Particle/index";
+export * from "./modBlock";

+ 66 - 0
src/Materials/Node/Blocks/modBlock.ts

@@ -0,0 +1,66 @@
+import { NodeMaterialBlock } from '../nodeMaterialBlock';
+import { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';
+import { NodeMaterialBuildState } from '../nodeMaterialBuildState';
+import { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';
+import { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';
+import { _TypeStore } from '../../../Misc/typeStore';
+/**
+ * Block used to compute value of one parameter modulo another
+ */
+export class ModBlock extends NodeMaterialBlock {
+    /**
+     * Creates a new ModBlock
+     * @param name defines the block name
+     */
+    public constructor(name: string) {
+        super(name, NodeMaterialBlockTargets.Neutral);
+
+        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
+        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
+        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
+
+        this._outputs[0]._typeConnectionSource = this._inputs[0];
+        this._linkConnectionTypes(0, 1);
+    }
+
+    /**
+     * Gets the current class name
+     * @returns the class name
+     */
+    public getClassName() {
+        return "ModBlock";
+    }
+
+    /**
+     * Gets the left operand input component
+     */
+    public get left(): NodeMaterialConnectionPoint {
+        return this._inputs[0];
+    }
+
+    /**
+     * Gets the right operand input component
+     */
+    public get right(): NodeMaterialConnectionPoint {
+        return this._inputs[1];
+    }
+
+    /**
+     * Gets the output component
+     */
+    public get output(): NodeMaterialConnectionPoint {
+        return this._outputs[0];
+    }
+
+    protected _buildBlock(state: NodeMaterialBuildState) {
+        super._buildBlock(state);
+
+        let output = this._outputs[0];
+
+      state.compilationString += this._declareOutput(output, state) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\r\n`;
+
+        return this;
+    }
+}
+
+_TypeStore.RegisteredTypes["BABYLON.ModBlock"] = ModBlock;

+ 2 - 0
src/Materials/Node/nodeMaterial.ts

@@ -765,6 +765,8 @@ export class NodeMaterial extends PushMaterial {
             options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, false, textureFormat
             options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, false, textureFormat
         );
         );
 
 
+        postProcess.nodeMaterialSource = this;
+
         postProcess.onApplyObservable.add((effect) => {
         postProcess.onApplyObservable.add((effect) => {
             if (buildId !== this._buildId) {
             if (buildId !== this._buildId) {
                 delete Effect.ShadersStore[tempName + "VertexShader"];
                 delete Effect.ShadersStore[tempName + "VertexShader"];

+ 7 - 0
src/PostProcesses/postProcess.ts

@@ -11,6 +11,7 @@ import { Engine } from '../Engines/engine';
 import { Color4 } from '../Maths/math.color';
 import { Color4 } from '../Maths/math.color';
 
 
 import "../Engines/Extensions/engine.renderTarget";
 import "../Engines/Extensions/engine.renderTarget";
+import { NodeMaterial } from '../Materials/Node/nodeMaterial';
 
 
 declare type Scene = import("../scene").Scene;
 declare type Scene = import("../scene").Scene;
 declare type InternalTexture = import("../Materials/Textures/internalTexture").InternalTexture;
 declare type InternalTexture = import("../Materials/Textures/internalTexture").InternalTexture;
@@ -36,12 +37,18 @@ export class PostProcess {
     * Width of the texture to apply the post process on
     * Width of the texture to apply the post process on
     */
     */
     public width = -1;
     public width = -1;
+
     /**
     /**
     * Height of the texture to apply the post process on
     * Height of the texture to apply the post process on
     */
     */
     public height = -1;
     public height = -1;
 
 
     /**
     /**
+     * Gets the node material used to create this postprocess (null if the postprocess was manually created)
+     */
+    public nodeMaterialSource: Nullable<NodeMaterial> = null;
+
+    /**
     * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)
     * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)
     * @hidden
     * @hidden
     */
     */