Bläddra i källkod

matinfo.b is smoothness, and matinfo.a metalness fr the gbuffer.

Azaezel 7 år sedan
förälder
incheckning
f5bab3f574

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl

@@ -256,8 +256,8 @@ void main()
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    float disDiff = Fr_DisneyDiffuse(dotNVa, dotNLa, dotLHa, roughness);

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl

@@ -194,8 +194,8 @@ void main()
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    float disDiff = Fr_DisneyDiffuse(dotNVa, dotNLa, dotLHa, roughness);

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl

@@ -294,8 +294,8 @@ void main()
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    //float dotNL = clamp(dot(normal,l), 0.0, 1.0);

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl

@@ -268,8 +268,8 @@ PS_OUTPUT main(ConvexConnectP IN)
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    float disDiff = Fr_DisneyDiffuse(dotNVa, dotNLa, dotLHa, roughness);

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/spotLightP.hlsl

@@ -198,8 +198,8 @@ PS_OUTPUT main(   ConvexConnectP IN )
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    float disDiff = Fr_DisneyDiffuse(dotNVa, dotNLa, dotLHa, roughness);

+ 2 - 2
Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl

@@ -305,8 +305,8 @@ PS_OUTPUT main(FarFrustumQuadConnectP IN)
    float dotHVa = clamp(dot(normal, v), 0.0, 1.0);
    float dotLHa = clamp(dot(l, h), 0.0, 1.0);
 
-   float roughness = matInfo.g;
-   float metalness = matInfo.b;
+   float roughness = 1.0001-matInfo.b;
+   float metalness = matInfo.a;
 
    //diffuse
    //float dotNL = clamp(dot(normal,l), 0.0, 1.0);