From 4d714091b7e7c88ce9875007325b0a36dfe90a1c Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 28 Jun 2019 10:56:38 -0500 Subject: [PATCH] missed a few conversions --- .../source/renderInstance/renderProbeMgr.cpp | 4 ++-- .../shaderGen/GLSL/shaderFeatureGLSL.cpp | 18 +++++++++--------- .../shaderGen/HLSL/shaderFeatureHLSL.cpp | 18 +++++++++--------- .../game/core/rendering/shaders/lighting.hlsl | 4 +--- .../advanced/reflectionProbeArrayP.hlsl | 4 +--- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 2d0d0626c..a383586ea 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -786,8 +786,8 @@ void RenderProbeMgr::render( SceneRenderState *state ) mProbeArrayEffect->setShaderConst("$inProbePosArray", probePositionsData); mProbeArrayEffect->setShaderConst("$inRefPosArray", probeRefPositionsData); mProbeArrayEffect->setShaderConst("$worldToObjArray", probeWorldToObjData); - mProbeArrayEffect->setShaderConst("$bbMinArray", refBoxMinData); - mProbeArrayEffect->setShaderConst("$bbMaxArray", refBoxMaxData); + mProbeArrayEffect->setShaderConst("$refBoxMinArray", refBoxMinData); + mProbeArrayEffect->setShaderConst("$refBoxMaxArray", refBoxMaxData); mProbeArrayEffect->setShaderConst("$probeConfigData", probeConfigData); // Make sure the effect is gonna render. diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 817e934d1..698538938 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2927,15 +2927,15 @@ void ReflectionProbeFeatGLSL::processPix(Vector& componentList inRefPosArray->uniform = true; inRefPosArray->constSortPos = cspPotentialPrimitive; - Var * bbMinArray = new Var("inRefBoxMin", "vec4"); - bbMinArray->arraySize = MAX_FORWARD_PROBES; - bbMinArray->uniform = true; - bbMinArray->constSortPos = cspPotentialPrimitive; + Var * refBoxMinArray = new Var("inRefBoxMin", "vec4"); + refBoxMinArray->arraySize = MAX_FORWARD_PROBES; + refBoxMinArray->uniform = true; + refBoxMinArray->constSortPos = cspPotentialPrimitive; - Var * bbMaxArray = new Var("inRefBoxMax", "vec4"); - bbMaxArray->arraySize = MAX_FORWARD_PROBES; - bbMaxArray->uniform = true; - bbMaxArray->constSortPos = cspPotentialPrimitive; + Var * refBoxMaxArray = new Var("inRefBoxMax", "vec4"); + refBoxMaxArray->arraySize = MAX_FORWARD_PROBES; + refBoxMaxArray->uniform = true; + refBoxMaxArray->constSortPos = cspPotentialPrimitive; Var * probeConfigData = new Var("probeConfigData", "vec4"); probeConfigData->arraySize = MAX_FORWARD_PROBES; @@ -3043,7 +3043,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector& componentList computeForwardProbes += String("@, @, \r\n\t\t"); computeForwardProbes += String("@,@).rgb; \r\n"); - meta->addStatement(new GenOp(computeForwardProbes.c_str(), albedo, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, bbMinArray, bbMaxArray, inRefPosArray, + meta->addStatement(new GenOp(computeForwardProbes.c_str(), albedo, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refBoxMinArray, refBoxMaxArray, inRefPosArray, hasSkylight, BRDFTexture, skylightIrradMap, skylightSpecularMap, irradianceCubemapAR, specularCubemapAR)); diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index 884dfb9a0..f88f5d8b1 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -3002,15 +3002,15 @@ void ReflectionProbeFeatHLSL::processPix(Vector &componentList inRefPosArray->uniform = true; inRefPosArray->constSortPos = cspPotentialPrimitive; - Var *bbMinArray = new Var("inRefBoxMin", "float4"); - bbMinArray->arraySize = MAX_FORWARD_PROBES; - bbMinArray->uniform = true; - bbMinArray->constSortPos = cspPotentialPrimitive; + Var * refBoxMinArray = new Var("inRefBoxMin", "float4"); + refBoxMinArray->arraySize = MAX_FORWARD_PROBES; + refBoxMinArray->uniform = true; + refBoxMinArray->constSortPos = cspPotentialPrimitive; - Var *bbMaxArray = new Var("inRefBoxMax", "float4"); - bbMaxArray->arraySize = MAX_FORWARD_PROBES; - bbMaxArray->uniform = true; - bbMaxArray->constSortPos = cspPotentialPrimitive; + Var * refBoxMaxArray = new Var("inRefBoxMax", "float4"); + refBoxMaxArray->arraySize = MAX_FORWARD_PROBES; + refBoxMaxArray->uniform = true; + refBoxMaxArray->constSortPos = cspPotentialPrimitive; Var *probeConfigData = new Var("probeConfigData", "float4"); probeConfigData->arraySize = MAX_FORWARD_PROBES; @@ -3112,7 +3112,7 @@ void ReflectionProbeFeatHLSL::processPix(Vector &componentList computeForwardProbes += String::String("@,TORQUE_SAMPLER2D_MAKEARG(@),\r\n\t\t"); computeForwardProbes += String::String("TORQUE_SAMPLERCUBEARRAY_MAKEARG(@),TORQUE_SAMPLERCUBEARRAY_MAKEARG(@)).rgb; \r\n"); - meta->addStatement(new GenOp(computeForwardProbes.c_str(), diffuseColor, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, bbMinArray, bbMaxArray, inRefPosArray, + meta->addStatement(new GenOp(computeForwardProbes.c_str(), diffuseColor, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refBoxMinArray, refBoxMaxArray, inRefPosArray, skylightCubemapIdx, BRDFTexture, irradianceCubemapAR, specularCubemapAR)); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index 369134092..18949ad4f 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -444,8 +444,6 @@ float4 computeForwardProbes(Surface surface, if (contribution[i] > 0.0) probehits++; } - else - continue; contribution[i] = max(contribution[i], 0); @@ -524,7 +522,7 @@ float4 computeForwardProbes(Surface surface, if (contrib != 0) { int cubemapIdx = probeConfigData[i].a; - float3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz); + float3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxMinArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz); irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, dir, cubemapIdx, 0).xyz * contrib; specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, dir, cubemapIdx, lod).xyz * contrib; 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 444f4326f..486902e60 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -25,7 +25,7 @@ uniform float4 inProbePosArray[MAX_PROBES]; uniform float4 inRefPosArray[MAX_PROBES]; uniform float4x4 worldToObjArray[MAX_PROBES]; uniform float4 refBoxMinArray[MAX_PROBES]; -uniform float4 refBoxArray[MAX_PROBES]; +uniform float4 refBoxMaxArray[MAX_PROBES]; uniform float4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten #if DEBUGVIZ_CONTRIB @@ -80,8 +80,6 @@ float4 main(PFXVertToPix IN) : SV_TARGET if (contribution[i]>0.0) probehits++; } - else - continue; contribution[i] = max(contribution[i],0);