Browse Source

Rename indice to index of refraction

sebavan 6 years ago
parent
commit
35d42c07b3

+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/materials/pbrMaterialPropertyGridComponent.tsx

@@ -139,7 +139,7 @@ export class PBRMaterialPropertyGridComponent extends React.Component<IPBRMateri
                         <div className="fragment">
                             <SliderLineComponent label="Intensity" target={material.clearCoat} propertyName="intensity" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                             <SliderLineComponent label="Roughness" target={material.clearCoat} propertyName="roughness" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
-                            <SliderLineComponent label="IOR" target={material.clearCoat} propertyName="indiceOfRefraction" minimum={1.0} maximum={3} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                            <SliderLineComponent label="IOR" target={material.clearCoat} propertyName="indexOfRefraction" minimum={1.0} maximum={3} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                             <TextureLinkLineComponent label="Texture" texture={material.clearCoat.texture} material={material} onSelectionChangedObservable={this.props.onSelectionChangedObservable} onDebugSelectionChangeObservable={this._onDebugSelectionChangeObservable} />
                             <TextureLinkLineComponent label="Bump" texture={material.clearCoat.bumpTexture} material={material} onSelectionChangedObservable={this.props.onSelectionChangedObservable} onDebugSelectionChangeObservable={this._onDebugSelectionChangeObservable} />
                             {

+ 1 - 7
materialsLibrary/test/addpbr.js

@@ -120,13 +120,7 @@ window.preparePBR = function() {
 		  "albedoColorLevel": 1
 		});
 	});
-	
-    registerRangeUI("pbr", "indiceOfRefraction", 0, 2, function(value) {
-		pbr.indexOfRefraction = value;
-	}, function() {
-		return pbr.indexOfRefraction;
-	});
-    
+
     registerRangeUI("pbr", "alpha", 0, 1, function(value) {
 		pbr.alpha = value;
 	}, function() {

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

@@ -38,7 +38,7 @@ export class PBRClearCoatConfiguration {
      * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence
      * The default fits with a polyurethane material.
      */
-    private static readonly _DefaultIndiceOfRefraction = 1.5;
+    private static readonly _DefaultIndexOfRefraction = 1.5;
 
     @serialize()
     private _isEnabled = false;
@@ -61,15 +61,15 @@ export class PBRClearCoatConfiguration {
     public roughness: number = 0;
 
     @serialize()
-    private _indiceOfRefraction = PBRClearCoatConfiguration._DefaultIndiceOfRefraction;
+    private _indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
     /**
-     * Defines the indice of refraction of the clear coat.
+     * Defines the index of refraction of the clear coat.
      * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence
      * The default fits with a polyurethane material.
      * Changing the default value is more performance intensive.
      */
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
-    public indiceOfRefraction = PBRClearCoatConfiguration._DefaultIndiceOfRefraction;
+    public indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
 
     @serializeAsTexture()
     private _texture: Nullable<BaseTexture> = null;
@@ -201,7 +201,7 @@ export class PBRClearCoatConfiguration {
                         defines.CLEARCOAT_BUMP = false;
                     }
 
-                    defines.CLEARCOAT_DEFAULTIOR = this._indiceOfRefraction === PBRClearCoatConfiguration._DefaultIndiceOfRefraction;
+                    defines.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === PBRClearCoatConfiguration._DefaultIndexOfRefraction;
 
                     if (this._isTintEnabled) {
                         defines.CLEARCOAT_TINT = true;
@@ -265,10 +265,10 @@ export class PBRClearCoatConfiguration {
             uniformBuffer.updateFloat2("vClearCoatParams", this.intensity, this.roughness);
 
             // Clear Coat Refraction params
-            const a = 1 - this._indiceOfRefraction;
-            const b = 1 + this._indiceOfRefraction;
+            const a = 1 - this._indexOfRefraction;
+            const b = 1 + this._indexOfRefraction;
             const f0 = Math.pow((-a / b), 2); // Schlicks approx: (ior1 - ior2) / (ior1 + ior2) where ior2 for air is close to vacuum = 1.
-            const eta = 1 / this._indiceOfRefraction;
+            const eta = 1 / this._indexOfRefraction;
             uniformBuffer.updateFloat4("vClearCoatRefractionParams", f0, eta, a,  b);
 
             if (this._isTintEnabled) {

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

@@ -114,7 +114,7 @@ export class PBRSubSurfaceConfiguration {
 
     private _indexOfRefraction = 1;
     /**
-     * Defines the indice of refraction used in the material.
+     * Defines the index of refraction used in the material.
      * https://en.wikipedia.org/wiki/List_of_refractive_indices
      */
     @serialize()

+ 1 - 1
src/Materials/standardMaterial.ts

@@ -371,7 +371,7 @@ export class StandardMaterial extends PushMaterial {
     public roughness: number;
 
     /**
-     * In case of refraction, define the value of the indice of refraction.
+     * In case of refraction, define the value of the index of refraction.
      * @see http://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions
      */
     @serialize()