Further cleanup, proper hook-in of CubeReflector for bake capture.

Shifted update of probe data to be triggered by probe changes.
Pack probes into the data arrays forward-first instead of keeping strict indicies.
todo: move bake to probeManager, clean up old/commented code, remove old probeMaterial stuff
This commit is contained in:
Areloch 2019-02-13 16:56:28 -06:00
parent 050f1e226a
commit 58e3349286
7 changed files with 120 additions and 96 deletions

View file

@ -476,9 +476,9 @@ singleton ShaderData( PFX_ReflectionProbeArray )
singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock )
{
zDefined = true;
zEnable = false;
zWriteEnable = false;
//zDefined = true;
//zEnable = false;
//zWriteEnable = false;
samplersDefined = true;
samplerStates[0] = SamplerClampLinear;
@ -490,9 +490,9 @@ singleton PostEffect( reflectionProbeArrayPostFX )
// passes by default so we don't do the extra drawing.
//allowReflectPass = false;
renderTime = "PFXAfterDiffuse";
renderTime = "PFXAfterBin";
renderBin = "ProbeBin";
renderPriority = 1;
renderPriority = 9999;
isEnabled = true;
shader = PFX_ReflectionProbeArray;

View file

@ -134,7 +134,7 @@ new SimGroup(MissionGroup) {
ReflectionMode = "Baked Cubemap";
reflectionPath = "levels/probeTest/probes/";
Bake = "0";
position = "0 0.0825528 2.18272";
position = "0 0.280415 4.80432";
rotation = "1 0 0 0";
scale = "5 5 5";
canSave = "1";
@ -156,7 +156,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -171,7 +171,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -186,7 +186,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -201,7 +201,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -216,7 +216,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -231,7 +231,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -246,7 +246,7 @@ new SimGroup(MissionGroup) {
surface = "0 0 0 1 0 0 0.5";
surface = "0 1 0 0 0 0 -0.5";
surface = "0.707107 0 0 0.707107 0 0.5 0";
surface = "0.707107 0 0 0.707106 0 0.5 0";
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
@ -321,7 +321,7 @@ new SimGroup(MissionGroup) {
ReflectionMode = "Baked Cubemap";
reflectionPath = "levels/probeTest/probes/";
Bake = "0";
position = "-8.24487 0.0825528 2.5031";
position = "-9.34007 0.48281 2.5031";
rotation = "1 0 0 0";
scale = "5 5 5";
canSave = "1";
@ -341,7 +341,7 @@ new SimGroup(MissionGroup) {
ReflectionMode = "Baked Cubemap";
reflectionPath = "levels/probeTest/probes/";
Bake = "0";
position = "-8.24487 3.18253 2.18272";
position = "-10.1924 8.78742 2.18272";
rotation = "1 0 0 0";
scale = "5 5 5";
canSave = "1";
@ -354,14 +354,14 @@ new SimGroup(MissionGroup) {
SkyColor = "0.5 0.5 1 1";
};
new ReflectionProbe() {
enabled = "1";
enabled = "0";
ProbeShape = "Box";
radius = "5";
posOffset = "0 0 0";
ReflectionMode = "Baked Cubemap";
reflectionPath = "levels/probeTest/probes/";
Bake = "0";
position = "-8.24487 -3.37372 2.18272";
position = "8.24487 -3.37372 2.18272";
rotation = "1 0 0 0";
scale = "5 5 5";
canSave = "1";

View file

@ -155,7 +155,7 @@ float4 main( PFXVertToPix IN ) : SV_TARGET
// Normalize blendVal
if (blendSum == 0.0f) // Possible with custom weight
{
//blendSum = 1.0f;
blendSum = 1.0f;
}
float invBlendSumWeighted = 1.0f / blendSum;
@ -173,7 +173,7 @@ float4 main( PFXVertToPix IN ) : SV_TARGET
kD *= 1.0 - surface.metalness;
for (i = 0; i < numProbes; ++i)
{
irradiance += blendVal[i]*iblBoxDiffuse(surface,i);
irradiance += float3(blendVal[i],blendVal[i],blendVal[i])/*blendVal[i]*iblBoxDiffuse(surface,i)*/;
specular += blendVal[i]*F*iblBoxSpecular(surface, surfToEye, TORQUE_SAMPLER2D_MAKEARG(BRDFTexture),i);
}