Skip to content
Snippets Groups Projects
Commit fc16773b authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer

parents f05d4b11 a29f7c3b
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
......@@ -113,6 +113,8 @@ LLCubeMapArray::~LLCubeMapArray()
void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, BOOL use_mips)
{
U32 texname = 0;
mWidth = resolution;
mCount = count;
LLImageGL::generateTextures(1, &texname);
......
......@@ -60,9 +60,17 @@ class LLCubeMapArray : public LLRefCount
void destroyGL();
// get width of cubemaps in array (they're cubes, so this is also the height)
U32 getWidth() const { return mWidth; }
// get number of cubemaps in the array
U32 getCount() const { return mCount; }
protected:
friend class LLTexUnit;
~LLCubeMapArray();
LLPointer<LLImageGL> mImage;
U32 mWidth = 0;
U32 mCount = 0;
S32 mTextureStage;
};
......@@ -1240,13 +1240,18 @@ void LLReflectionMapManager::initReflectionMaps()
mProbeResolution = probe_resolution;
mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1
mTexture = new LLCubeMapArray();
if (mTexture.isNull() ||
mTexture->getWidth() != mProbeResolution ||
mReflectionProbeCount + 2 != mTexture->getCount())
{
mTexture = new LLCubeMapArray();
// store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source)
mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2);
// store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source)
mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2);
mIrradianceMaps = new LLCubeMapArray();
mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, FALSE);
mIrradianceMaps = new LLCubeMapArray();
mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, FALSE);
}
// reset probe state
mUpdatingFace = 0;
......@@ -1254,6 +1259,9 @@ void LLReflectionMapManager::initReflectionMaps()
mRadiancePass = false;
mRealtimeRadiancePass = false;
// if default probe already exists, remember whether or not it's complete (SL-20498)
bool default_complete = mDefaultProbe.isNull() ? false : mDefaultProbe->mComplete;
for (auto& probe : mProbes)
{
probe->mLastUpdateTime = 0.f;
......@@ -1281,6 +1289,8 @@ void LLReflectionMapManager::initReflectionMaps()
mDefaultProbe->mDistance = 64.f;
mDefaultProbe->mRadius = 4096.f;
mDefaultProbe->mProbeIndex = 0;
mDefaultProbe->mComplete = default_complete;
touch_default_probe(mDefaultProbe);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment