diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 94b457c75..fded366a1 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2960,9 +2960,9 @@ void ReflectionProbeFeatGLSL::processPix(Vector& componentList MultiLine * meta = new MultiLine; // Now the wsPosition and wsView. - Var *wsPosition = getInWsPosition(componentList); Var *worldToTangent = getInWorldToTangent(componentList); Var *wsNormal = getInWorldNormal(componentList); + Var *wsPosition = getInWsPosition(componentList); Var *wsView = getWsView(wsPosition, meta); //Reflection Probe WIP @@ -3038,7 +3038,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector& componentList eyePos->setType("vec3"); eyePos->setName("eyePosWorld"); eyePos->uniform = true; - eyePos->constSortPos = cspPotentialPrimitive; + eyePos->constSortPos = cspPass; } Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl index 57ee38190..11d9a3047 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl @@ -462,7 +462,7 @@ vec4 computeForwardProbes(Surface surface, float contrib = contribution[i]; if (contrib > 0.0f) { - float cubemapIdx = int(inProbeConfigData[i].a); + int cubemapIdx = int(inProbeConfigData[i].a); vec3 dir = boxProject(surface.P, surface.R, inWorldToObjArray[i], inRefScaleArray[i].xyz, inRefPosArray[i].xyz); irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib; 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 e7fa0e2f8..736a5491d 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 @@ -157,7 +157,7 @@ void main() float contrib = contribution[i]; if (contrib > 0.0f) { - float cubemapIdx = probeConfigData[i].a; + int cubemapIdx = int(probeConfigData[i].a); vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refScaleArray[i].xyz, refPosArray[i].xyz); irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;