Browse Source

Complied connect var data in GL to D3D for the wsPosition
Made the use of ints for the cubemapIdx in the shaders consistent

JeffR 3 years ago
parent
commit
c1a88ec423

+ 2 - 2
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -2960,9 +2960,9 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    MultiLine * meta = new MultiLine;
    MultiLine * meta = new MultiLine;
 
 
    // Now the wsPosition and wsView.
    // Now the wsPosition and wsView.
-   Var *wsPosition = getInWsPosition(componentList);
    Var *worldToTangent = getInWorldToTangent(componentList);
    Var *worldToTangent = getInWorldToTangent(componentList);
    Var *wsNormal = getInWorldNormal(componentList);
    Var *wsNormal = getInWorldNormal(componentList);
+   Var *wsPosition = getInWsPosition(componentList);
    Var *wsView = getWsView(wsPosition, meta);
    Var *wsView = getWsView(wsPosition, meta);
    
    
    //Reflection Probe WIP
    //Reflection Probe WIP
@@ -3038,7 +3038,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
       eyePos->setType("vec3");
       eyePos->setType("vec3");
       eyePos->setName("eyePosWorld");
       eyePos->setName("eyePosWorld");
       eyePos->uniform = true;
       eyePos->uniform = true;
-      eyePos->constSortPos = cspPotentialPrimitive;
+      eyePos->constSortPos = cspPass;
    }
    }
 
 
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl

@@ -462,7 +462,7 @@ vec4 computeForwardProbes(Surface surface,
       float contrib = contribution[i];
       float contrib = contribution[i];
       if (contrib > 0.0f)
       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);
          vec3 dir = boxProject(surface.P, surface.R, inWorldToObjArray[i], inRefScaleArray[i].xyz, inRefPosArray[i].xyz);
 
 
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl

@@ -157,7 +157,7 @@ void main()
       float contrib = contribution[i];
       float contrib = contribution[i];
       if (contrib > 0.0f)
       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);
          vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refScaleArray[i].xyz, refPosArray[i].xyz);
 
 
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;