github holdmysocks/mcla-recomp v1.0.1
v1.0.1: car reflection (lighting) fix, confirmed on PC and PS5

latest releases: v1.0.5, v1.0.4, v1.0.3...
8 days ago

The zip below is everything needed to build the game from your own disc: the build scripts, the SDK patches, the function hints, the host application and the guides. As always, it holds no game code, assets or keys; the build takes those from your own copy of Midnight Club: Los Angeles Complete Edition (USA/Europe, Xbox 360) on your machine.

The lighting fix: cars no longer white with a glow around them

What was wrong. The player's car, and every car with the full paint shader, came out far too bright. At night the whole body was flat white with a bloom halo, and the reflection of the street that the paint should show was buried. By day it was only somewhat too bright. Stock ReXGlue and Xenia Canary show the same thing ("the car reflection bug").

Why. The fault was not in the car shaders but in what they reflect. Each frame the game renders the car's surroundings into a small environment map, and draws every light glow into it (street lights, car lamps, traffic signals, the sun) as a quad of constant colour whose round falloff is in the alpha channel only. Those quads are blended with max(source x SrcAlpha, destination). The Xbox 360's GPU applies the source factor in MIN and MAX blends; Direct3D 12 and Vulkan ignore blend factors there. So on PC and PS5 each glow became a solid square in the light's full colour. At night, dozens of them formed a band of white and red squares around the car, and the paint mirrored it.

The fix. When a render target uses a MIN or MAX blend with a SrcAlpha source factor and a destination factor of One, the translated pixel shader now multiplies its output by its own alpha before writing, so the host's max computes what the console does. It is a patch to the ReXGlue SDK, patches/rexglue-minmax-blend-factor.patch (143 added lines, six files), for both renderers: Direct3D 12, and Vulkan, which the PS5 version uses. Full account: REFLECTION_FIX.md.

How far it has been checked.

Renderer State
Windows, Direct3D 12 Confirmed in game, same spot by night and by day, before and after
Windows, Vulkan Builds and runs; the title-screen city draws with round glows and no shader errors. Not compared before and after in a race
PS5 Confirmed in game on a console, with a build made from scratch by ps5/make_ps5.sh: the reflection problem is gone

Not covered: the pixel-shader-interlock render path (not the default), and the dither pattern on shadows and foliage.

Getting it

New build, Windows (details in docs/pc-build-guide.md):

.\scripts\make_pc.ps1 -Iso C:\path\to\your.iso

New build, PS5, on Arch Linux as root (details in docs/ps5-build-guide.md):

bash ps5/make_ps5.sh --iso /path/to/your.iso --console <console address>

If you already have a build: update (git pull, or unpack the zip over your copy) and run the same command again. The scripts add the patch to the SDK you already have and rebuild only what changed; on PS5 only the title is uploaded again.

Since v1.0.0

  • The fix is confirmed on a PS5. No code changed: the same patch, now checked on a console.
  • Before and after picture in the README.

Also in this release

  • make_pc.ps1 no longer stops at step 3 when the SDK's patch marker file is hidden.

Don't miss a new mcla-recomp release

NewReleases is sending notifications on new releases.