diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-07-19 12:52:36 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-07-19 12:52:36 -0500 |
commit | c85bb7846d270ba23c447c1b0073cd238d5fd1bc (patch) | |
tree | 22f028fc47adb2c82db3ad8e6fe8f2c611894447 /indra/newview/lldrawpool.cpp | |
parent | a44fa7b1a3392f74735c664d1852707f52eae00f (diff) |
DRTVWR-559 Fix for shadows not respecting double sided on opaque PBR surfaces
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rw-r--r-- | indra/newview/lldrawpool.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index a9f35b3360..fca0f1c978 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -696,6 +696,18 @@ void teardown_texture_matrix(LLDrawInfo& params) } } +void LLRenderPass::pushGLTFBatches(U32 type, bool textured) +{ + if (textured) + { + pushGLTFBatches(type); + } + else + { + pushRiggedGLTFBatches(type); + } +} + void LLRenderPass::pushGLTFBatches(U32 type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; @@ -711,6 +723,21 @@ void LLRenderPass::pushGLTFBatches(U32 type) } } +void LLRenderPass::pushUntexturedGLTFBatches(U32 type) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + auto* begin = gPipeline.beginRenderMap(type); + auto* end = gPipeline.endRenderMap(type); + for (LLCullResult::drawinfo_iterator i = begin; i != end; ) + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL("pushGLTFBatch"); + LLDrawInfo& params = **i; + LLCullResult::increment_iterator(i, end); + + pushUntexturedGLTFBatch(params); + } +} + void LLRenderPass::pushGLTFBatch(LLDrawInfo& params) { auto& mat = params.mGLTFMaterial; @@ -729,6 +756,30 @@ void LLRenderPass::pushGLTFBatch(LLDrawInfo& params) teardown_texture_matrix(params); } +void LLRenderPass::pushUntexturedGLTFBatch(LLDrawInfo& params) +{ + auto& mat = params.mGLTFMaterial; + + LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); + + applyModelMatrix(params); + + params.mVertexBuffer->setBuffer(); + params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); +} + +void LLRenderPass::pushRiggedGLTFBatches(U32 type, bool textured) +{ + if (textured) + { + pushRiggedGLTFBatches(type); + } + else + { + pushUntexturedRiggedGLTFBatches(type); + } +} + void LLRenderPass::pushRiggedGLTFBatches(U32 type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; @@ -747,6 +798,25 @@ void LLRenderPass::pushRiggedGLTFBatches(U32 type) } } +void LLRenderPass::pushUntexturedRiggedGLTFBatches(U32 type) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + LLVOAvatar* lastAvatar = nullptr; + U64 lastMeshId = 0; + + auto* begin = gPipeline.beginRenderMap(type); + auto* end = gPipeline.endRenderMap(type); + for (LLCullResult::drawinfo_iterator i = begin; i != end; ) + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL("pushRiggedGLTFBatch"); + LLDrawInfo& params = **i; + LLCullResult::increment_iterator(i, end); + + pushUntexturedRiggedGLTFBatch(params, lastAvatar, lastMeshId); + } +} + + void LLRenderPass::pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvatar, U64& lastMeshId) { if (params.mAvatar.notNull() && (lastAvatar != params.mAvatar || lastMeshId != params.mSkinInfo->mHash)) @@ -759,3 +829,15 @@ void LLRenderPass::pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvat pushGLTFBatch(params); } +void LLRenderPass::pushUntexturedRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvatar, U64& lastMeshId) +{ + if (params.mAvatar.notNull() && (lastAvatar != params.mAvatar || lastMeshId != params.mSkinInfo->mHash)) + { + uploadMatrixPalette(params); + lastAvatar = params.mAvatar; + lastMeshId = params.mSkinInfo->mHash; + } + + pushUntexturedGLTFBatch(params); +} + |