From fa41ea3e168c5843e112fd8d9095a5da2eef46b4 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 29 Nov 2018 17:30:51 -0600 Subject: [PATCH] puts a form of ssao back. as this is intended to replicate shadows, bolted that to the shadow portion of the calc. as it was previously addative, did so in an addative manner. --- .../shaders/common/lighting/advanced/vectorLightP.hlsl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl b/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl index c141f9d5d..8ebe65e6a 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/vectorLightP.hlsl @@ -234,9 +234,14 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET #endif #endif //NO_SHADOW + float3 ao = float3(1,1,1); + // Sample the AO texture. + #ifdef USE_SSAO_MASK + ao = 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams3 ) ).r; + #endif //get directional light contribution - float3 lighting = getDirectionalLight(surface, surfaceToLight, lightingColor.rgb, lightBrightness, shadow); + float3 lighting = getDirectionalLight(surface, surfaceToLight, lightingColor.rgb, lightBrightness, shadow+ao); return float4(lighting, 0); }