Closed hrydgard closed 12 months ago
A GE frame dump would be more helpful. Might be some kind of Z fighting...
-[Unknown]
First time creating a dump. Let me know if I've done something wrong.
Even in a PSP playback of that framedump, something funny is happening:
The scene initially is drawn like this, which looks nice and all (2382/4468):
But it then darkens everything one by one (4425/4468) and that's when we've gotten the artifact:
The initial darkening of that specific area occurs at 3414/4468. This actually looks more or less right to me:
But then it touches the same area again at 3437/4468 and 3438/4468, which makes it nearly black and gives it that weird pattern. To confirm, skipping those two draws makes it look as one would expect:
The first darkening is a simple triangle strip, made up of two triangles: | X | Y | Z |
---|---|---|---|
290.119141 | 19.013916 | 2996.390625 | |
279.134521 | 61.373779 | 2979.410156 | |
243.680420 | 24.455322 | 3011.021484 |
X | Y | Z |
---|---|---|
243.680420 | 24.455322 | 3011.021484 |
279.134521 | 61.373779 | 2979.410156 |
231.450928 | 65.311646 | 2994.353516 |
The second two draws are one triangle each with: | X | Y | Z |
---|---|---|---|
231.450928 | 65.311646 | 2994.353516 | |
290.119141 | 19.013916 | 2996.390625 | |
279.134521 | 61.373779 | 2979.410156 |
X | Y | Z |
---|---|---|
243.680420 | 24.455322 | 3011.021484 |
290.119141 | 19.013916 | 2996.390625 |
231.450928 | 65.311646 | 2994.353516 |
While these are technically the same points, the triangle is drawn in a different order (first is TR BR TL, TL BR BL, second is BL TR BR, TL TR BL.) This is done as well with a >= depth test, and I think the depth ends up being slightly different because of the order (actually doesn't matter because the texture would make it ugly anyway just on == depth.) Anyway, the texture is different and I think this was intended to be the other side. Both are the same clockwise order, so there's no face culling.
And just to confirm, I tried quickly stripping these two triangles out and running on a PSP, which does look good:
It might be there's some CPU emulation bug causing the game to do these extra triangles, but to me this looks like a game bug.
-[Unknown]
Interesting. If it's indeed a game bug like tha, but the Z fighting glitches just look a bit different than on the real PSP, yeah, there's probably not much worth doing here...
Somewhat oddly, neither pixel nor vertex depth rounding does anything to improve the look of it on PowerVR, and it does look weirdly worse there. Still, I don't see that we have any good options here, and given that it also does appear to be a game bug, I'm going to close this.
Reported by
perhaps
on Discord.Game: Lego Harry Potter Y1-4
Device: Galaxy A21, Vulkan
Tested on 1.14.4 and latest build.
Nearby save:
ULUS10500DATA00.zip
Occurs in the Chamber of Secrets (2nd door), quest Collecting Ingredients