Skip to content

Fix ship dealer preview window rendering garbage #15

@BC46

Description

@BC46

In the ship dealer preview window, there is a rendering bug that causes some surfaces of the ship to render with a dark-blue tint.

Actual model (no issues):
Image

Model in ship dealer preview window with some surfaces having a dark tint:
Image

This dark tint happens because the ship preview window is rendering garbage data. I was unable to figure out what causes this under the hood because the FL beta renders this window in a similar fashion, but it doesn't suffer from this bug. Eventually I managed to make the discovery that wiping out the call that sets the culling mode to none fixes the bug. After that I talked to Schmackbolzen and we figured out that using the depth test D3DCMP_LESS instead of D3DCMP_LESSEQUAL fixed the problem for the most part too, besides a couple of surfaces that still render incorrectly.

freelancer.exe, 1845A7, 04 -> 02 = use D3DCMP_LESS in ship dealer preview
freelancer.exe, 19E333, 99 -> 96 = wipe out call for setting culling mode to none (volatile approach, use only for testing)

My suggestion is to hook the ship rendering function and set the culling mode to anything other than none while the ship is being rendered. Though this will certainly conflict with #11 because this feature requires the exact same function to be hooked. The problem with this is that I want these to be two separate features that can be disabled independently via the config file in the event that there are issues.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions