Browse Source

Don't rebuild material if not necessary

Popov72 5 years ago
parent
commit
877d66f8bd

+ 1 - 1
src/Materials/Node/Blocks/Fragment/PBR/ambientOcclusionBlock.ts

@@ -24,7 +24,7 @@ export class AmbientOcclusionBlock extends NodeMaterialBlock {
         this.registerOutput("ambientOcclusion", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("ambientOcclusion", this, NodeMaterialConnectionPointDirection.Output, AmbientOcclusionBlock, "AOBlock"));
         this.registerOutput("ambientOcclusion", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("ambientOcclusion", this, NodeMaterialConnectionPointDirection.Output, AmbientOcclusionBlock, "AOBlock"));
     }
     }
 
 
-    @editableInPropertyPage("Ambient in gray scale", PropertyTypeForEdition.Boolean, "AMBIENT")
+    @editableInPropertyPage("Ambient in gray scale", PropertyTypeForEdition.Boolean, "AMBIENT", { "notifiers": { "rebuild": false }})
     public useAmbientInGrayScale: boolean = false;
     public useAmbientInGrayScale: boolean = false;
 
 
     /**
     /**

+ 12 - 15
src/Materials/Node/Blocks/Fragment/PBR/pbrMetallicRoughnessBlock.ts

@@ -75,43 +75,40 @@ export class PBRMetallicRoughnessBlock extends NodeMaterialBlock {
         this._environmentBRDFTexture = BRDFTextureTools.GetEnvironmentBRDFTexture(Engine.LastCreatedScene!);
         this._environmentBRDFTexture = BRDFTextureTools.GetEnvironmentBRDFTexture(Engine.LastCreatedScene!);
     }
     }
 
 
-    @editableInPropertyPage("Alpha from albedo", PropertyTypeForEdition.Boolean, "TRANSPARENCY")
+    @editableInPropertyPage("Alpha from albedo", PropertyTypeForEdition.Boolean, "TRANSPARENCY", { "notifiers": { "rebuild": false }})
     public useAlphaFromAlbedoTexture: boolean = false;
     public useAlphaFromAlbedoTexture: boolean = false;
 
 
-    @editableInPropertyPage("Alpha Testing", PropertyTypeForEdition.Boolean, "TRANSPARENCY")
+    @editableInPropertyPage("Alpha Testing", PropertyTypeForEdition.Boolean, "TRANSPARENCY", { "notifiers": { "rebuild": false }})
     public useAlphaTest: boolean = false;
     public useAlphaTest: boolean = false;
 
 
-    @editableInPropertyPage("Alpha CutOff", PropertyTypeForEdition.Float, "TRANSPARENCY", { min: 0, max: 1})
+    @editableInPropertyPage("Alpha CutOff", PropertyTypeForEdition.Float, "TRANSPARENCY", { min: 0, max: 1, "notifiers": { "rebuild": false }})
     public alphaTestCutoff: number = 0.4;
     public alphaTestCutoff: number = 0.4;
 
 
-    @editableInPropertyPage("Alpha blending", PropertyTypeForEdition.Boolean, "TRANSPARENCY")
+    @editableInPropertyPage("Alpha blending", PropertyTypeForEdition.Boolean, "TRANSPARENCY", { "notifiers": { "rebuild": false }})
     public useAlphaBlending: boolean = false;
     public useAlphaBlending: boolean = false;
 
 
-    @editableInPropertyPage("Get alpha from opacity texture RGB", PropertyTypeForEdition.Boolean, "TRANSPARENCY")
+    @editableInPropertyPage("Get alpha from opacity texture RGB", PropertyTypeForEdition.Boolean, "TRANSPARENCY", { "notifiers": { "rebuild": false }})
     public opacityRGB: boolean = false;
     public opacityRGB: boolean = false;
 
 
-    @editableInPropertyPage("Radiance over alpha", PropertyTypeForEdition.Boolean, "RENDERING")
+    @editableInPropertyPage("Radiance over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { "notifiers": { "rebuild": false }})
     public useRadianceOverAlpha: boolean = true;
     public useRadianceOverAlpha: boolean = true;
 
 
-    @editableInPropertyPage("Specular over alpha", PropertyTypeForEdition.Boolean, "RENDERING")
+    @editableInPropertyPage("Specular over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { "notifiers": { "rebuild": false }})
     public useSpecularOverAlpha: boolean = true;
     public useSpecularOverAlpha: boolean = true;
 
 
-    @editableInPropertyPage("Specular anti-aliasing", PropertyTypeForEdition.Boolean, "RENDERING")
+    @editableInPropertyPage("Specular anti-aliasing", PropertyTypeForEdition.Boolean, "RENDERING", { "notifiers": { "rebuild": false }})
     public enableSpecularAntiAliasing: boolean = false;
     public enableSpecularAntiAliasing: boolean = false;
 
 
-    @editableInPropertyPage("Energy Conservation", PropertyTypeForEdition.Boolean, "ADVANCED")
+    @editableInPropertyPage("Energy Conservation", PropertyTypeForEdition.Boolean, "ADVANCED", { "notifiers": { "rebuild": false }})
     public useEnergyConservation: boolean = true;
     public useEnergyConservation: boolean = true;
 
 
-    @editableInPropertyPage("Spherical Harmonics", PropertyTypeForEdition.Boolean, "ADVANCED")
-    public useSphericalHarmonics: boolean = true;
-
-    @editableInPropertyPage("Radiance occlusion", PropertyTypeForEdition.Boolean, "ADVANCED")
+    @editableInPropertyPage("Radiance occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { "notifiers": { "rebuild": false }})
     public useRadianceOcclusion: boolean = true;
     public useRadianceOcclusion: boolean = true;
 
 
-    @editableInPropertyPage("Horizon occlusion", PropertyTypeForEdition.Boolean, "ADVANCED")
+    @editableInPropertyPage("Horizon occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { "notifiers": { "rebuild": false }})
     public useHorizonOcclusion: boolean = true;
     public useHorizonOcclusion: boolean = true;
 
 
-    @editableInPropertyPage("Unlit", PropertyTypeForEdition.Boolean, "ADVANCED")
+    @editableInPropertyPage("Unlit", PropertyTypeForEdition.Boolean, "ADVANCED", { "notifiers": { "rebuild": false }})
     public unlit: boolean = false;
     public unlit: boolean = false;
 
 
     /**
     /**

+ 5 - 5
src/Materials/Node/Blocks/Fragment/PBR/reflectivityBlock.ts

@@ -11,19 +11,19 @@ import { NodeMaterialConnectionPoint, NodeMaterialConnectionPointDirection } fro
 
 
 export class ReflectivityBlock extends NodeMaterialBlock {
 export class ReflectivityBlock extends NodeMaterialBlock {
 
 
-    @editableInPropertyPage("AO from red channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW")
+    @editableInPropertyPage("AO from red channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW", { "notifiers": { "rebuild": false }})
     public useAmbientOcclusionFromMetallicTextureRed: boolean = false;
     public useAmbientOcclusionFromMetallicTextureRed: boolean = false;
 
 
-    @editableInPropertyPage("Metallness from blue channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW")
+    @editableInPropertyPage("Metallness from blue channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW", { "notifiers": { "rebuild": false }})
     public useMetallnessFromMetallicTextureBlue: boolean = true;
     public useMetallnessFromMetallicTextureBlue: boolean = true;
 
 
-    @editableInPropertyPage("Roughness from alpha channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW")
+    @editableInPropertyPage("Roughness from alpha channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW", { "notifiers": { "rebuild": false }})
     public useRoughnessFromMetallicTextureAlpha: boolean = false;
     public useRoughnessFromMetallicTextureAlpha: boolean = false;
 
 
-    @editableInPropertyPage("Roughness from green channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW")
+    @editableInPropertyPage("Roughness from green channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW", { "notifiers": { "rebuild": false }})
     public useRoughnessFromMetallicTextureGreen: boolean = true;
     public useRoughnessFromMetallicTextureGreen: boolean = true;
 
 
-    @editableInPropertyPage("Metallic F0 from alpha channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW")
+    @editableInPropertyPage("Metallic F0 from alpha channel", PropertyTypeForEdition.Boolean, "METALLIC WORKFLOW", { "notifiers": { "rebuild": false }})
     public useMetallicF0FactorFromMetallicTexture: boolean = false;
     public useMetallicF0FactorFromMetallicTexture: boolean = false;
 
 
     /**
     /**