From f5bab3f574e2f69f0eb1aa25dd46ccbe1f81e353 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 16 Oct 2018 22:20:07 -0500 Subject: [PATCH] matinfo.b is smoothness, and matinfo.a metalness fr the gbuffer. --- .../game/shaders/common/lighting/advanced/gl/pointLightP.glsl | 4 ++-- .../game/shaders/common/lighting/advanced/gl/spotLightP.glsl | 4 ++-- .../shaders/common/lighting/advanced/gl/vectorLightP.glsl | 4 ++-- .../game/shaders/common/lighting/advanced/pointLightP.hlsl | 4 ++-- .../game/shaders/common/lighting/advanced/spotLightP.hlsl | 4 ++-- .../game/shaders/common/lighting/advanced/vectorLightP.hlsl | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl index 5dc38c3d1..998501d77 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl +++ b/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); diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl index 6b03b3a94..b46c94049 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl +++ b/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); diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl index 5811d3bbf..e8b909094 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl +++ b/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); diff --git a/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl index 5022b2ec3..6c18d45e1 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl +++ b/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); diff --git a/Templates/Full/game/shaders/common/lighting/advanced/spotLightP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/spotLightP.hlsl index e5a9c0cdc..e30057081 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/spotLightP.hlsl +++ b/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); diff --git a/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl index 18b611f71..8910a48b9 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl +++ b/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);