Przeglądaj źródła

custom defines for pbr roughness and microsurface

lockphase 6 lat temu
rodzic
commit
7bfd1f8041

+ 6 - 6
materialsLibrary/src/custom/pbrCustomMaterial.ts

@@ -18,9 +18,9 @@ export class ShaderAlebdoParts {
     public Fragment_Custom_Albedo: string;
     // lights
     public Fragment_Before_Lights: string;
-	// roughness
+    // roughness
     public Fragment_Custom_MetallicRoughness: string;
-	// microsurface
+    // microsurface
     public Fragment_Custom_MicroSurface: string;
     // fog
     public Fragment_Before_Fog: string;
@@ -139,8 +139,8 @@ export class PBRCustomMaterial extends PBRMaterial {
             .replace('#define CUSTOM_FRAGMENT_UPDATE_ALBEDO', (this.CustomParts.Fragment_Custom_Albedo ? this.CustomParts.Fragment_Custom_Albedo : ""))
             .replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : ""))
             .replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : ""))
-			.replace('#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS', (this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : ""))
-			.replace('#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE', (this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : ""))
+            .replace('#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS', (this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : ""))
+            .replace('#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE', (this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : ""))
             .replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', (this.CustomParts.Fragment_Before_Fog ? this.CustomParts.Fragment_Before_Fog : ""))
             .replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : ""));
 
@@ -210,12 +210,12 @@ export class PBRCustomMaterial extends PBRMaterial {
         return this;
     }
 	
-	public Fragment_Custom_MetallicRoughness(shaderPart: string): PBRCustomMaterial {
+    public Fragment_Custom_MetallicRoughness(shaderPart: string): PBRCustomMaterial {
         this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart;
         return this;
     }
 	
-	public Fragment_Custom_MicroSurface(shaderPart: string): PBRCustomMaterial {
+    public Fragment_Custom_MicroSurface(shaderPart: string): PBRCustomMaterial {
         this.CustomParts.Fragment_Custom_MicroSurface = shaderPart;
         return this;
     }

+ 2 - 2
src/Shaders/pbr.fragment.fx

@@ -191,7 +191,7 @@ void main(void) {
             metallicRoughness.g *= microSurfaceTexel.r;
         #endif
 
-		#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
+        #define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
 		
         // Compute microsurface from roughness.
         microSurface = 1.0 - metallicRoughness.g;
@@ -242,7 +242,7 @@ void main(void) {
                     microSurface *= microSurfaceTexel.r;
                 #endif
 				
-				#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
+                #define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
 				
             #endif
         #endif