summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmapmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r--indra/newview/llreflectionmapmanager.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 3130fe3bac..2cad413d18 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -230,7 +230,7 @@ void LLReflectionMapManager::update()
if (mMipChain.empty())
{
U32 res = mProbeResolution;
- U32 count = log2((F32)res) + 0.5f;
+ U32 count = (U32)(log2((F32)res) + 0.5f);
mMipChain.resize(count);
for (U32 i = 0; i < count; ++i)
@@ -251,7 +251,7 @@ void LLReflectionMapManager::update()
auto const & iter = std::find(mProbes.begin(), mProbes.end(), probe);
if (iter != mProbes.end())
{
- deleteProbe(iter - mProbes.begin());
+ deleteProbe((U32)(iter - mProbes.begin()));
}
}
@@ -761,7 +761,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
}
- S32 mips = log2((F32)mProbeResolution) + 0.5f;
+ S32 mips = (S32)(log2((F32)mProbeResolution) + 0.5f);
gReflectionMipProgram.bind();
S32 diffuseChannel = gReflectionMipProgram.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, LLTexUnit::TT_TEXTURE);
@@ -841,7 +841,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
static LLStaticHashedString sWidth("u_width");
gRadianceGenProgram.uniform1f(sRoughness, (F32)i / (F32)(mMipChain.size() - 1));
- gRadianceGenProgram.uniform1f(sMipLevel, i);
+ gRadianceGenProgram.uniform1f(sMipLevel, (GLfloat)i);
gRadianceGenProgram.uniform1i(sWidth, mProbeResolution);
for (int cf = 0; cf < 6; ++cf)
@@ -1377,14 +1377,22 @@ void LLReflectionMapManager::initReflectionMaps()
{
U32 count = LL_MAX_REFLECTION_PROBE_COUNT;
- if (mTexture.isNull() || mReflectionProbeCount != count || mReset)
+ static LLCachedControl<U32> ref_probe_res(gSavedSettings, "RenderReflectionProbeResolution", 128U);
+ U32 probe_resolution = nhpo2(llclamp(ref_probe_res(), (U32)64, (U32)512));
+ if (mTexture.isNull() || mReflectionProbeCount != count || mProbeResolution != probe_resolution || mReset)
{
+ if(mProbeResolution != probe_resolution)
+ {
+ mRenderTarget.release();
+ mMipChain.clear();
+ }
+
gEXRImage = nullptr;
mReset = false;
mReflectionProbeCount = count;
- mProbeResolution = nhpo2(llclamp(gSavedSettings.getU32("RenderReflectionProbeResolution"), (U32)64, (U32)512));
- mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1
+ mProbeResolution = probe_resolution;
+ mMaxProbeLOD = log2f((F32)mProbeResolution) - 1.f; // number of mips - 1
if (mTexture.isNull() ||
mTexture->getWidth() != mProbeResolution ||