diff options
author | Dave Parks <davep@lindenlab.com> | 2023-01-10 11:42:12 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-01-10 11:42:12 -0600 |
commit | 4abf39c968c31a9da943a53434388102b99d487f (patch) | |
tree | 8807c96faaec13540b747497032242798837b68d /indra/newview/lldrawpoolalpha.cpp | |
parent | a2d17d3c1e5a62f10ab3922b6b12f909f1cd4682 (diff) |
SL-18869 Optimizations -- Bring back water plane clipping for above/below water where applicable.
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 3ce2ced255..07381acd25 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -600,6 +600,16 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged) begin = gPipeline.beginAlphaGroups(); end = gPipeline.endAlphaGroups(); } + + LLEnvironment& env = LLEnvironment::instance(); + F32 water_height = env.getWaterHeight(); + + bool above_water = getType() == LLDrawPool::POOL_ALPHA_POST_WATER; + if (LLPipeline::sUnderWaterRender) + { + above_water = !above_water; + } + for (LLCullResult::sg_iterator i = begin; i != end; ++i) { @@ -611,6 +621,25 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged) if (group->getSpatialPartition()->mRenderByGroup && !group->isDead()) { + + LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge(); + const LLVector4a* ext = bridge ? bridge->getSpatialExtents() : group->getExtents(); + + if (above_water) + { // reject any spatial groups that have no part above water + if (ext[1].getF32ptr()[2] < water_height) + { + continue; + } + } + else + { // reject any spatial groups that he no part below water + if (ext[0].getF32ptr()[2] > water_height) + { + continue; + } + } + static std::vector<LLDrawInfo*> emissives; static std::vector<LLDrawInfo*> rigged_emissives; emissives.resize(0); |