-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Flickering block in ATV Offroad Fury Pro (mipmapping) #8481
Comments
Pretty sure this is an issue with mipmapping. Tex filtering min: linear, mipmap linear, mag: linear Because it's grayscale, and using add src * dst + src * dst, the lower mipmap levels are darker. Without the slope bias, we sometimes use the wrong miplevel. -[Unknown] |
It's currently flickering in softgpu - and using slope. So this probably indicates that slope is more complicated after all (maybe it takes into account w or something?) Here's a video, just so we can be sure it's not a game bug. It's clearly not flickering: The texture is 0x040e5b40. It's pretty clear that from far away, it should be using the higher (smaller) mip levels, and closer it should be using the nearer ones, which fixes it. Otherwise, it looks far too grainy and flickers (in GLES and in softgpu.) -[Unknown] |
So this is still can reproduce |
How does this look with "Auto Max Quality" texture filtering? (not that that would be a fix, but at least a workaround) |
My screen recording here #14984 (comment) is already using "Auto Max Quality" vulkan backend. |
ge dump in case you needed. |
OK, thanks. Will look into this after the 1.12.x releases are done.. |
Still flickering and the driver graphics is now pink. Record_2022-09-14-17-49-16.mp4 |
I can also reproduce this issue on software mode. |
Now it's black using the latest build 4b165f9 |
Software is correct now using the latest build 913ba9d |
Alright, what's actually going on (barring all the z fighting issues and stuff above, which I do not see): It draws the level in chunks, first the base layer which is a low resolution texture of the whole level, then it applies a repeating detail texture on top, which brightens things - and this is a problem because it only applies it on blocks that are up to a certain distance from the camera, it seems. So this brightening is visibly flickering into existence. ATV.Offroad.popping.textures.mp4These detail textures are drawn on top using the following rather odd blend setup: We can ignore alpha here since it's not used as a color factor. But the colors themselves are, and effectively this means:
The fourth mipmap, however, at 8x8, is full with color 128. So if the game uses trilinear filtering, and makes sure that at the distance where the fourth mip kicks in is less than the distance at which is culls these draws, then the brightness mismatch would at least just fade in instead of pop. And this seems to be what's happening - in the software renderer, the ground is unnaturally brighter close to the camera using this effect. It doesn't look bad actually, might even be intended. Fixing this in higher resolutions in a way that looks good is non-trivial - if we just push the mip bias to match, we'll pick very low resolution mipmaps and the ground will look blurry. The best fix here is likely to be a texture replacement. In the meantime, playing on a fast PC using the software renderer will be the best experience here. |
I'll note that we do have a slightly inaccurate slope implementation in software that is not implemented in hardware rendering. See #16276 (d18fc5c.) In hardware, we force it to auto. It doesn't have to be a fixed push of the mip bias, the game is already providing the slope to indicate that. -[Unknown] |
Yeah, that's true - implementing the slope should help - though hopefully the game will only use it on this detail texture and not the base texture, which will in such a case still be condemned to blurriness in the distance. |
Also in the demo.
demo download (NOTE: broken link)
https://drive.google.com/file/d/0BzGZGDfFE68zUG9KT2YxV1J1azg/view?usp=sharing
savestate for demo
https://drive.google.com/file/d/0BzGZGDfFE68zNHZ3eVluOEtTZ3c/view?usp=sharing
GE debugger
https://gist.github.com/daniel229/170dce2a1478697b6c8b
The text was updated successfully, but these errors were encountered: