diff --git a/Engine/source/T3D/lighting/boxEnvironmentProbe.cpp b/Engine/source/T3D/lighting/boxEnvironmentProbe.cpp index a4ad8136d..cf2ed7e15 100644 --- a/Engine/source/T3D/lighting/boxEnvironmentProbe.cpp +++ b/Engine/source/T3D/lighting/boxEnvironmentProbe.cpp @@ -78,7 +78,6 @@ BoxEnvironmentProbe::BoxEnvironmentProbe() : ReflectionProbe() { mCaptureMask = REFLECTION_PROBE_CAPTURE_TYPEMASK; mProbeShapeType = ProbeInfo::Box; - mAtten = 0.0; } BoxEnvironmentProbe::~BoxEnvironmentProbe() diff --git a/Engine/source/T3D/lighting/reflectionProbe.cpp b/Engine/source/T3D/lighting/reflectionProbe.cpp index e5951cea0..d932dfdcb 100644 --- a/Engine/source/T3D/lighting/reflectionProbe.cpp +++ b/Engine/source/T3D/lighting/reflectionProbe.cpp @@ -133,6 +133,7 @@ ReflectionProbe::ReflectionProbe() mCaptureMask = REFLECTION_PROBE_CAPTURE_TYPEMASK; mCanDamp = false; + mAtten = 0.0f; } ReflectionProbe::~ReflectionProbe() diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl index 68f34f1ec..f9b3d272b 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl @@ -349,7 +349,7 @@ vec4 compute4Lights( Surface surface, } //Probe IBL stuff -float defineSphereSpaceInfluence(vec3 wsPosition, vec3 wsProbePosition, float radius) +float defineSphereSpaceInfluence(vec3 wsPosition, vec3 wsProbePosition, float radius, float atten) { float3 L = (wsProbePosition.xyz - wsPosition); float innerRadius = radius-(radius*atten); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl index c3cc37863..b7d477ed1 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl @@ -94,7 +94,7 @@ void main() } else if (probeConfigData[i].r == 1) //sphere { - contribution[i] = defineSphereSpaceInfluence(surface.P, probePosArray[i].xyz, probeConfigData[i].g, probeConfigData[i].b*atten); + contribution[i] = defineSphereSpaceInfluence(surface.P, probePosArray[i].xyz, probeConfigData[i].g, probeConfigData[i].b)*atten; } if (contribution[i]>0.0) 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 fdb89a24c..3342c371c 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -87,8 +87,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET contribution[i] = defineBoxSpaceInfluence(surface.P, worldToObjArray[i], probeConfigData[i].b)*atten; } else if (probeConfigData[i].r == 1) //sphere - { - contribution[i] = defineSphereSpaceInfluence(surface.P, probePosArray[i].xyz, probeConfigData[i].g, probeConfigData[i].b*atten); + { + contribution[i] = defineSphereSpaceInfluence(surface.P, probePosArray[i].xyz, probeConfigData[i].g, probeConfigData[i].b)*atten; } if (contribution[i]>0.0)