diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 4f32e5404..a6c835b0a 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -639,8 +639,8 @@ void RenderProbeMgr::_update4ProbeConsts(const SceneData &sgData, probeWorldToObjArray[effectiveProbeCount] = curEntry.getTransform(); Point3F refPos = curEntry.getPosition() + curEntry.mProbeRefOffset; - Point3F refBoxMin = refPos - curEntry.mProbeRefScale * curEntry.getTransform().getScale(); - Point3F refBoxMax = refPos + curEntry.mProbeRefScale * curEntry.getTransform().getScale(); + Point3F refBoxMin = refPos - curEntry.mProbeRefScale/2 * curEntry.getTransform().getScale(); + Point3F refBoxMax = refPos + curEntry.mProbeRefScale/2 * curEntry.getTransform().getScale(); refBoxMinArray[mEffectiveProbeCount] = Point4F(refBoxMin.x, refBoxMin.y, refBoxMin.z, 0); refBoxMaxArray[mEffectiveProbeCount] = Point4F(refBoxMax.x, refBoxMax.y, refBoxMax.z, 0); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index e907401b9..91304c95d 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -385,11 +385,8 @@ float4 computeForwardProbes(Surface surface, { blendFactor[i] *= invBlendSumWeighted; contribution[i] *= blendFactor[i]; - alpha -= contribution[i]; } } - else - alpha -= blendSum; #if DEBUGVIZ_ATTENUATION == 1 float contribAlpha = 1; @@ -432,7 +429,7 @@ float4 computeForwardProbes(Surface surface, for (i = 0; i < numProbes; ++i) { float contrib = contribution[i]; - if (contrib != 0) + if (contrib > 0.0f) { int cubemapIdx = probeConfigData[i].a; float3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxMinArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz); 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 b95bba4c0..589b99624 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -61,8 +61,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET //Set up our struct data float contribution[MAX_PROBES]; - //if (alpha > 0) - //{ + if (alpha > 0) + { //Process prooooobes for (i = 0; i < numProbes; ++i) { @@ -113,11 +113,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET { blendFactor[i] *= invBlendSumWeighted; contribution[i] *= blendFactor[i]; - alpha -= contribution[i]; } } - else - alpha -= blendSum; #if DEBUGVIZ_ATTENUATION == 1 float contribAlpha = 1; @@ -144,7 +141,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET return float4(finalContribColor, 1); #endif - //} + } #endif float3 irradiance = float3(0, 0, 0); @@ -158,11 +155,10 @@ float4 main(PFXVertToPix IN) : SV_TARGET #endif #if SKYLIGHT_ONLY == 0 - alpha = 1; for (i = 0; i < numProbes; ++i) { float contrib = contribution[i]; - if (contrib != 0) + if (contrib > 0.0f) { int cubemapIdx = probeConfigData[i].a; float3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxMinArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz);