Skip to content

Conversation

TellowKrinkle
Copy link
Member

@TellowKrinkle TellowKrinkle commented Aug 24, 2025

Description of Changes

Avoids using the mulhrsw instruction, since it rounds instead of truncating
Fixes #5898
Helps #11477

Rationale behind Changes

Accurate fog

Suggested Testing Steps

Test the things in the referenced issues

Did you use AI to help find, test, or implement this issue or feature?

Running copilot helped remind me that we had an ARM implementation that needed fixing as well

@TJnotJT
Copy link
Contributor

TJnotJT commented Aug 24, 2025

Tested this on the linked GS dump and ran homedrew tests to compare fogging with PS2. Fogging on SW renderer appears to be hardware accurate now.

fog-test-auto.zip

@TheTechnician27
Copy link
Contributor

Someone with a way to compare images would have to compare, but I think zooming in toward the background, there is a slight difference in fog here between SW master and SW PR.

MGS2 Big Shell cutscene (used the Shell 2 strut in the distant background to the left of the Shell 1 core as a reference):
Metal Gear Solid 2 - Substance_SLUS-20554_20250829210833.tar.gz

Jak 3 title screen (used the mountain the distant background on the left as reference):
Jak 3_SCUS-97330_20250710081632.tar.gz

Also randomly tested SSX 3, Iron Man, ATV: Offroad Fury, and OutRun 2006 and saw no regressions.

@TellowKrinkle TellowKrinkle force-pushed the AccurateFog branch 2 times, most recently from f4cc23f to 42d74b3 Compare August 31, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: FOG Inaccuracy
5 participants