From c85bb7846d270ba23c447c1b0073cd238d5fd1bc Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Wed, 19 Jul 2023 12:52:36 -0500 Subject: DRTVWR-559 Fix for shadows not respecting double sided on opaque PBR surfaces --- indra/newview/pipeline.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d50e671e05..1402591015 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6494,6 +6494,25 @@ void LLPipeline::renderObjects(U32 type, bool texture, bool batch_texture, bool gGLLastMatrix = NULL; } +void LLPipeline::renderGLTFObjects(U32 type, bool texture, bool rigged) +{ + assertInitialized(); + gGL.loadMatrix(gGLModelView); + gGLLastMatrix = NULL; + + if (rigged) + { + mSimplePool->pushRiggedGLTFBatches(type + 1, texture); + } + else + { + mSimplePool->pushGLTFBatches(type, texture); + } + + gGL.loadMatrix(gGLModelView); + gGLLastMatrix = NULL; +} + // Currently only used for shadows -Cosmic,2023-04-19 void LLPipeline::renderAlphaObjects(bool rigged) { @@ -8601,8 +8620,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLRenderPass::PASS_NORMMAP, LLRenderPass::PASS_NORMMAP_EMISSIVE, LLRenderPass::PASS_NORMSPEC, - LLRenderPass::PASS_NORMSPEC_EMISSIVE, - LLRenderPass::PASS_GLTF_PBR + LLRenderPass::PASS_NORMSPEC_EMISSIVE }; LLGLEnable cull(GL_CULL_FACE); @@ -8665,6 +8683,8 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera renderObjects(type, false, false, rigged); } + renderGLTFObjects(LLRenderPass::PASS_GLTF_PBR, false, rigged); + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); } -- cgit v1.2.3 From b67172aa12be4a37c83042437844747ff0e02e34 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 21 Jul 2023 15:46:12 -0500 Subject: SL-20010 Make reflection probes ignore touch actions. --- indra/newview/pipeline.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1402591015..1b4c8f65a6 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6223,7 +6223,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_PARTICLE); if (part && hasRenderType(part->mDrawableType)) { - LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, FALSE, TRUE, face_hit, &position, NULL, NULL, NULL); + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, FALSE, TRUE, FALSE, face_hit, &position, NULL, NULL, NULL); if (hit) { drawable = hit; @@ -6252,6 +6252,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, bool pick_transparent, bool pick_rigged, bool pick_unselectable, + bool pick_reflection_probe, S32* face_hit, LLVector4a* intersection, // return the intersection point LLVector2* tex_coord, // return the texture coordinates of the intersection point @@ -6285,7 +6286,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, LLSpatialPartition* part = region->getSpatialPartition(j); if (part && hasRenderType(part->mDrawableType)) { - LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, pick_rigged, pick_unselectable, face_hit, &position, tex_coord, normal, tangent); + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, pick_rigged, pick_unselectable, pick_reflection_probe, face_hit, &position, tex_coord, normal, tangent); if (hit) { drawable = hit; @@ -6342,7 +6343,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_AVATAR); if (part && hasRenderType(part->mDrawableType)) { - LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, pick_rigged, pick_unselectable, face_hit, &position, tex_coord, normal, tangent); + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, pick_rigged, pick_unselectable, pick_reflection_probe, face_hit, &position, tex_coord, normal, tangent); if (hit) { LLVector4a delta; @@ -6430,7 +6431,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, c LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_HUD); if (part) { - LLDrawable* hit = part->lineSegmentIntersect(start, end, pick_transparent, FALSE, TRUE, face_hit, intersection, tex_coord, normal, tangent); + LLDrawable* hit = part->lineSegmentIntersect(start, end, pick_transparent, FALSE, TRUE, FALSE, face_hit, intersection, tex_coord, normal, tangent); if (hit) { drawable = hit; @@ -7165,7 +7166,7 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) LLVector4a result; result.clear(); - gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, TRUE, NULL, &result); + gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, TRUE, TRUE, NULL, &result); focus_point.set(result.getF32ptr()); } -- cgit v1.2.3 From d8872d5273b5cc952f692d970f19db90588a1508 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Jul 2023 21:30:24 +0300 Subject: SL-18720 getDataBegin() and stateSort() crashes No repro, but likely cause is in mOctreeNode being NULL. Marked octree group as dead when destroyed and added isDead verification --- indra/newview/pipeline.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1b4c8f65a6..1620b1ff4c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2466,8 +2466,11 @@ void LLPipeline::doOcclusion(LLCamera& camera) for (LLCullResult::sg_iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter) { LLSpatialGroup* group = *iter; - group->doOcclusion(&camera); - group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); + if (!group->isDead()) + { + group->doOcclusion(&camera); + group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); + } } //apply occlusion culling to object cache tree @@ -2912,6 +2915,10 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter) { LLSpatialGroup* group = *iter; + if (group->isDead()) + { + continue; + } group->checkOcclusion(); if (sUseOcclusion > 1 && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { @@ -2971,6 +2978,10 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter) { LLSpatialGroup* group = *iter; + if (group->isDead()) + { + continue; + } group->checkOcclusion(); if (sUseOcclusion > 1 && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { @@ -3130,7 +3141,12 @@ void forAllDrawables(LLCullResult::sg_iterator begin, { for (LLCullResult::sg_iterator i = begin; i != end; ++i) { - for (LLSpatialGroup::element_iter j = (*i)->getDataBegin(); j != (*i)->getDataEnd(); ++j) + LLSpatialGroup* group = *i; + if (group->isDead()) + { + continue; + } + for (LLSpatialGroup::element_iter j = group->getDataBegin(); j != group->getDataEnd(); ++j) { if((*j)->hasDrawable()) { @@ -3339,6 +3355,10 @@ void LLPipeline::postSort(LLCamera &camera) for (LLCullResult::sg_iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i) { LLSpatialGroup *group = *i; + if (group->isDead()) + { + continue; + } if (!sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { group->rebuildGeom(); @@ -3357,6 +3377,12 @@ void LLPipeline::postSort(LLCamera &camera) for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i) { LLSpatialGroup *group = *i; + + if (group->isDead()) + { + continue; + } + if ((sUseOcclusion && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) || (RenderAutoHideSurfaceAreaLimit > 0.f && group->mSurfaceArea > RenderAutoHideSurfaceAreaLimit * llmax(group->mObjectBoxSize, 10.f))) -- cgit v1.2.3