From fab6b6d7c6c1bf03c77ca8c6c41764b97d8217e1 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 5 Jul 2019 22:01:03 -0500 Subject: [PATCH] blend, don't add skylight, and take shadowmask into account for compute4lights. --- .../BaseGame/game/core/rendering/shaders/lighting.hlsl | 6 +++--- .../shaders/lighting/advanced/reflectionProbeArrayP.hlsl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index c3bdf34f8..e907401b9 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -278,9 +278,9 @@ float4 compute4Lights( Surface surface, lighting *= getSpotAngleAtt(-surfaceToLight.L, inLightSpotDir[i].xyz, lightSpotParams[i].xy ); } } - finalLighting += lighting; } + finalLighting *= shadowMask.rgb; return float4(finalLighting,1); } @@ -445,8 +445,8 @@ float4 computeForwardProbes(Surface surface, if(skylightCubemapIdx != -1 && alpha >= 0.001) { - irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz * alpha; - specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz * alpha; + irradiance = lerp(irradiance,TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz,alpha); + specular = lerp(specular,TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz,alpha); } float3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl index 4671ba93f..b95bba4c0 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -176,8 +176,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET if(skylightCubemapIdx != -1 && alpha >= 0.001) { - irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz * alpha; - specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz * alpha; + irradiance = lerp(irradiance,TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz,alpha); + specular = lerp(specular,TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz,alpha); } #if DEBUGVIZ_SPECCUBEMAP == 1 && DEBUGVIZ_DIFFCUBEMAP == 0