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

softgpu: Correct tex on fogged rectangles #16384

Merged
merged 2 commits into from
Nov 13, 2022

Conversation

unknownbrackets
Copy link
Collaborator

When using fog on a rectangle (transform only), the PSP does this weird snap-to effect that seems like some sort of hardware bug to me. Half the rectangle uses the first vertex fog value - and it's the second half, weirdly.

Anyway, I had implemented that earlier based on hardware fog tests, but forgot to account or test for texture coordinates. This caused smoke in Resistance Retribution (see #16131) to be rendered strangely.

Meanwhile, I also made it skip splitting rectangles in half to account for this weird fog behavior when the fog factors are close enough to be identical for the purposes of fogging. This avoids the split path entirely in Resistance (and would've fixed the bug alone, but good to fix texturing in that path anyway.)

-[Unknown]

If the fog factor would result in the same amount of fog, we're just
adding more work for no reason.
@hrydgard
Copy link
Owner

Truly weird stuff, there seem to be no end to wacky edge cases :) nice fix.

@hrydgard hrydgard merged commit fd43a0e into hrydgard:master Nov 13, 2022
@unknownbrackets unknownbrackets deleted the softgpu-fog branch November 13, 2022 17:57
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.

2 participants