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

Syphon Filter: Logan's Shadow black texture in OpenGL when Hardware Transform on #7306

Open
daniel229 opened this issue Jan 10, 2015 · 23 comments
Labels
Depth / Z Issue involves depth drawing parameters.

Comments

@daniel229
Copy link
Collaborator

openGL
Hardware Transform on
02

Hardware Transform off
01

DX
Hardware Transform on
03

Hardware Transform off
04

PSP
201501101246_001

So,the openGL with Hardware Transform off is the most like the one in PSP.

@daniel229 daniel229 changed the title Syphon Filter: Logan's Shadow black texture when Hardware Transform on Syphon Filter: Logan's Shadow black texture in OpenGL when Hardware Transform on Jan 10, 2015
@unknownbrackets
Copy link
Collaborator

Hmm, those light types... is it not displaying them correctly? I guess it's using point and spot. The UVs seem odd, I wonder if it's not handling UV scale properly in the preview / vertices tab.

Hmm.

-[Unknown]

@hrydgard
Copy link
Owner

Spot is rare, we might have bugs in it..

@unknownbrackets
Copy link
Collaborator

Does the software renderer look correct at all?

-[Unknown]

@daniel229
Copy link
Collaborator Author

the light seems stronger in software renderer.
01

@hrydgard
Copy link
Owner

Hm, the shader generation code is very similar between GL and DX but the results come out different. Could it be that it sends an INF or NaN in some lighting parameter, and the two shader compilers generate code that's different enough that those affect the outcome? Hm.

@DonelBueno
Copy link

You can also see in the screenshots that the light glows appear through objects and walls in this game. It's really annoyng.

@hrydgard
Copy link
Owner

@DonelBueno , yeah, it's a typical result of the game reading the z-buffer to figure out whether to draw a light glow or not, which is hard to do correctly and quickly on desktop GL, and impossible on many OpenGL ES 2.0 implementations unfortunately - while trivial in the software renderer.

@DonelBueno
Copy link

What about OpenGL ES 3.0 and DirectX?

@hrydgard
Copy link
Owner

Well, reading back the zbuffer is very expensive on most PC and mobile GPUs that can actually do it, currently, although on beefy PCs we could afford it, it's just a bit tricky to implement, the way PPSSPP works right now. Vulkan / D3D12 might let us do things fast-and-loose like console games can, but we will see.

@unknownbrackets
Copy link
Collaborator

Fast and loose hurray. Let's hope.

I don't think GLES 3.0 can do it either, without extensions (glReadPIxels can't, in GLES3, afaik anyway.) We might be able to bind the depth as a texture and "copy" it to a color texture either via shader or what have you? I expect this would be slow...

-[Unknown]

@hrydgard
Copy link
Owner

Well the tricky part architecture-wise right now is actually detecting that the game is accessing the zbuffer with the cpu. As VRAM is mapped like every other memory and we don't generally check addresses before r/w, we would have to resort to tricks like mapping the memory as inaccessable and trap accesses, which would trigger copying down data from the gpu. Well, of course, unless the game is nice enough to do a block copy from VRAM to RAM first where we could trivially detect the case of copying from a zbuffer, but no idea if games like this do that or not.

@unknownbrackets
Copy link
Collaborator

I know of at least two games that actually texture (with an incompatible format or with depal) from depth. Talk about new complexities in depal.

Yeah, peeking into depth might even be more common than color. But, that's not a problem we don't already have with color.

-[Unknown]

@DonelBueno
Copy link

Are there any other games affected by the lack of being able to read back the z-buffer?

@unknownbrackets
Copy link
Collaborator

#5205 and #6162 at least, also some logs made me pretty sure Simpsons does something with depth as well. Those are the ones I can remember.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

A GE frame dump would help to confirm things here, although it seems pretty clear.

See here for instructions - it's not hard and works on Android too:
https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

You can zip that and then drag and drop it into a reply here.

-[Unknown]

@ghost
Copy link

ghost commented Sep 4, 2021

There's also an issue on training 5 water

VK & OGL

Screenshot_2021-09-04-22-24-44-678_org ppsspp ppsspp

PSP

Screenshot_2021-09-04-22-24-34-571_com vanced android youtube
Dump
syphon filter.ppdmp.zip

@Panderner
Copy link
Contributor

There's also an issue on training 5 water

VK & OGL

Screenshot_2021-09-04-22-24-44-678_org ppsspp ppsspp

PSP

Screenshot_2021-09-04-22-24-34-571_com vanced android youtube
Dump
syphon filter.ppdmp.zip

@Gamemulatorer That bottom screenshot is not taken from the real hardware.

@ghost
Copy link

ghost commented Sep 4, 2021

@Panderner how did you know? 😐🤔

@Panderner
Copy link
Contributor

@Panderner how did you know? 😐🤔

Here's a video taken from real hardware:
https://youtu.be/h2Jg1BEIg7M?t=14

@ghost
Copy link

ghost commented Sep 4, 2021

@Panderner how did you know? 😐🤔

Here's a video taken from real hardware:
https://youtu.be/h2Jg1BEIg7M?t=14

That video wasn't training 5 water.
Here's the source of my ss above https://m.youtube.com/watch?v=hTaZ2frao34&feature=youtu.be

@Panderner
Copy link
Contributor

@Panderner how did you know? 😐🤔

Here's a video taken from real hardware:
https://youtu.be/h2Jg1BEIg7M?t=14

That video wasn't training 5 water.
Here's the source of my ss above https://m.youtube.com/watch?v=hTaZ2frao34&feature=youtu.be

@Gamemulatorer this is not a right footage of this video it's recorded using the emulator.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Sep 4, 2021

From that dump, this is actual rendering:

UCUS98606_#7306_syphon_lighting

Here's software, which looks pretty close except for the line on the left of the UI:

UCUS98606_#7306_syphon_lighting_softgpu

And here's Vulkan, which looks a bit brighter (could be 32-bit vs 16-bit color):

UCUS98606_#7306_syphon_lighting_vulkan

In each case the light looks about the same.

Should we mark this issue as fixed? It could've been fixed by several other lighting fixes, such as the one that fixed Virtua Tennis.

Edit: Oh wait, this was depth related? I guess this latest screenshot is separate?

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Depth / Z Issue involves depth drawing parameters.
Projects
None yet
Development

No branches or pull requests

5 participants