From 8d2d357948b77c5bd478aac8f7c288a9efd69adb Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 5 May 2019 20:09:35 -0500 Subject: [PATCH] invert surface.NdotV contribution for brdf texture lookup in keeping with authoring tool outputs --- Templates/Full/game/shaders/common/lighting.hlsl | 2 +- .../shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/Full/game/shaders/common/lighting.hlsl b/Templates/Full/game/shaders/common/lighting.hlsl index 7cfd1d36b..03dd662cd 100644 --- a/Templates/Full/game/shaders/common/lighting.hlsl +++ b/Templates/Full/game/shaders/common/lighting.hlsl @@ -398,7 +398,7 @@ float4 computeForwardProbes(Surface surface, //apply brdf //Do it once to save on texture samples - float2 brdf = TORQUE_TEX2DLOD(BRDFTexture,float4(surface.roughness, surface.NdotV, 0.0, 0.0)).xy; + float2 brdf = TORQUE_TEX2DLOD(BRDFTexture,float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy; specular *= brdf.x * F + brdf.y; //final diffuse color diff --git a/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl index 12c4fcef5..ea2ca7641 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl @@ -191,7 +191,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET //apply brdf //Do it once to save on texture samples - float2 brdf = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.roughness, surface.NdotV, 0.0, 0.0)).xy; + float2 brdf = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy; specular *= brdf.x * F + brdf.y; //final diffuse color