-
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
IronMan No clipping of 3d characters behind backgrounds based on depth within screen and also performance issue. #16530
Comments
Some weird stuff being drawn at the end of the main renderpass: Additionally apparently 044000 is unusually used as a depth buffer, and it's drawn to as well in the renderpass after the main one, zero sized draws though so no pixels are emitted There's also probably some stuff being done every second frame here, or something - the drawing of the failing-to-depth-test character doens't seem to be happening, it's getting on the screen by a blit from a previous frame. EDIT: Actually it does get drawn here and the depth test properly fails when running the dump, for whatever reason. |
Looks like depth issues with this game is nothing new: https://youtu.be/_6wbMzrbbqY?t=2401 IronMan is clipping through the floor in a weird way that I can't imagine is supposed to happen. The nature of the problem seems to have changed with recent fixes though indeed and there's some puzzle piece missing here... Anyway let's step through the frame. Framebuffer 04000000, texture from 04088000. Five rects drawn. No idea what for? Framebuffer 04088000, depth 04040000, clear all 480x272 Framebuffer 04088000, scene is rendered., color depth 8888 Around draw 528 some block transfers and stuff is going on, block transfering depth. This is something we don't currently support. There's a mix of rectangle prims and block transfers, gonna need to look into this in more detail: After all of that, it draws the iron man character on top of 04088000, and then renders HUD. So presumably it has biased the depth buffer or something to suit it? probably rendered with a different projection or something, who knows why... As part of the weird sequence above, this gets logged: As simple as the game looks, won't be able to solve this before the release. |
In v1.13.2 the character is render properly but there's a clipping issue and also have better FPS. Video_ppsspp_v1.13.2.mp4But in the recently build the game become slow and render incorrectly. Video_ppsspp_v1.13.2-2369.mp4 |
I could do a compat.ini hack that restores the game to how it was in 13.2, I guess (disable color->depth reinterpret, which is what seems to be happening here but only half of the process is working due to the missing block transfers, breaking it). Also, any real solution will make it at least as slow as it is now, unfortunately :( |
Another glitch found I also notice that Opengl performance is better compare to vulkan on this game. |
Here's an edited frame dump of that: It looks the same from a real PSP (I stripped out all the block transfers, etc.): So I don't think that's a bug.
So here's what's happening:
Ultimately, the confusion comes from packing the temp data in the margin, probably because they didn't want to render-to-self (which as we've seen in other games, might've actually worked fine, especially 1:1.) I suspect this entire effect could've been done more efficiently by the game by simply manipulating the viewport Z params with margin, to control clipping and what depth values were written. Or even using max Z, perhaps. Here's an edited version of the original framedump, which uses rendering for all the block transfers: -[Unknown] |
Thanks for the writeup @unknownbrackets . Finally got around to implementing this, it simply took detecting these block transfers and handling them as depth blits (plus allowing it to create and choose a new framebuffer for that margin instead of detecting the color one), the rest just worked. There is a little bit of polygon glitchiness in few locations similar to what @Gamemulatorer reported above, but doens't hinder playability. I'm gonna test on real hardware tomorrow as well. |
Some mobile devices still have issues here plus it runs really slow, reported in #16961. I might look at different solutions for them in the future. |
The no clipping of 3d character behind background is fix in the recently build maybe fix via #16961 I'm loading the game using my savestate. Screenrecording_20230225_002756_org.ppsspp.ppsspp.mp4But the performance is worst in vulkan compared to opengl. |
Is the "clipping" fixed for you in OpenGL too? It's expected that the fix isn't very fast, unfortunately. The game is doing some evil tricks. |
Yes! Screenrecording_20230225_104815.mp4 |
Closing this because the real issue of this game is fix. |
Game or games this happens in
ULUS10347
What area of the game
At the start of the game.
What happens
No clipping of 3d characters behind backgrounds based on depth within screen.
Vulkan/Opengl
Software
What should happen
Must render the graphics correctly.
GE frame capture
ULUS10347.ppdmp.zip
Platform
Android
Mobile phone model or graphics card
Vivo Y11 Android 11 Snapdragon 439 Adreno 505
PPSSPP version affected
v1.13.2-2369
Last working version
v1.13.2+
Graphics backend (3D API)
Vulkan
Checklist
The text was updated successfully, but these errors were encountered: