浏览代码

Fix Serialized member with _

sebavan 6 年之前
父节点
当前提交
93a37887f1

+ 2 - 2
src/Materials/PBR/pbrAnisotropicConfiguration.ts

@@ -29,11 +29,11 @@ export interface IMaterialAnisotropicDefines {
  */
 export class PBRAnisotropicConfiguration {
 
-    @serialize()
     private _isEnabled = false;
     /**
      * Defines if the anisotropy is enabled in the material.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isEnabled = false;
 
@@ -50,13 +50,13 @@ export class PBRAnisotropicConfiguration {
     @serializeAsVector2()
     public direction = new Vector2(1, 0);
 
-    @serializeAsTexture()
     private _texture: Nullable<BaseTexture> = null;
     /**
      * Stores the anisotropy values in a texture.
      * rg is direction (like normal from -1 to 1)
      * b is a intensity
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public texture: Nullable<BaseTexture> = null;
 

+ 3 - 3
src/Materials/PBR/pbrBRDFConfiguration.ts

@@ -37,15 +37,14 @@ export class PBRBRDFConfiguration {
      */
     public static DEFAULT_USE_SPHERICAL_HARMONICS = true;
 
-    @serialize()
     private _useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;
     /**
      * Defines if the material uses energy conservation.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsMiscDirty")
     public useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;
 
-    @serialize()
     private _useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;
     /**
      * LEGACY Mode set to false
@@ -55,10 +54,10 @@ export class PBRBRDFConfiguration {
      * or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision
      * Not relying on height correlated will also disable energy conservation.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsMiscDirty")
     public useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;
 
-    @serialize()
     private _useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;
     /**
      * LEGACY Mode set to false
@@ -67,6 +66,7 @@ export class PBRBRDFConfiguration {
      * The harmonics despite a tiny bigger cost has been proven to provide closer results
      * to the ground truth.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsMiscDirty")
     public useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;
 

+ 6 - 6
src/Materials/PBR/pbrClearCoatConfiguration.ts

@@ -40,11 +40,11 @@ export class PBRClearCoatConfiguration {
      */
     private static readonly _DefaultIndexOfRefraction = 1.5;
 
-    @serialize()
     private _isEnabled = false;
     /**
      * Defines if the clear coat is enabled in the material.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isEnabled = false;
 
@@ -60,7 +60,6 @@ export class PBRClearCoatConfiguration {
     @serialize()
     public roughness: number = 0;
 
-    @serialize()
     private _indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
     /**
      * Defines the index of refraction of the clear coat.
@@ -68,30 +67,31 @@ export class PBRClearCoatConfiguration {
      * The default fits with a polyurethane material.
      * Changing the default value is more performance intensive.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
 
-    @serializeAsTexture()
     private _texture: Nullable<BaseTexture> = null;
     /**
      * Stores the clear coat values in a texture.
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public texture: Nullable<BaseTexture> = null;
 
-    @serializeAsTexture()
     private _bumpTexture: Nullable<BaseTexture> = null;
     /**
      * Define the clear coat specific bump texture.
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public bumpTexture: Nullable<BaseTexture> = null;
 
-    @serialize()
     private _isTintEnabled = false;
     /**
      * Defines if the clear coat tint is enabled in the material.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isTintEnabled = false;
 
@@ -117,13 +117,13 @@ export class PBRClearCoatConfiguration {
     @serialize()
     public tintThickness: number = 1;
 
-    @serializeAsTexture()
     private _tintTexture: Nullable<BaseTexture> = null;
     /**
      * Stores the clear tint values in a texture.
      * rgb is tint
      * a is a thickness factor
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public tintTexture: Nullable<BaseTexture> = null;
 

+ 3 - 3
src/Materials/PBR/pbrSheenConfiguration.ts

@@ -27,19 +27,19 @@ export interface IMaterialSheenDefines {
  */
 export class PBRSheenConfiguration {
 
-    @serialize()
     private _isEnabled = false;
     /**
      * Defines if the material uses sheen.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isEnabled = false;
 
-    @serialize()
     private _linkSheenWithAlbedo = false;
     /**
      * Defines if the sheen is linked to the sheen color.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public linkSheenWithAlbedo = false;
 
@@ -55,13 +55,13 @@ export class PBRSheenConfiguration {
     @serializeAsColor3()
     public color = Color3.White();
 
-    @serializeAsTexture()
     private _texture: Nullable<BaseTexture> = null;
     /**
      * Stores the sheen tint values in a texture.
      * rgb is tint
      * a is a intensity
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public texture: Nullable<BaseTexture> = null;
 

+ 5 - 5
src/Materials/PBR/pbrSubSurfaceConfiguration.ts

@@ -44,27 +44,27 @@ export interface IMaterialSubSurfaceDefines {
  * Define the code related to the sub surface parameters of the pbr material.
  */
 export class PBRSubSurfaceConfiguration {
-    @serialize()
     private _isRefractionEnabled = false;
     /**
      * Defines if the refraction is enabled in the material.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isRefractionEnabled = false;
 
-    @serialize()
     private _isTranslucencyEnabled = false;
     /**
      * Defines if the translucency is enabled in the material.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isTranslucencyEnabled = false;
 
-    @serialize()
     private _isScatteringEnabled = false;
     // /**
     //  * Defines if the sub surface scattering is enabled in the material.
     //  */
+    // @serialize()
     // @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     // public isScatteringEnabled = false;
 
@@ -92,7 +92,6 @@ export class PBRSubSurfaceConfiguration {
     @serialize()
     public scatteringIntensity: number = 1;
 
-    @serializeAsTexture()
     private _thicknessTexture: Nullable<BaseTexture> = null;
     /**
      * Stores the average thickness of a mesh in a texture (The texture is holding the values linearly).
@@ -101,6 +100,7 @@ export class PBRSubSurfaceConfiguration {
      * 1 would mean maximumThickness
      * The other channels might be use as a mask to vary the different effects intensity.
      */
+    @serializeAsTexture()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public thicknessTexture: Nullable<BaseTexture> = null;
 
@@ -172,7 +172,6 @@ export class PBRSubSurfaceConfiguration {
     @serializeAsColor3()
     public diffusionDistance = Color3.White();
 
-    @serialize()
     private _useMaskFromThicknessTexture = false;
     /**
      * Stores the intensity of the different subsurface effects in the thickness texture.
@@ -180,6 +179,7 @@ export class PBRSubSurfaceConfiguration {
      * * the blue channel is the scattering intensity.
      * * the alpha channel is the refraction intensity.
      */
+    @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public useMaskFromThicknessTexture: boolean = false;