From 861da2ba2de38199f8cb62dcff5fa4e58ce70b66 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Wed, 17 Oct 2018 21:34:09 -0500 Subject: [PATCH] take ambient occlusion into account for probe and skylight projections as well, given they are litterally an ambient source --- .../shaders/common/lighting/advanced/gl/reflectionProbeP.glsl | 3 +++ .../game/shaders/common/lighting/advanced/gl/skylightP.glsl | 2 ++ .../shaders/common/lighting/advanced/reflectionProbeP.hlsl | 3 ++- .../Full/game/shaders/common/lighting/advanced/skylightP.hlsl | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeP.glsl index 3df23a747..fda00f328 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeP.glsl @@ -210,4 +210,7 @@ void main() vec3 surfToEye = normalize(worldPos.xyz-eyePosWorld.xyz); OUT_col = vec4(iblBoxDiffuse(wsNormal, worldPos, irradianceCubemap, probeWSPos, bbMin, bbMax), blendVal); OUT_col1 = vec4(iblBoxSpecular(wsNormal, worldPos, 1.0 - matInfo.b, surfToEye, BRDFTexture, cubeMap, probeWSPos, bbMin, bbMax), blendVal); + + OUT_col *= matInfo.g; + OUT_col1 *= matInfo.g; } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/skylightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/skylightP.glsl index e79e4490e..58c14364d 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/skylightP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/skylightP.glsl @@ -82,4 +82,6 @@ void main() OUT_col = vec4(irradiance.rgb, 1); OUT_col1 = vec4(specular.rgb, 1); + OUT_col *= matInfo.g; + OUT_col1 *= matInfo.g; } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl index 9e4a2e611..92b7a8f1c 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl @@ -207,6 +207,7 @@ PS_OUTPUT main( ConvexConnectP IN ) float3 surfToEye = normalize(worldPos.xyz-eyePosWorld.xyz); Output.diffuse = float4(iblBoxDiffuse(wsNormal, worldPos, TORQUE_SAMPLERCUBE_MAKEARG(irradianceCubemap), probeWSPos, bbMin, bbMax), blendVal); Output.spec = float4(iblBoxSpecular(wsNormal, worldPos, 1.0 - matInfo.b, surfToEye, TORQUE_SAMPLER2D_MAKEARG(BRDFTexture), TORQUE_SAMPLERCUBE_MAKEARG(cubeMap), probeWSPos, bbMin, bbMax), blendVal); - + Output.diffuse *= matInfo.g; + Output.spec *= matInfo.g; return Output; } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/skylightP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/skylightP.hlsl index bf78c2815..5ed0b3449 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/skylightP.hlsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/skylightP.hlsl @@ -139,7 +139,8 @@ PS_OUTPUT main( ConvexConnectP IN ) Output.diffuse = float4(irradiance.rgb, 1); Output.spec = float4(specular.rgb, 1); - + Output.diffuse *= matInfo.g; + Output.spec *= matInfo.g; return Output; }