mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Undid debug work, shifted logic over entirely to utilize the updateTexture methods. Refactored probe init'ing so they'll load correctly without nudging, properly sequestered skylights from the probe array and updated the shader to contain az's changes as well as skylight and probe array changes.
This commit is contained in:
parent
1627cbabe6
commit
e2b194182c
7 changed files with 141 additions and 262 deletions
|
|
@ -294,8 +294,6 @@ bool ReflectionProbe::onAdd()
|
|||
{
|
||||
createGeometry();
|
||||
updateProbeParams();
|
||||
|
||||
PROBEMGR->registerProbe(mProbeInfoIdx);
|
||||
}
|
||||
|
||||
setMaskBits(-1);
|
||||
|
|
@ -458,6 +456,8 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|||
|
||||
mathRead(*stream, &mProbeRefOffset);
|
||||
mathRead(*stream, &mProbeRefScale);
|
||||
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // ShapeTypeMask
|
||||
|
|
@ -467,24 +467,30 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|||
|
||||
mProbeShapeType = (ProbeRenderInst::ProbeShapeType)shapeType;
|
||||
createGeometry();
|
||||
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // UpdateMask
|
||||
{
|
||||
stream->read(&mRadius);
|
||||
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // BakeInfoMask
|
||||
{
|
||||
stream->read(&mProbeUniqueID);
|
||||
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // EnabledMask
|
||||
{
|
||||
mEnabled = stream->readFlag();
|
||||
}
|
||||
|
||||
bool isMaterialDirty = false;
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // ModeMask
|
||||
{
|
||||
|
|
@ -492,7 +498,7 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|||
stream->read(&reflectModeType);
|
||||
mReflectionModeType = (ReflectionModeType)reflectModeType;
|
||||
|
||||
isMaterialDirty = true;
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // CubemapMask
|
||||
|
|
@ -505,7 +511,7 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|||
processStaticCubemap();
|
||||
}
|
||||
|
||||
isMaterialDirty = true;
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
if (mDirty)
|
||||
|
|
@ -524,9 +530,9 @@ void ReflectionProbe::updateProbeParams()
|
|||
mProbeInfo = new ProbeRenderInst();
|
||||
mProbeInfoIdx = ProbeRenderInst::all.size() - 1;
|
||||
mProbeInfo->mIsEnabled = false;
|
||||
}
|
||||
|
||||
updateCubemaps();
|
||||
PROBEMGR->registerProbe(mProbeInfoIdx);
|
||||
}
|
||||
|
||||
mProbeInfo->mProbeShapeType = mProbeShapeType;
|
||||
|
||||
|
|
@ -607,7 +613,8 @@ void ReflectionProbe::processStaticCubemap()
|
|||
mProbeInfo->mIrradianceCubemap = mIrridianceMap->mCubemap;
|
||||
|
||||
//Update the probe manager with our new texture!
|
||||
//PROBEMGR->updateProbeTexture(mProbeInfo);
|
||||
if(!mProbeInfo->mIsSkylight)
|
||||
PROBEMGR->updateProbeTexture(mProbeInfo);
|
||||
}
|
||||
|
||||
void ReflectionProbe::updateCubemaps()
|
||||
|
|
@ -658,10 +665,8 @@ void ReflectionProbe::updateCubemaps()
|
|||
else
|
||||
mProbeInfo->mIsEnabled = false;
|
||||
|
||||
PROBEMGR->updateProbes();
|
||||
|
||||
//if (mProbeInfo->mPrefilterCubemap->isInitialized() && mProbeInfo->mIrradianceCubemap->isInitialized())
|
||||
// PROBEMGR->updateProbeTexture(mProbeInfo);
|
||||
if (!mProbeInfo->mIsSkylight && mProbeInfo->mPrefilterCubemap->isInitialized() && mProbeInfo->mIrradianceCubemap->isInitialized())
|
||||
PROBEMGR->updateProbeTexture(mProbeInfo);
|
||||
}
|
||||
|
||||
bool ReflectionProbe::createClientResources()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue