Interleave rigged and world alpha draw calls back-to-front (port of secondlife/viewer#5927) - #284
Closed
anne-skydancer wants to merge 1 commit into
Closed
anne-skydancer wants to merge 1 commit into
anne-skydancer wants to merge 1 commit into
Conversation
…econdlife/viewer#5927) Port of SLL PR #5927 (Viscerous): single back-to-front alpha pass that merges rigged-attachment and world alpha streams instead of rendering rigged alpha in a separate earlier batch. Fixes incorrect draw ordering where rigged alpha objects render behind world alpha they should be in front of (and vice versa). - LLSpatialGroup: worldAlphaDepth()/mAvatarDepth for cross-stream ordering - CompareWorldAlphaDepth + CompareDepthRenderOrder comparators - EAlphaStream {WORLD, RIGGED, INTERLEAVED} - LLPipeline::canUseInterleavedAlpha()/sortAlphaGroupsForInterleaving() - LLVOAvatar::calcRiggedAlphaDepth() stamps rigged alpha groups with avatar depth - LLDrawPoolAlpha::renderAlpha walks both streams in one interleaved pass; per-group LLGLDepthTest (stamped rigged groups depth-write, unstamped blend-only) - RenderInterleavedAlpha setting (default on) as escape hatch Original work by Viscerous (secondlife/viewer PR #5927). Ported with // <FS> ... // </FS> preserve-original conventions.
Author
|
Tested in-world on Windows (MSVC 2022 build, AMD RX 9070 XT): no issues observed. Visuals as expected, no alpha artifacts — rigged avatar attachments and world alpha surfaces sort correctly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of secondlife/viewer#5927 (by Viscerous). Replaces the two-phase alpha render (rigged attachments drawn in an earlier separate batch) with a single back-to-front interleaved pass that merges rigged-attachment and world alpha streams. This fixes incorrect draw ordering where rigged alpha objects render behind world-alpha geometry they should be in front of (and vice versa) — e.g. alpha hair/clothing on avatars sorting wrongly against world alpha surfaces.
Early adopters (Alchemy Viewer) report positive results.
Changes (9 files, +346/−36)
llspatialpartition.h—LLSpatialGroup::worldAlphaDepth()/mAvatarDepthfor cross-stream depth ordering;CompareWorldAlphaDepth+CompareDepthRenderOrdercomparators (std::lessfor pointer tie-breaks)pipeline.{cpp,h}—EAlphaStream {WORLD, RIGGED, INTERLEAVED};LLPipeline::canUseInterleavedAlpha()+sortAlphaGroupsForInterleaving(); bridge stamp fan-out inpostSortllvoavatar.{cpp,h}+llcontrolavatar.cpp—LLVOAvatar::calcRiggedAlphaDepth()stamps rigged alpha groups with the avatar's depthlldrawpoolalpha.{cpp,h}—renderAlphawalks both streams in one interleaved pass via dual iterators; per-groupLLGLDepthTest(stamped rigged groups depth-write, unstamped blend-only)app_settings/settings.xml—RenderInterleavedAlphasetting, default on, as an escape hatchPorted following FS preserve-original conventions (
// <FS> ... // </FS>comment blocks).Test plan
Notes
RenderInterleavedAlpharemains as a runtime toggle if issues surface.By submitting this pull request, I confirm that my contribution is made under the terms of the LGPL-2.1 license and that I have the right to submit it under that license.