Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS/HW: HLE the Burnout games bloom effect #9336

Merged
merged 3 commits into from Jul 26, 2023
Merged

Conversation

stenzek
Copy link
Member

@stenzek stenzek commented Jul 24, 2023

Description of Changes

Shamelessly stolen from the source because I can't be bothered to re-type it.

Burnout has a... creative way of achieving its bloom effect, to avoid horizontal page breaks.

First they double strip clear a single page column to (191, 191, 191), then blend the main framebuffer into this column, with (Cs - Cd) * 2. So anything lower than 191 clamps to zero, and anything larger boosts up a bit. Then that column gets downsampled to half size, makes sense right?

The fun bit is when they move to the next page, instead of being sensible and using another double strip clear, they write Z to the next page as part of the blended draw, setting it to 191 (in Z24 terms). Then the buffers are swapped for the next column, 0x1a40 and 0x1a60 in US.

We could handle that, except for the fact that instead of pointing the texture at 0x1a60 for the downsample of the second column, they point it at 0x1a40, and offset the coordinates by a page. This would need "tex outside RT", and no way that's happening.

So, I present to you, dear reader, the first state machine within a CRC hack, in all its disgusting glory. This effectively reduces the multi-pass effect to a single pass, by replacing the column-wide draws with a fullscreen sprite, and skipping the extra passes.

After this, they do a blur on the buffer, which is fine, because all the buffer swap BS has finished, so we can return to normal.

Rationale behind Changes

Closes #1415.
Closes #5602.

Before without CRC hack:
image

Before with CRC hack:
image

After:
image

Suggested Testing Steps

Test burnout games. I've tried to make the hack general, so hopefully it'll work across the series for both PAL and NTSC, assuming the effect is implemented relatively similarly.

@DonelBueno
Copy link

Tested on Burnout 3, Revenge and Dominator, it worked fine in all of them, great work =). They are all NTSC versions.

Is there a way to align the effect when running above native resolution?

@JordanTheToaster
Copy link
Contributor

Tested on Burnout 3, Revenge and Dominator, it worked fine in all of them, great work =). They are all NTSC versions.

Is there a way to align the effect when running above native resolution?

I'll be looking at fixing it once it's in.

@ElTioRata
Copy link
Contributor

ElTioRata commented Jul 24, 2023

Tested on Burnout 3 (NTSC), works as intended.

@Mrlinkwii
Copy link
Contributor

works well with the burnout 3 demo

@stenzek stenzek merged commit a9d693e into PCSX2:master Jul 26, 2023
12 checks passed
@stenzek stenzek deleted the burnout branch July 26, 2023 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants