Repository navigation
Mafia: Definitive Edition: Add Luma mod - #225
Open
williamstosh wants to merge 1 commit into
Open
williamstosh wants to merge 1 commit into
williamstosh wants to merge 1 commit into
Conversation
Owner
|
I'm adding SDR support to Luma this well, given this overall, I'll wait to merge my changes. Thanks. |
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.
Mafia: Definitive Edition: Add Luma mod
Adds a Luma mod for Mafia: Definitive Edition (the 2020 remake), replacing the game's temporal
resolve with DLSS (DLAA at native resolution). Same shape as the existing Mafia II: Definitive
Edition and Mafia III mods.
What it does
0x37B05605,0x7B9B914F) and feeds DLSS SR with the game'sown jittered colour (
t0), history (t1) and motion vectors (t2).0x121A4A96), the only full resolution pass that bothtests and writes depth.
#if DEVELOPMENT.Facts worth recording (all measured - REPORT.md carries the raw evidence)
t2is the MV (R16G16B16A16_FLOAT), stored in UV space, so it must be scaled by the render resolution before DLSS sees it.prevUV = curUV + MVwith no jitter term at all (disassembly confirmed); the shader never reads the jitter floats we hand to DLSS.MVJitteredis therefore set in the create flags, while the separate behaviour flag ships off - with DLSS 310.9.x, ON measures softer and noisier on this content (§6.2).cancel_second_taa, default on, left switchable so it can be A/B'd).0x747C6210mul r0, r0, v1outside itsif (strength > 0)block. Skipping the draw removes a per pixel multiply and turns the screen black. Tame it by zeroingcb0[0].zinstead.0x2B974E48is not the colour AAt0, a single channelR32_FLOATauxiliary buffer. Feeding that to DLSS is exactly what produced the early "heavy noise" reports. Deliberately not hooked.0x916B1D65- the same hash RenoDX uses, so independently confirmed by two projects.The one core change:
SDR_OUTPUT_TRANSFORMNot game specific, and the default keeps existing behaviour.
Luma's SDR display composition has always decoded the game's final image from sRGB to linear. That is
correct when the container encodes on write (
_SRGBviews, scRGB - which is what the scRGB swapchainupgrade relies on), but on a plain UNORM container (
R8G8B8A8_UNORM,R10G10B10A2_UNORM, ...)the OS applies the sRGB transfer function itself, so the image ends up one decode too dark: over
contrasted and over saturated compared to vanilla.
SDR_OUTPUT_TRANSFORM = 0- decode sRGB to linear (legacy, default, no existing game changes)SDR_OUTPUT_TRANSFORM = 1- pass through untouched (correct for a plain UNORM container)Mafia: DE sets it to
1, which is where the need for it was found.Luma_DisplayComposition.hlslgets the matching branch (
SDRGameOutputToContainer).Verification
Development-ReleaseandPublishing-Release, x64. The project shipsv145like therest of the repo.
the game's own, RCAS checked A/B in game, DLSS render presets profiled (§6.1).
AA Low -> Medium -> High -> Low and then a full cutscene, in one session (§6.5 / §6.6).
Known limitations (REPORT.md §7)
(verified: every shader unique to those modes is a geometry pass), so there is no draw to replace.
Nothing on this side can change that.
100-190, no resolve, no tonemapper). There is nothing to anti-alias, and a video frame carries none
of the guides DLSS SR / RR / NR or frame generation need.
Mfor correct reflective / transparent content (§6.1).resolution costs more than the game's TAA.
Documentation
REPORT.mdin the game folder is both the user facing document (§1-§3: requirements, installation,settings) and the reverse engineering record (§4-§6: passes, measurements, raw evidence), with two SM5
disassemblies of the game's own shaders under
docs/. It is written so that what was measured can betold apart from what was assumed.