Browse Source

Fix after shader code refactoring

Popov72 5 years ago
parent
commit
aafea21b64
1 changed files with 4 additions and 0 deletions
  1. 4 0
      materialsLibrary/src/custom/pbrCustomMaterial.ts

+ 4 - 0
materialsLibrary/src/custom/pbrCustomMaterial.ts

@@ -173,6 +173,10 @@ export class PBRCustomMaterial extends PBRMaterial {
 
 
         this.FragmentShader = Effect.ShadersStore["pbrPixelShader"];
         this.FragmentShader = Effect.ShadersStore["pbrPixelShader"];
         this.VertexShader = Effect.ShadersStore["pbrVertexShader"];
         this.VertexShader = Effect.ShadersStore["pbrVertexShader"];
+
+        this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g, Effect.IncludesShadersStore["pbrBlockAlbedoOpacity"]);
+        this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockReflectivity>/g, Effect.IncludesShadersStore["pbrBlockReflectivity"]);
+        this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g, Effect.IncludesShadersStore["pbrBlockFinalColorComposition"]);
     }
     }
 
 
     public AddUniform(name: string, kind: string, param: any): PBRCustomMaterial {
     public AddUniform(name: string, kind: string, param: any): PBRCustomMaterial {