Merge pull request #372 from Areloch/MiscProbeLoadingFixups

Misc. probe bake/load fixups
This commit is contained in:
Brian Roberts 2020-10-29 23:30:45 -05:00 committed by GitHub
commit 302a64edd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -296,7 +296,7 @@ bool ReflectionProbe::onAdd()
// Refresh this object's material (if any)
if (isClientObject())
{
if (!createClientResources())
if (!mResourcesCreated && !createClientResources())
return false;
updateProbeParams();
@ -496,6 +496,12 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
//-----------------------------------------------------------------------------
void ReflectionProbe::updateProbeParams()
{
if (!mResourcesCreated)
{
if (!createClientResources())
return;
}
mProbeInfo.mIsEnabled = mEnabled;
mProbeInfo.mProbeShapeType = mProbeShapeType;
@ -624,7 +630,7 @@ void ReflectionProbe::processStaticCubemap()
String path = Con::getVariable("$pref::ReflectionProbes::CurrentLevelPath", "levels/");
char irradFileName[256];
dSprintf(irradFileName, 256, "%s_Irradiance.dds", path.c_str(), mCubemapName.c_str());
dSprintf(irradFileName, 256, "%s%s_Irradiance.dds", path.c_str(), mCubemapName.c_str());
if (Platform::isFile(irradFileName))
{

View file

@ -203,7 +203,8 @@ RenderProbeMgr::RenderProbeMgr()
mHasSkylight(false),
mSkylightCubemapIdx(-1),
mCubeMapCount(0),
mDefaultSkyLight(nullptr)
mDefaultSkyLight(nullptr),
mUseHDRCaptures(true)
{
mEffectiveProbeCount = 0;
mMipCount = 0;