mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 06:34:36 +00:00
Overhauls the handling of probes to utilize an active probe list to improve performance and allow a greater total number of active probes in a scene.
Also fixes handling of metal materials during bakes to render properly, and fixes a possible double-up return in findObjectByType, which could cause doubling when getting probes in the scene
This commit is contained in:
parent
072b5ecb19
commit
6a3603c737
22 changed files with 490 additions and 610 deletions
|
|
@ -3004,15 +3004,10 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
|||
inRefPosArray->uniform = true;
|
||||
inRefPosArray->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var * refBoxMinArray = new Var("inRefBoxMin", "vec4");
|
||||
refBoxMinArray->arraySize = MAX_FORWARD_PROBES;
|
||||
refBoxMinArray->uniform = true;
|
||||
refBoxMinArray->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var * refBoxMaxArray = new Var("inRefBoxMax", "vec4");
|
||||
refBoxMaxArray->arraySize = MAX_FORWARD_PROBES;
|
||||
refBoxMaxArray->uniform = true;
|
||||
refBoxMaxArray->constSortPos = cspPotentialPrimitive;
|
||||
Var * refScaleArray = new Var("inRefScale", "vec4");
|
||||
refScaleArray->arraySize = MAX_FORWARD_PROBES;
|
||||
refScaleArray->uniform = true;
|
||||
refScaleArray->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var * probeConfigData = new Var("probeConfigData", "vec4");
|
||||
probeConfigData->arraySize = MAX_FORWARD_PROBES;
|
||||
|
|
@ -3053,11 +3048,11 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
|||
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
|
||||
|
||||
//Reflection vec
|
||||
String computeForwardProbes = String(" @.rgb = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
|
||||
String computeForwardProbes = String(" @.rgb = computeForwardProbes(@,@,@,@,@,@,@,@,\r\n\t\t");
|
||||
computeForwardProbes += String("@,@,\r\n\t\t");
|
||||
computeForwardProbes += String("@,@).rgb; \r\n");
|
||||
|
||||
meta->addStatement(new GenOp(computeForwardProbes.c_str(), curColor, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refBoxMinArray, refBoxMaxArray, inRefPosArray,
|
||||
meta->addStatement(new GenOp(computeForwardProbes.c_str(), curColor, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refScaleArray, inRefPosArray,
|
||||
skylightCubemapIdx, BRDFTexture,
|
||||
irradianceCubemapAR, specularCubemapAR));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue