Skip to content

Share the SMAA, XeGTAO, MacLeod-Boynton, RCAS and dgVoodoo code between games, and draw RCAS from Core - #227

Merged
Izueh merged 4 commits into
Filoppi:mainfrom
jhi721:pr/shared-hlsl-includes
Oct 10, 2026
Merged

Izueh merged 4 commits into
Filoppi:mainfrom
jhi721:pr/shared-hlsl-includes

Conversation

@jhi721

@jhi721 jhi721 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Moves the shader code that my mods had copied between each other into shared files, and moves the RCAS into Core.

Shared shaders

  • Shaders/Includes/SMAA_Passes.hlsl: the six SMAA entry points Core draws. Each Luma_SMAA_impl.hlsl now only sets up SMAA and includes it. Used by BL2/TPS, BL GOTY, MEA, MELE, ME1, MoH Airborne and TW2, plus BioShock and MGS4 in a separate commit, since their files were the same copy.
  • Shaders/Includes/XeGTAO.hlsl: the XeGTAO passes from BL GOTY, MELE and TW2. Each game keeps a small Luma_<Game>_XeGTAO.hlsl with its cbuffers, depth/normal decoding and a few defines.
  • Shaders/Includes/MacLeodBoynton.hlsl: moved from the four identical copies in BL GOTY, ME1, MoH Airborne and TW2.
  • Shaders/Global/Luma_RCAS_PS.hlsl: replaces the seven identical Luma_*_Sharpen.hlsl.
  • Shaders/Includes/DgVoodoo.hlsl: ApplyDgvMask and the guarded rcp/log helpers from ME1, MoH Airborne and TW2.

RCAS and SMAA in Core

  • ENABLE_RCAS (default 0, separate from ENABLE_SMAA) makes Core register "RCAS PS".
  • draw.hpp adds PrepareRCAS() and DrawRCAS().
  • DrawSMAA() now rebuilds its intermediates when the target size changes, not only on swapchain init.

@Izueh
Izueh requested a review from Filoppi October 7, 2026 14:16
@Izueh

Izueh commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

This looks pretty good, only recommendation I have is to move the loading of the new Sharpen/SMAA shaders to Core as well instead of having the game load them. could optionally make a helper function in Draw.hpp to easily call these shaders with parametrized inputs. What do you guys think?

@jhi721

jhi721 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@Izueh moved RCAS to Core

@jhi721 jhi721 changed the title Shaders: Share the SMAA passes, XeGTAO, MacLeod-Boynton, RCAS and dgVoodoo helpers Share the SMAA, XeGTAO, MacLeod-Boynton, RCAS and dgVoodoo code between games, and draw RCAS from Core Oct 7, 2026
@Izueh

Izueh commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@garamond13 just give your thumbs up if you don't mind relating the GTAO changes to your games.

@garamond13

Copy link
Copy Markdown
Collaborator

Maybe make it optional to define own float3 XeGTAO_ComputeViewspacePosition(float2 screenPos, float viewspaceDepth), I'm having situation in Bioshock (original) where it's most conviniet to reuse games way of getting viewspace position.

Maybe make denoising opional, in some games it's convinient to rely on games own denoiser. It's done in Dishonored 2.

just give your thumbs up if you don't mind relating the GTAO changes to your games.

All fine with me.

@jhi721

jhi721 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@Izueh @garamond13 done

@Izueh
Izueh merged commit 1dc0180 into Filoppi:main Oct 10, 2026
9 of 10 checks passed
@jhi721
jhi721 deleted the pr/shared-hlsl-includes branch October 10, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants