narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
939 stars 70 forks source link

Claw (1997) Sky Background Bug #201

Closed OpenRift412 closed 10 months ago

OpenRift412 commented 1 year ago

So there's a weird bug I've noticed when using DDrawCompat with Claw where the sky background only seems to load in chunks, and the areas of the sky background that haven't loaded just show black. This seems to work fine with dgVoodoo's DDraw, though.

Here is a comparison at the beginning of level 3, checkpoint 2. Notice the black bit near the top of the screen with DDrawCompat.

dgVoodoo: image

DDrawCompat: image

narzoul commented 1 year ago

I cannot reproduce the issue. I played through the entire level without any glitches. Also tried loading that particular checkpoint several times, but it always looks fine.

Is your game patched to v1.3? Are you using default settings with DDrawCompat v0.4.0? Have you tried older releases?

OpenRift412 commented 1 year ago

I cannot reproduce the issue. I played through the entire level without any glitches. Also tried loading that particular checkpoint several times, but it always looks fine.

Is your game patched to v1.3? Are you using default settings with DDrawCompat v0.4.0? Have you tried older releases?

I'm using v1.3, the latest version of DDrawCompat and I just tried with default settings, but nothing fixes it. Older releases of DDrawCompat don't work at all, it just shows a black screen for a few seconds and then crashes.

narzoul commented 1 year ago

Please set LogLevel=debug in DDrawCompat.ini, load that checkpoint, then when it's fully loaded, exit the game via Alt+F4. Upload the log file (compressed if possible). Thanks!

OpenRift412 commented 1 year ago

Here you go: DDrawCompat-CLAW.zip

narzoul commented 1 year ago

It turns out to be a driver difference affecting only NVIDIA. In order to support palettized textures, DDrawCompat replaces the P8 format with L8. But then the drivers seem to disagree on which component of a 32-bit ARGB color should be used for color fills on an L8 surface. AMD and D3D9On12 use the red channel, but NVIDIA uses the blue channel.

One solution is to set both the red and blue channels, which seems to be working for all drivers, but it still seems rather clunky. Instead, I'll replace the L8 format with R8 for now, which at least seems to work consistently on all drivers. Hopefully, it won't introduce other problems.

Here is a test version: ddraw.zip (diff.txt compared to v0.4.0)

OpenRift412 commented 1 year ago

Awesome, that seemed to fix it!

narzoul commented 10 months ago

Fixed in v0.5.0.