-
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
Remaining issues with depth testing precision/clamping #6660
Comments
So, here's a few things about depth based on testing:
-[Unknown] |
8.1 You can actually download the depth buffer with glReadPixels, and you can theoretically upload it by drawing a quad and writing values to depth in the fragment shader. In ES 3.0 you can texture from depth buffers too. Very nice post! |
Right, desktop GL only can download AFAIK. We already do it in the GE debugger. But that doesn't help mobile... Yeah, I was also thinking about trying to use the [-1, 1] clipping and then projecting with depth range trickiness, but I have a feeling there will be complications. But then I'm not sure we can avoid some messiness there if games are using greater magnitude z than 65535... -[Unknown] |
No, glReadPixels exists on mobile. It's glDrawPixels that doesn't. Yeah, I think if we do that the depth buffer will be scaled wrong and if a game uses several minz/maxz settings per frame, results will be very unexpected... |
I meant, it doesn't work for GL_DEPTH_COMPONENT on mobile, even on GLES 3. -[Unknown] |
Hm, I thought it did for some reason. Oh well, can work around it with a depth-texture-to-color pass in ES 3.0 at least... |
Kingdom Hearts: BBS (Android only? I never noticed any problems with it on Win32): I got it in Win7 x64. |
Kingdom Hearts: Birth by Sleep Final Mix Now my issue with buffered rendering has solved after v1.0.1-769-gc4ea4e3 Please test it on Android smartphones... |
#7877 Blazblue Continuum Shift 2 (ULUS10579) |
Random thought: if clipping is disabled, I wonder if depth can go outside the range? Like if I set the range to 32767.5 +- 1.0f. Or my 1.5f example above. Hmm. -[Unknown] |
I wonder if we could use -[Unknown] |
GL_DEPTH_CLAMP is not universally supported though, would be nice to do without it.. |
So did some more testing, and found something interesting. If I set the depth range to 32769.0 +- 32767.5, then that should set my range to [1.5, 65536.5], right? Except that any fragments outside [0, 65535] will get discarded based on the minz/maxz test. Anyway, in this situation, z = -1 maps to 0002, and z = 1 gets discarded. As expected. But, So then I realized I had not sent a In other words, using the numbers above, z = -1 still maps to 0002, but z = 1 maps to FFFF now instead of getting discarded. Note again that I have maxz set to FFFF, I'll test with it different... confirmed, if I set maxz to FFFE, then z = 1 does get discarded even with GU_CLIP_PLANES on. So... yeah. -[Unknown] |
Okay, so after thinking about this, here are my ideas:
-[Unknown] |
Valkyria Chronciles 2 is also affected by the rounding / clamping issue: http://forums.ppsspp.org/showthread.php?tid=433&pid=116239#pid116239 -[Unknown] |
I added some additional notes in #12058 based on further testing. -[Unknown] |
This still an issue? |
I think the depth behavior on the PSP is mostly simulated now (just that some devices can't handle it), and working well on a range of devices. We still have some issues but they're separate already and I think the issues this was tracking are generally all fixed. So, going to close it. -[Unknown] |
A lot of games still have depth problems, so let's gather them here for a meta-issue, but not ones that need OpenGL 3 (Jeanne, Danball, Saint Saiya), since that's a limitation of hardware.
Cars - Race O Rama: #4112Kingdom Hearts: BBS (Android only? I never noticed any problems with it on Win32): #3058Phantom Brave: #4064Phantasy Star Portable 1: #3777Phantasy Star Portable 2: #1788Puyo Puyo Fever 2: #3663NBA 2K13 (possibly? We need someone to look at it): #6603Ratchet & Clank: #6105Dream Club Portable (possibly?): #6497
Blazing Soul Accelate: #4665Pilot Academy: No issue created yet (NPC planes can be seen crossing in front of buildings they should be going behind)
I've marked some games as "possibly?", as I'm not entirely sure if their problems are depth related or not. We can discuss that in the comments.
Note: This is not an issue to ask for fixes, ETAs, etc. I know some games are quite desirable to be fixed, but please, let's keep it on topic.
The text was updated successfully, but these errors were encountered: