diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-07-07 08:06:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-07 08:06:22 -0400 |
| commit | 3d465f6c966f0a2fcfd5d3c9effb6ce20c2754c8 (patch) | |
| tree | 6e54cc193b39ab8ded12f4fa343ada52f75b0c61 /indra/newview/llfetchedgltfmaterial.cpp | |
| parent | f2c356fc7130ce5e38b994dcfa1e210609b458b9 (diff) | |
| parent | b8762cb7999197f7da36b4820761298e85bdfa6f (diff) | |
Merge pull request #5982 from secondlife/geenz/texture-streaming-tweaks
Geenz/texture streaming tweaks
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()) |
