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

Proper DX8 wrapper that only fixes Freelancer compatibility issues #14

Open
3 of 4 tasks
BC46 opened this issue Jul 30, 2021 · 6 comments
Open
3 of 4 tasks

Proper DX8 wrapper that only fixes Freelancer compatibility issues #14

BC46 opened this issue Jul 30, 2021 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@BC46
Copy link
Collaborator

BC46 commented Jul 30, 2021

In Windows 10 update 2004, Microsoft made changes to the DirectX rendering pipeline which caused the lighting in many base interiors to be broken. Additionally, the environment map materials for glass textures no longer work either. This particular issue has been present even before the Windows 10 update 2004.

Currently, we use dgVoodoo2 (a legacy DirectX wrapper) as an optional patch to fix all of the issues mentioned above. Unfortunately, its stability cannot be guaranteed as it may cause stutters, bugs and crashes while playing. Therefore, a custom DX8 wrapper that is both stable and focuses on fixing all of the issues mentioned would be a great replacement.

  • Fix broken base interior lighting
  • Fix glass map reflections
  • Native Anti-Aliasing possibility
  • Native Anisotropic Filtering possibility

Edit:
A DirectX 8 wrapper can be created using the DirectX-Wrappers project. By intercepting the set light calls it's possible to fix the lighting bug directly. Here's a proof of concept: https://github.com/BC46/freelancer-lighting-bug-fix. With this wrapper it's also possible to force native AA and AF within DirectX 8, which is ideal.

Freelancer on Windows 10 update 2004 and later

image

What it's supposed to look like:

image

@BC46 BC46 added the enhancement New feature or request label Jul 30, 2021
@BC46 BC46 changed the title Proper wrapper that only fixes Freelancer compatibility issues Proper DX8 wrapper that only fixes Freelancer compatibility issues Jul 30, 2021
@BC46
Copy link
Collaborator Author

BC46 commented Sep 17, 2021

I found a stable solution that utilizes a d3d8.dll from an older Windows 10 version. Simply add it to the EXE folder of the installation and it'll work. It's so ingenious and I can't believe I never thought of this before.

Download it here: https://www.moddb.com/games/freelancer/downloads/freelancer-broken-interior-lighting-fix

One of the downsides is that it doesn't fix the glass reflection map issue, as that has been a problem long before that d3d8.dll was created. Additionally, other Freelancer-related compatibility issues will still be present since this solution can't be combined with d3d8to9 afaik.

@BC46 BC46 mentioned this issue Sep 25, 2021
@BC46
Copy link
Collaborator Author

BC46 commented Sep 25, 2021

I found a stable solution that utilizes a d3d8.dll from an older Windows version. Simply add it to the EXE folder of the installation and it'll work. It's so ingenious and I can't believe I never thought of this before.

One of the downsides is that it doesn't fix the glass reflection map issue, as that has been a problem long before that d3d8.dll was created. Additionally, other Freelancer-related compatibility issues will still be present since this solution can't be combined with d3d8to9 afaik.

Looks like it is possible to do this with dxwrapper. Unfortunately with my configuration this doesn't seem to work properly elishacloud/dxwrapper#134 . It's possible that I did something wrong here but I'm not sure.

@dmutlu
Copy link

dmutlu commented Aug 29, 2022

Hi, I would like to see if I can replicate the issue. What station did you take your screenshots at? From my own testing, using dxwrapper with the stub, everything looks fine on Planet Manhattan and Newark Station. Thanks.

@BC46
Copy link
Collaborator Author

BC46 commented Aug 30, 2022

Hi, neither Planet Manhattan nor Newark Station are affected by the lighting bug AFAICT. The screenshots from this issue were taken at Freeport 1 in Omega-3 I believe. In case you didn't already know, you can beam yourself there using the base bw01_02_base console command. Though this base interior specifically can be found at other bases too like Southampton Shipyard and Trafalgar Base in New London.

I think the lighting bug is most noticeable at the Liberty Dreadnoughts like Battleship Missouri in New York (base Missouri). At the ship dealer there, you can see that the lighting is very sharp and the shadows seem to look off too. Here's a good before and after screenshot: https://imgsli.com/NzM0ODI.

Also, what version of Windows are you using?

@dmutlu
Copy link

dmutlu commented Aug 30, 2022

Thanks @BC46, I will check out both locations. I am using Windows 10 Enterprise 64-bit (10.0.19041).

@Squall-Leonhart
Copy link

Squall-Leonhart commented Dec 6, 2024

There's common code used between D3D9 and 8 in the fixed function to shader converter that tries to approximate the behavior on unified shader architectures (as a reminder, G80 and later do not have the fixed function and split pixel/vertex shader designs that 8 and 9 were designed with in mind)

The spotlight math in it is rather fragile, so while i've seen comments here and there that its because d3d8 is now auto-promoting to d3d9, this is not the case, I must also point out that now that this has been brought to Microsofts attention the fixes made since might break in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants