Prechádzať zdrojové kódy

Add metallic debug flag

sebavan 6 rokov pred
rodič
commit
6f95880248

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

@@ -99,23 +99,24 @@ export class PBRMaterialPropertyGridComponent extends React.Component<IPBRMateri
             // Lighting Params
             { label: "Surface Albedo", value: 60 },
             { label: "Reflectance 0", value: 61 },
-            { label: "Roughness", value: 62 },
-            { label: "AlphaG", value: 63 },
-            { label: "NdotV", value: 64 },
-            { label: "ClearCoat Color", value: 65 },
-            { label: "ClearCoat Roughness", value: 66 },
-            { label: "ClearCoat NdotV", value: 67 },
-            { label: "Transmittance", value: 68 },
-            { label: "Refraction Transmittance", value: 69 },
+            { label: "Metallic", value: 62 },
+            { label: "Roughness", value: 63 },
+            { label: "AlphaG", value: 64 },
+            { label: "NdotV", value: 65 },
+            { label: "ClearCoat Color", value: 66 },
+            { label: "ClearCoat Roughness", value: 67 },
+            { label: "ClearCoat NdotV", value: 68 },
+            { label: "Transmittance", value: 69 },
+            { label: "Refraction Transmittance", value: 70 },
             // Misc
-            { label: "SEO", value: 70 },
-            { label: "EHO", value: 71 },
-            { label: "Energy Factor", value: 72 },
-            { label: "Specular Reflectance", value: 73 },
-            { label: "Clear Coat Reflectance", value: 74 },
-            { label: "Sheen Reflectance", value: 75 },
-            { label: "Luminance Over Alpha", value: 76 },
-            { label: "Alpha", value: 77 },
+            { label: "SEO", value: 80 },
+            { label: "EHO", value: 81 },
+            { label: "Energy Factor", value: 82 },
+            { label: "Specular Reflectance", value: 83 },
+            { label: "Clear Coat Reflectance", value: 84 },
+            { label: "Sheen Reflectance", value: 85 },
+            { label: "Luminance Over Alpha", value: 86 },
+            { label: "Alpha", value: 87 },
         ];
 
         return (

+ 18 - 16
src/Shaders/ShadersInclude/pbrDebug.fx

@@ -108,42 +108,44 @@
     #elif DEBUGMODE == 61
         gl_FragColor.rgb = specularEnvironmentR0;
         #define DEBUGMODE_GAMMA
-    #elif DEBUGMODE == 62
-        gl_FragColor.rgb = vec3(roughness);
+    #elif DEBUGMODE == 62 && defined(METALLICWORKFLOW)
+        gl_FragColor.rgb = vec3(metallicRoughness.r);
     #elif DEBUGMODE == 63
-        gl_FragColor.rgb = vec3(alphaG);
+        gl_FragColor.rgb = vec3(roughness);
     #elif DEBUGMODE == 64
+        gl_FragColor.rgb = vec3(alphaG);
+    #elif DEBUGMODE == 65
         gl_FragColor.rgb = vec3(NdotV);
-    #elif DEBUGMODE == 65 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
+    #elif DEBUGMODE == 66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
         gl_FragColor.rgb = clearCoatColor.rgb;
         #define DEBUGMODE_GAMMA
-    #elif DEBUGMODE == 66 && defined(CLEARCOAT)
-        gl_FragColor.rgb = vec3(clearCoatRoughness);
     #elif DEBUGMODE == 67 && defined(CLEARCOAT)
+        gl_FragColor.rgb = vec3(clearCoatRoughness);
+    #elif DEBUGMODE == 68 && defined(CLEARCOAT)
         gl_FragColor.rgb = vec3(clearCoatNdotV);
-    #elif DEBUGMODE == 68 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
+    #elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
         gl_FragColor.rgb = transmittance;
-    #elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_REFRACTION)
+    #elif DEBUGMODE == 70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
         gl_FragColor.rgb = refractionTransmittance;
 // Misc
-    #elif DEBUGMODE == 70 && defined(RADIANCEOCCLUSION)
+    #elif DEBUGMODE == 80 && defined(RADIANCEOCCLUSION)
         gl_FragColor.rgb = vec3(seo);
-    #elif DEBUGMODE == 71 && defined(HORIZONOCCLUSION)
+    #elif DEBUGMODE == 81 && defined(HORIZONOCCLUSION)
         gl_FragColor.rgb = vec3(eho);
-    #elif DEBUGMODE == 72 && defined(MS_BRDF_ENERGY_CONSERVATION)
+    #elif DEBUGMODE == 82 && defined(MS_BRDF_ENERGY_CONSERVATION)
         gl_FragColor.rgb = vec3(energyConservationFactor);
-    #elif DEBUGMODE == 73 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
+    #elif DEBUGMODE == 83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
         gl_FragColor.rgb = specularEnvironmentReflectance;
         #define DEBUGMODE_GAMMA
-    #elif DEBUGMODE == 74 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
+    #elif DEBUGMODE == 84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
         gl_FragColor.rgb = clearCoatEnvironmentReflectance;
         #define DEBUGMODE_GAMMA
-    #elif DEBUGMODE == 75 && defined(SHEEN) && defined(REFLECTION)
+    #elif DEBUGMODE == 85 && defined(SHEEN) && defined(REFLECTION)
         gl_FragColor.rgb = sheenEnvironmentReflectance;
         #define DEBUGMODE_GAMMA
-    #elif DEBUGMODE == 76 && defined(ALPHABLEND)
+    #elif DEBUGMODE == 86 && defined(ALPHABLEND)
         gl_FragColor.rgb = vec3(luminanceOverAlpha);
-    #elif DEBUGMODE == 77
+    #elif DEBUGMODE == 87
         gl_FragColor.rgb = vec3(alpha);
     #endif