diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-07-07 20:49:46 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-07-07 20:49:46 +0800 |
| commit | c659a085f05f5a9f62abf8a4c2e394d910af4ae9 (patch) | |
| tree | 4e18706c29a8d0d95078c438b67b2e7a81f24005 /indra/newview/llfetchedgltfmaterial.cpp | |
| parent | 2121d3b20269baeb8bb88cef534307628f1adb2e (diff) | |
| parent | 3d465f6c966f0a2fcfd5d3c9effb6ce20c2754c8 (diff) | |
Merge tag 'Second_Life_Release#3d465f6c-26.3' into 26.3
Diffstat (limited to 'indra/newview/llfetchedgltfmaterial.cpp')
| -rw-r--r-- | indra/newview/llfetchedgltfmaterial.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp index a05f725673..d71f0c1bd4 100644 --- a/indra/newview/llfetchedgltfmaterial.cpp +++ b/indra/newview/llfetchedgltfmaterial.cpp @@ -73,6 +73,20 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex) LLViewerTexture* baseColorTex = media_tex ? media_tex : mBaseColorTexture; LLViewerTexture* emissiveTex = media_tex ? media_tex : mEmissiveTexture; + if (media_tex) + { + // Media hides these but they stay registered for coverage. Stamp them so + // the GC doesn't coarsen/refetch them while the media is playing. + if (mBaseColorTexture.notNull()) + { + if (LLImageGL* gl_tex = mBaseColorTexture->getGLTexture()) { gl_tex->stampBound(); } + } + if (mEmissiveTexture.notNull()) + { + if (LLImageGL* gl_tex = mEmissiveTexture->getGLTexture()) { gl_tex->stampBound(); } + } + } + if (!LLPipeline::sShadowRender || (mAlphaMode == LLGLTFMaterial::ALPHA_MODE_MASK)) { if (mAlphaMode == LLGLTFMaterial::ALPHA_MODE_MASK) @@ -97,13 +111,26 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex) if (!LLPipeline::sShadowRender) { - if (mNormalTexture.notNull() && mNormalTexture->getDiscardLevel() <= 4) + // Bind the normal map at whatever resolution is resident, like Blinn-Phong + // (soft, never absent). Only fall back to the flat normal when it's not + // loaded yet. (The old discard<=4 gate dropped distant/tiled PBR normals + // entirely, making PBR look flatter than equivalent Blinn content.) + if (mNormalTexture.notNull() && mNormalTexture->hasGLTexture()) { shader->bindTexture(LLShaderMgr::BUMP_MAP, mNormalTexture); } else { shader->bindTexture(LLShaderMgr::BUMP_MAP, LLViewerFetchedTexture::sFlatNormalImagep); + if (mNormalTexture.notNull()) + { + // In use, just not loaded yet - stamp it so the GC doesn't treat + // it as unseen and pin it deep before its first real bind. + if (LLImageGL* gl_tex = mNormalTexture->getGLTexture()) + { + gl_tex->stampBound(); + } + } } if (mMetallicRoughnessTexture.notNull()) |
