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

Hokuto no Ken Raoh Gaiden Ten no Haoh black screen #7932

Open
daniel229 opened this issue Aug 30, 2015 · 37 comments
Open

Hokuto no Ken Raoh Gaiden Ten no Haoh black screen #7932

daniel229 opened this issue Aug 30, 2015 · 37 comments
Labels
D3D9 Direct3D 9 Depth / Z Issue involves depth drawing parameters. OpenGL
Milestone

Comments

@daniel229
Copy link
Collaborator

Accidentally fixed for D3D9 in #7920 ,Broken by the last commit 488c62e

GEdebugger
01

more tabs
https://gist.github.com/daniel229/90091277dabb78e0b1bc

@hrydgard
Copy link
Owner

Also broke Wipeout menus, probably related. I will look into it...

@daniel229
Copy link
Collaborator Author

With 08b340f ,still black screen,but the loading screen displayed.

@unknownbrackets
Copy link
Collaborator

Does anything change if you modify this in GLES_GPU.cpp:

    if ((!gl_extensions.IsGLES || gl_extensions.GLES3) && PSP_CoreParameter().compat.flags().PixelDepthRounding) {
        features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;

To just:

    if ((!gl_extensions.IsGLES || gl_extensions.GLES3)) {
        features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;

Or add it to the ini to see, either way. Just wondering if depth values change things.

-[Unknown]

@daniel229
Copy link
Collaborator Author

Nothing change

@unknownbrackets
Copy link
Collaborator

It's interesting that the Z is -1.562500 in the vertices list. Clip is enabled too, but depth write is disabled.

If you go back to a working build, does the Z column in the vertices list show a different value?

-[Unknown]

@daniel229
Copy link
Collaborator Author

This is the working build, Z is the same.

1

https://gist.github.com/daniel229/37da3fa223bfe87bb7b8

@unknownbrackets
Copy link
Collaborator

If you revert just the StateMappingDX9 part of 488c62e, does it work again?

-[Unknown]

@daniel229
Copy link
Collaborator Author

No,it need to revert 7b0a31a

@unknownbrackets
Copy link
Collaborator

Oh okay, but if you remove that offset entirely, it draws fine?

In OpenGL, when it's about to draw the things that are missing in Direct3D9, can you flip OFF the "depth write disable"? I want it to write the depth value. After it's drawn, you can switch to the "Depth" tab, and hover over the areas it drew - I'm just wondering what the value comes out to.

-[Unknown]

@daniel229
Copy link
Collaborator Author

No,it it need to revert all things before 7b0a31a

like this?
01

@unknownbrackets
Copy link
Collaborator

Yes, I think, but make sure "Depth write disable" shows 0 before the draw (double click it.) And after the draw, move the mouse over the part that WAS red, it should replace the "Depth: 0x00088000 (1920x1080)" text with the depth value under your mouse cursor.

-[Unknown]

@daniel229
Copy link
Collaborator Author

But Depth write disable is always 0.
04

@unknownbrackets unknownbrackets added the Depth / Z Issue involves depth drawing parameters. label Dec 30, 2015
@dan83sama
Copy link

In software mode menus show prefect, and Z = 1,

http://i.imgur.com/j6TgCG5.png

@unknownbrackets
Copy link
Collaborator

Hmm. Has this improved at all in the latest git build? We've made some depth changes.

-[Unknown]

@daniel229
Copy link
Collaborator Author

No,still the same.

@unknownbrackets
Copy link
Collaborator

Does this change make it render?

#8424 (comment)

-[Unknown]

@daniel229
Copy link
Collaborator Author

No.

@unknownbrackets
Copy link
Collaborator

This has clipping enabled, which I've recently discovered does some weird things with depth. Does #8461 help?

-[Unknown]

@daniel229
Copy link
Collaborator Author

No,it doesn't.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jun 3, 2016

I tried to find lowest value it works for the hack I described here and z /= 1.000031 was enough. Don't think there's anything special with this value, through it seems weird that cutting depth by just soo little makes a difference.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Jun 3, 2016

Actually, I think I know why this is happening but it's annoying / tricky to fix. But I'm not sure why it shows -1.5 - it could be I'm wrong.

When rendering, there are two options for depth:

  1. Clamp depth; if it's outside the range of [0.0, 65535.0] after final transforms etc. then clamp it to that range. Never clip based on Z.
  2. Clip depth, not rendering parts of polygons with depth outside [-0.5, 65536.0]. If the depth is between [-0.5, 0.0) then clamp to 0. If the depth is between (65535.0, 65536.0] then clamp to 65535.0.

We do NEITHER of these accurately. Instead, we clip anything outside of [0.0, 65535.0]. Clamping isn't something modern devices like - in general they don't want Z to change after the vertex shader, because if it doesn't change, they can perform early Z tests.

I could be wrong, but my guess is that the PSP (when clipping) is performing early Z tests, but they're inaccurate, and then it falls back to clamping, which it probably always does. It then also has a per-fragment Z test, which allows discarding outside a configurable range as well (which seems mostly accurate.)

Anyway, this game has clipping enabled. And it stopped working when we stopped incorrectly applying a -0.5/65536 offset to the Z. I think Z is falling just outside [0, 65535.0], although again I'm not sure why it shows as -1.5 in the debugger.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Does this work properly in Vulkan or Direct3D 11? It probably won't work in OpenGL or Direct3D 9 as we don't clamp depth there. It may not work on all Vulkan devices.

-[Unknown]

@benderscruffy01
Copy link

goes ingame no problem using Direct3D 11 backend
hokuto

@nassau-tk
Copy link
Contributor

nassau-tk commented Mar 11, 2020

@hrydgard
@unknownbrackets

This issue happen in android(OpenGL) yet.
Screen is Black out any picture not appear.
But,Vulkan is drawing correctly.

I got the dump file.(OpenGL)
ULJM05404_0001.zip

v1.9.3-561

@ghost
Copy link

ghost commented Jun 4, 2020

I got the dump file.(OpenGL)
ULJM05404_0001.zip

v1.9.3-561

Using the dump above.

HW rendering

Screenshot_20200604-170410

SW rendering

Screenshot_20200604-170356

@hrydgard hrydgard added this to the v1.11.0 milestone Jun 4, 2020
@hrydgard hrydgard modified the milestones: v1.11.0, v1.12.0 Dec 1, 2020
@Panderner
Copy link
Contributor

Panderner commented Dec 22, 2020

I used save state for in-game, in OpenGL 3D Models does display but not the 2d textures.
Screenshot_2020-12-22-19-06-24-183_org ppsspp ppsspp

Here's a GE dump:
GE dump.zip

@hrydgard hrydgard modified the milestones: v1.12.0, Future, Future-Prio Aug 29, 2021
@ghost
Copy link

ghost commented Sep 5, 2021

This issue can also reproduce on Vulkan.
Screenshot_2021-09-05-19-46-49-651_org ppsspp ppsspp
recording.ppdmp.zip

@ghost
Copy link

ghost commented Sep 5, 2021

This game hang on SW Rendering during the fight.
Screenshot_2021-09-05-22-11-11-689_org ppsspp ppsspp

Hokuto_No_Ken_Raoh_Gaiden.ppdmp.zip

Debug

<<< log_count = 1503 >>>
[09-03 23:09:55.466 11356:11356 F/DEBUG]
pid: 11163, tid: 11286, name: AndroidRender  >>> org.ppsspp.ppsspp <<<

[09-03 23:09:55.727 11356:11356 F/DEBUG]
      #04 pc 00000000006b84f0  /data/app/~~SlE13pXGaCtZaOaCh6oLFQ==/org.ppsspp.ppsspp-2lwBVG9AWLNVy6z3AEzsTA==/lib/arm64/libppsspp_jni.so (HandleAssert(char const*, char const*, int, char const*, char const*, ...)+248) (BuildId: a44dc90521dc05b22af687988046c386f6b18466)

[09-03 23:09:55.727 11356:11356 F/DEBUG]
      #05 pc 000000000051c310  /data/app/~~SlE13pXGaCtZaOaCh6oLFQ==/org.ppsspp.ppsspp-2lwBVG9AWLNVy6z3AEzsTA==/lib/arm64/libppsspp_jni.so (UtilityDialogInitialize(UtilityDialogType, int, int)+392) (BuildId: a44dc90521dc05b22af687988046c386f6b18466)

[09-03 23:09:55.727 11356:11356 F/DEBUG]
      #06 pc 000000000041c660  /data/app/~~SlE13pXGaCtZaOaCh6oLFQ==/org.ppsspp.ppsspp-2lwBVG9AWLNVy6z3AEzsTA==/lib/arm64/libppsspp_jni.so (PSPSaveDialog::Init(int)+936) (BuildId: a44dc90521dc05b22af687988046c386f6b18466)

[09-03 23:09:55.727 11356:11356 F/DEBUG]
      #07 pc 000000000051cecc  /data/app/~~SlE13pXGaCtZaOaCh6oLFQ==/org.ppsspp.ppsspp-2lwBVG9AWLNVy6z3AEzsTA==/lib/arm64/libppsspp_jni.so (BuildId: a44dc90521dc05b22af687988046c386f6b18466)

[09-03 23:09:55.727 11356:11356 F/DEBUG]
      #08 pc 000000000044c3ac  /data/app/~~SlE13pXGaCtZaOaCh6oLFQ==/org.ppsspp.ppsspp-2lwBVG9AWLNVy6z3AEzsTA==/lib/arm64/libppsspp_jni.so (CallSyscallWithoutFlags(HLEFunction const*)+28) (BuildId: a44dc90521dc05b22af687988046c386f6b18466)

[09-05 16:46:30.844 1371:2284 I/ActivityTaskManager]
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.ppsspp.ppsspp/.PpssppActivity bnds=[44,1511][282,1771]} from uid 10491

[09-05 16:46:30.852 1371:2284 V/ActivityTaskManager]
Starting new activity ActivityRecord{5c530a2 u0 org.ppsspp.ppsspp/.PpssppActivity t310} in new task Task{9134133 #310 visible=true type=standard mode=fullscreen translucent=true A=10552:org.ppsspp.ppsspp U=0 StackId=310 sz=1}

[09-05 16:46:30.867 1371:1396 D/DexOptExtImpl]
org.ppsspp.ppsspp reason is unknown

[09-05 16:46:30.870 1371:1400 D/Boost]
hostingType=pre-top-activity, hostingName={org.ppsspp.ppsspp/org.ppsspp.ppsspp.PpssppActivity}, callerPackage=com.teslacoilsw.launcher, isSystem=false, isBoostNeeded=false.

[09-05 16:46:30.871 1371:1400 I/ActivityManager]
Start proc 8874:org.ppsspp.ppsspp/u0a552 for pre-top-activity {org.ppsspp.ppsspp/org.ppsspp.ppsspp.PpssppActivity} caller=com.teslacoilsw.launcher

[09-05 16:46:30.890 1371:1391 V/WindowManager]
Orientation start waiting for draw, mDrawState=DRAW_PENDING in Window{22edd23 mode=1 rootTaskId=310 u0 Splash Screen org.ppsspp.ppsspp}, surfaceController Surface(name=Splash Screen org.ppsspp.ppsspp)/@0x408287f

[09-05 16:46:31.402 1371:1400 D/Boost]
hostingType=content provider, hostingName={com.android.externalstorage/com.android.externalstorage.ExternalStorageProvider}, callerPackage=org.ppsspp.ppsspp, isSystem=false, isBoostNeeded=false.

[09-05 16:46:31.402 1371:1400 I/ActivityManager]
Start proc 8915:com.android.externalstorage/u0a79 for content provider {com.android.externalstorage/com.android.externalstorage.ExternalStorageProvider} caller=org.ppsspp.ppsspp

@unknownbrackets
Copy link
Collaborator

Yeah, I found a hang bug in the software renderer recently, will push a fix - hopefully it's the cause.

-[Unknown]

@Panderner
Copy link
Contributor

Works fine for me in vulkan:
Screenshot_2021-09-05-23-42-55-990_org ppsspp ppsspp

@unknownbrackets
Copy link
Collaborator

See #12058 - this requires depth clamp.

This is actually a really good example of the behavior I describe in #12058 (comment), since all the points of the graphics it draws here have -1.5f depth, but that's post-viewport.

-[Unknown]

@ghost
Copy link

ghost commented Sep 6, 2021

Works fine for me in vulkan:
Screenshot_2021-09-05-23-42-55-990_org ppsspp ppsspp

IDK but it just blackscreen on my phone using vulkan I file a report #14796

@Panderner
Copy link
Contributor

The title screen displays properly on PC using OpenGL:
Ppsspp Screenshot 2021 09 13 - 00 37 56 07

@Panderner
Copy link
Contributor

At least it was fixed by #14042 only for desktop systems.

@ghost
Copy link

ghost commented Oct 20, 2021

I still got blackscreen on this game both opengl and vulkan. Im using the latest git build ppsspp.apk
:(
Screenshot_2021-10-20-08-43-02-423_org ppsspp ppsspp
recording.ppdmp.zip

@nassau-tk
Copy link
Contributor

Tested on v1.12.3.
My GalaxyS20 is working good on valkan.
OpenGL is coming the black screen.
Both, Meaning at title screen.

Vulkan
Screenshot_20211020-145439_PPSSPP

Screenshot_20211020-144053_PPSSPP

@Panderner
Copy link
Contributor

Umm yes this game requires depth clamp to display 2d graphics properly. Unfortunately mobile OpenGL and Mali Vulkan does not support depth clamp.

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Sep 18, 2022
Helps situations like hrydgard#11216, where only one side should be clamped.
Keeps depth clamp (i.e. hrydgard#7932) working.  See hrydgard#11399.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D9 Direct3D 9 Depth / Z Issue involves depth drawing parameters. OpenGL
Projects
None yet
Development

No branches or pull requests

8 participants