Conversation
The layer writes no depth and disables back face culling, so nothing in the batch occludes anything else and both faces of every part are submitted. Submission order is then the only thing deciding what is on top, which put lights through panels and stopped the animated monitor glow on Renaissance and Toyota reading as animated. Binary alpha was the reason given for dropping the sorter. It makes the blend order independent, not the occlusion. Costs back the 0.6 ms the sort was measured to save on Copper. One layer per emission texture now, so the exterior no longer flushes twice when both accessors saw the same texture in a frame.
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.
About the PR
Fixes the rendering regression reported against beta 2816: console monitor
animations missing on Renaissance and Toyota, and emissions showing through the
panel around the power switch.
Reverts the one change in #2186 that caused it, and keeps the reasoning in the
code so it does not get dropped again for the same wrong reason.
Why / Balance
No balance impact. This restores the pre-#2186 look of every emissive draw.
Costs back the roughly 0.6 ms the sort was measured to save on Copper's
emission pass. On the numbers from #2186 that is about 117 fps to about 109 in
the Copper interior scenario, against 39 fps on the pre-#2186 baseline, so the
bulk of that PR's gain is unaffected.
Technical details
AITRenderLayers.emissivebuilds the layer with:#2186 dropped the
translucentflag on this layer, which is what handsBufferBuildera sorter, to save the per-quad primitive centres and theexplicit index buffer.
The justification given was that 106 of the mod's 113 emission textures are
strictly binary alpha, where
SRC_ALPHAblending is order-independent, so onlytextures with real partial alpha needed the sorted layer.
That is wrong in one specific way. Binary alpha makes the blend
order-independent, not the occlusion. Because the layer writes no depth,
nothing in the batch occludes anything else in it, and because back face culling
is disabled, both faces of every part are submitted. Whichever quad is drawn
last simply wins. So submission order decides what ends up on top regardless of
alpha: a part's own back face, or a light sitting behind a panel, paints over
the front of it.
The same mechanism was already written down correctly in this file, in the
javadoc for the sorted accessor, about the eye of harmony star: "with culling
disabled so both faces of both shells are submitted; unsorted, the opaque core
would land last and paint over the shell that is supposed to veil it." It simply
was not applied to the console layer.
Symptom mapping:
powerlights2is one ofToyota's animated bones, and it is behind the panel it now paints over.
animates on those monitors is emissive: Renaissance keyframes
symbol, achild of
monitor, pluslamp1throughlamp6,rotorlightand threeblinkers; Toyota keyframes
gallifreyan2,gallifreyan3,uppertimepiece,powerlights2and the rest. Those are small moving glow quads, and with theordering wrong they are covered and stop reading as animated.
that both carry a monitor and are affected in the overlapping-glow way this
produces. Hudolin shares their root transform but has no monitor at all.
With unsorted gone there is only one emissive layer, so the two accessors are
merged. That also removes the extra flush the sorted accessor's own javadoc
described, where an exterior emission texture reached both layers in one frame
and
Immediatekeys buffers on layer identity.Not fixed here
The third item in the report, the Copper monitor text looking wrong, is a
separate change (
ed57ab87c, monitor text fromdrawWithOutlineto a shadoweddraw on
POLYGON_OFFSET). Copper is the only model that was converted, which iswhy only its text differs. It is cosmetic and wants a look at the intended
appearance rather than a blind revert, so it is left out of this PR.
Media
Needs a before and after on a Renaissance or Toyota console with the power on.
Requirements
None.
Breaking changes
AITRenderLayers.tardisEmissiveCullZOffsetSorted(Identifier)is removed. Thereis one emissive layer now and
tardisEmissiveCullZOffset(Identifier)returns it,which is what the three callers were updated to.
Changelog
🆑