summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpool.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-04-21 13:26:24 -0700
committercosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2023-04-21 15:10:05 -0700
commit005a5fa207d158995217cb9ecf5c214c8b2354cc (patch)
tree08ae2464306b77a4743d6898cf81a1c7e95fa696 /indra/newview/lldrawpool.cpp
parent5c903d9c953e422a95ccd88b345d803b60ce65ff (diff)
SL-19606: Fix missing GLTF texture transforms in PBR alpha mask/alpha blend shadows
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rw-r--r--indra/newview/lldrawpool.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 2eb277fc4e..3de0e8a7c4 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -504,7 +504,7 @@ void LLRenderPass::pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvat
pushGLTFBatch(params);
}
-void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures)
+void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
auto* begin = gPipeline.beginRenderMap(type);
@@ -514,11 +514,12 @@ void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures)
LLDrawInfo* pparams = *i;
LLCullResult::increment_iterator(i, end);
- pushBatch(*pparams, texture, batch_textures);
+ pushBatch(*pparams, texture, batch_textures, reset_gltf);
+ reset_gltf = false;
}
}
-void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures)
+void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLVOAvatar* lastAvatar = nullptr;
@@ -537,11 +538,12 @@ void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures
lastMeshId = pparams->mSkinInfo->mHash;
}
- pushBatch(*pparams, texture, batch_textures);
+ pushBatch(*pparams, texture, batch_textures, reset_gltf);
+ reset_gltf = false;
}
}
-void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures)
+void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
auto* begin = gPipeline.beginRenderMap(type);
@@ -551,11 +553,12 @@ void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures)
LLDrawInfo* pparams = *i;
LLCullResult::increment_iterator(i, end);
LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(pparams->mAlphaMaskCutoff);
- pushBatch(*pparams, texture, batch_textures);
+ pushBatch(*pparams, texture, batch_textures, reset_gltf);
+ reset_gltf = false;
}
}
-void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_textures)
+void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLVOAvatar* lastAvatar = nullptr;
@@ -584,7 +587,8 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_text
lastMeshId = pparams->mSkinInfo->mHash;
}
- pushBatch(*pparams, texture, batch_textures);
+ pushBatch(*pparams, texture, batch_textures, reset_gltf);
+ reset_gltf = false;
}
}
@@ -603,7 +607,14 @@ void LLRenderPass::applyModelMatrix(const LLDrawInfo& params)
}
}
-void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures)
+void LLRenderPass::resetGLTFTextureTransform()
+{
+ F32 ignore_gltf_transform[8];
+ LLGLTFMaterial::sDefault.mTextureTransform[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR].getPacked(ignore_gltf_transform);
+ LLGLSLShader::sCurBoundShaderPtr->uniform4fv(LLShaderMgr::TEXTURE_BASE_COLOR_TRANSFORM, 2, (F32*)ignore_gltf_transform);
+}
+
+void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
if (!params.mCount)
@@ -612,6 +623,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, bool texture, bool batch_textur
}
applyModelMatrix(params);
+ if (reset_gltf) { resetGLTFTextureTransform(); }
bool tex_setup = false;