sebavan 5 years ago
parent
commit
e57c12e215

+ 3 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts

@@ -2,7 +2,7 @@ import { Nullable } from "babylonjs/types";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 
-import { IMaterial } from "../glTFLoaderInterfaces";
+import { IMaterial, ITextureInfo } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
 import { GLTFLoader } from "../glTFLoader";
 
@@ -10,6 +10,7 @@ const NAME = "KHR_materials_specular";
 
 interface IKHR_materials_specular {
     specularFactor: number;
+    specularTexture: ITextureInfo;
 }
 
 /**
@@ -55,7 +56,7 @@ export class KHR_materials_specular implements IGLTFLoaderExtension {
         });
     }
 
-    private _loadSpecularPropertiesAsync(context: string, material: IMaterial, properties: IKHR_materials_clearcoat, babylonMaterial: Material): Promise<void> {
+    private _loadSpecularPropertiesAsync(context: string, material: IMaterial, properties: IKHR_materials_specular, babylonMaterial: Material): Promise<void> {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }

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

@@ -173,7 +173,7 @@ export class PBRMaterial extends PBRBaseMaterial {
      */
     @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
-    protected metallicF0Factor = 0.5;
+    public metallicF0Factor = 0.5;
 
     /**
      * Specifies whether the F0 factor can be fetched from the mettalic texture.
@@ -182,7 +182,7 @@ export class PBRMaterial extends PBRBaseMaterial {
      */
     @serialize()
     @expandToProperty("_markAllSubMeshesAsTexturesDirty")
-    protected useMetallicF0FactorFromMetallicTexture = false;
+    public useMetallicF0FactorFromMetallicTexture = false;
 
     /**
      * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.