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

silent hill shattered memories, the torch does not shine the road. #6265

Open
daniel229 opened this issue Jun 9, 2014 · 58 comments
Open

silent hill shattered memories, the torch does not shine the road. #6265

daniel229 opened this issue Jun 9, 2014 · 58 comments
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@daniel229
Copy link
Collaborator

simulate block transfer on/off not help
ppsspp
02

psp
201406091259_002

@daniel229
Copy link
Collaborator Author

@daniel229
Copy link
Collaborator Author

looks like is this thing.
03

@unknownbrackets
Copy link
Collaborator

Hmm, it has a stencil test that zeros except on depth fail. Is the depthtest enabled? It's also using maskalpha (theoretically we could partially implement this using glStencilMask.)

-[Unknown]

@daniel229
Copy link
Collaborator Author

Yes,it's enabled

@unknownbrackets
Copy link
Collaborator

So basically, where the depth test passes, it's supposed to set the stencil/alpha to (a & 0x7f). Where it fails, it's supposed to set it to 0x80 | (a & 0x7f), which might make it brighter or be used in a future stencil test, I guess?

-[Unknown]

@daniel229
Copy link
Collaborator Author

silent hill shattered memories reports
GLES\StateMapping.cpp:449 Unsupported RGB mask: r=07 g=e3 b=000000ff
GLES\StateMapping.cpp:452 Unsupported alpha/stencil mask: fe

silent hill zero reports
GLES\StateMapping.cpp:452 Unsupported alpha/stencil mask: 7f

@brujo5
Copy link

brujo5 commented Jun 27, 2014

same problem in silent hill origins.

torch working fine only in the begining
img_0034

in the hospital/roms or any place,torch only iluminate character/some items
img_0036

is a bit unplayable in some are to dark.

real psp torch
img_0038
img_0037

@ASSauLTxMasTER
Copy link

Man, is this error still present?

@daniel229
Copy link
Collaborator Author

The light need RGB mask implement,JPCSP enable color mak,the light showup.

@ASSauLTxMasTER
Copy link

Wait a second, disabling the stencil test produces this:
ulus10450_00006

Here's Origins:
ulus10285_00001

@daniel229
Copy link
Collaborator Author

Yes,diasable stencil test helps these games.
02

@daniel229
Copy link
Collaborator Author

Disable stencil test also helps brightness in Ultimate Ghosts'n Goblins.

not disable stencil test
03

Disable stencil test
04

@brujo5
Copy link

brujo5 commented Jul 16, 2014

yep dissable stencil fix lintern problem.still a bit slow in some areas.

img_0140

@brujo5
Copy link

brujo5 commented Jul 16, 2014

full enjoying SH games

image

@brujo5
Copy link

brujo5 commented Jul 18, 2014

in forum some user report that:http://forums.ppsspp.org/showthread.php?tid=1576&page=4

i was playing the beginning , no problem, flashlight working properly, until i reach the playground (the first ghost scene) and this occur. some kind of alpha problem, enable 'disable stencil test' fix the flashlight, disabling helps with this alpha problem but mess up with the flashlight Sad anyone? (using v0.9.8-1088)

ulus10450_00002

@ppmeis
Copy link
Contributor

ppmeis commented Jul 22, 2014

Tested with latest build. Stencil hack helps in Silent Hills Origins with lantern light.

@ASSauLTxMasTER
Copy link

I am going to assume this was fixed between build v0.9.9-50-g0279aa1 and the latest one, but it seems that we are getting closer to solving this issue. Stencil Test was not disabled.

ulus10450_00000

ulus10450_00002

ulus10450_00001

@unknownbrackets
Copy link
Collaborator

Could you try exporting a GE debugger dump on PC?

To do this, open the game and select Debug -> GE debugger..., then when it's displaying the scene, press Record in the top right. After a second or so, it'll finish and save a trace of the drawing activity.

After that, check the memstick/PSP/SYSTEM/DUMP folder and it'll have created a file named something like "ULES12345_0000.ppdmp". You can zip that and then drag and drop it into a reply here.

-[Unknown]

@Sonim194
Copy link

Sonim194 commented Dec 13, 2018

Unknownbrackets

I have tested Silent Hill Origins and Silent Hill Shattered Memories in the last stable built(1.7.4) and they seem a little better than the previous built. However, some bugs still existing and I am prepared to help in any way needed. These are the bugs I have found now:

Silent Hill Shattered Memories has now a black line bug, where it appears when the flashlight is on. Besides it, the game has some frame drops when you open a door/load a new scenario.
shm1
When the flashlight is on, no object has a shadow, I have tried to play it with the "Disable Stencil Test" on, but it does not solve the problem and the game gets way more buggier than before.
shm2
The bathrooms in Silent Hill Shattered Memories still bugged.
shm3
In Silent Hill Origins, after reaching for the first time the second floor, you flashlight turns on, but it is not projected in the scenario.
sho1
Silent Hill Origins has the same shadow problem as Silent Hill Shattered Memories has, no object has a shadow at all.
sho2

I am really looking forward to helping you finding and fixing both games, if you need anything, let me know.

@unknownbrackets
Copy link
Collaborator

Well, as noted in my previous comment - a GE frame dump would help a lot.

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]

@Sonim194
Copy link

Here is the dumps I have made:
Silent Hill Shattered Memories(Bathroom):
SHSM(Bathroom).zip
Silent Hill Shattered Memories(Shadow):
SHSM(Shadow).zip
Silent Hill Shattered Memories(Black Lines):
SHSM(Black Lines).zip
Silent Hill Origins(Flashlight Bug):
SHO(Flashlight Bug).zip
Silent Hill Origins(Shadows Bug):
SHO(Shadows Bug).zip

@brujo5
Copy link

brujo5 commented Oct 10, 2021

Opengl
Screenshot_2021-10-10-17-21-24-315_org ppsspp ppsspp
Vulkan
Screenshot_2021-10-10-17-20-23-177_org ppsspp ppsspp

Sd860
Adreno 640
Default settings at 5x resolution

@ghost
Copy link

ghost commented Oct 11, 2021

@hrydgard is worth to add this game to compatibility ini, because it helps mali gpu.

ClearToRAM fix image glitch on opengl if flashlight is enable.

ReinterpretFramebuffers help vulkan to make flashlight work.

I hope this will include in v1.12.3 :)

@ghost
Copy link

ghost commented Aug 25, 2022

This is finally fix @hrydgard thanks 😁👍

Vulkan and OpenGL
Screenshot_2022-08-25-22-04-29-729_org ppsspp ppsspp

Software
Screenshot_2022-08-25-22-04-11-744_org ppsspp ppsspp

@Panderner
Copy link
Contributor

The Flashlight issue still not fixed:
ULUS10450_00000

@ghost
Copy link

ghost commented Aug 26, 2022

The Flashlight issue still not fixed: ULUS10450_00000

What platform and GPU backend? Simulate Block Transfer Effects is ON?

@unknownbrackets
Copy link
Collaborator

See #6265 (comment), which has been buried by tons of screenshots. This probably requires depth texturing, which may not be supported by all GPUs and GPU backends.

That it doesn't work in software implies that there's probably a self-depth-texturing hazard. Could you post a frame dump created from the software renderer?

-[Unknown]

@ghost
Copy link

ghost commented Aug 26, 2022

That it doesn't work in software implies that there's probably a self-depth-texturing hazard. Could you post a frame dump created from the software renderer?

-[Unknown]

Here
ULUS10450.ppdmp.zip

@bslenul
Copy link
Contributor

bslenul commented Aug 26, 2022

Not fixed at all for me either. Windows 10 / GTX 970, seems to still be glitched with any renderer.

Simulate Block Transfer Effects is ON?

Disabling "Simulate Block Transfer Effects" is not a valid solution IMO, it removes almost every shadows produced by the flashlight so yeah the glitches are of course way less visible but it doesn't look good, plus the screen of the in-game phone is completely broken.

@hrydgard
Copy link
Owner

This is known broken, and is one of the things I'm going to be working on soon.

@brujo5
Copy link

brujo5 commented Aug 26, 2022

Why when simulate block transfer is enabled and the black spots appear in the flashlight and if you disable that setting again the spots continue until I increase the resolution they disappear?

@unknownbrackets
Copy link
Collaborator

Here
ULUS10450.ppdmp.zip

In this dump, at 1042/1241 it draws the flashlight stencil (REPLACE/REPLACE/ZERO), and then at 1155/1241 it draws the scratchy lines using stencil testing (a & 0x81) == 0x81. Unfortunately, these spots have 0x80 not 0x81, and it's actually because it was 0x00 / 0x01 at 1042. So it's from earlier.

814/1241 writes 1 bits (RGB masked, stencil masked to write 0x01 only.) It does a self-render of 0x04170000 with a color test for == 0x000000. Some of the pixels in the image at this point have RGB=1, which is why they don't pass the color test. So... it's even earlier.

At 765/1241, it turns a grayscale rendering of the scene into the black. It uses a depth == test, and subtract blending. This is subtracting from colors (no lighting) drawn at 605/1241. But at 765, it's using some texture from RAM to subtract. This seems like a color interpolation accuracy issue with the polygons. Because they don't match the texture exactly, not quite enough color is subtracted and it doesn't exactly equal 000000 later.

The texture is actually I suspect drawn at 260/1241 (to 0x0004c000, strangely), and I suspect copied to RAM from there. It's drawn at 565 with weird looking colors, but the RAM texture is CLUT8 with a simple grayscale ramp, so I suspect the CPU converted the 565 to 8-bit. This drawing of the scene happens at 256x256 and is centered around the area the flashlight can see (clipped on sides and taller.)

So the pattern you see is actually a representation of the color interpolation error, probably, rather than a hazard. I wonder if this is related (after shader bitmasking) to what's happening on some devices with hardware rendering. Tricky that it relies on some specifics of the color interpolation...

Bus texture and scene, different perspectives

-[Unknown]

ghost referenced this issue Sep 29, 2022
…as well.

NOTE: I'm not 100% convinced this is ok, there might be CPU graphics manipulations here.
But in practice, in the current state where shadows don't work, it'll do.

Thanks mrfixit2001.
@ghost
Copy link

ghost commented Sep 29, 2022

The Flashlight issue still not fixed: ULUS10450_00000

See a72a425#commitcomment-85420933

@ghost
Copy link

ghost commented Sep 29, 2022

Software looks good now no shadow glitch in the flashlight.
Screenshot_2022-09-30-07-40-25-34
ULUS10450.ppdmp.zip

@ghost
Copy link

ghost commented Feb 16, 2023

this is also a GPU readbacks issue?

@hrydgard
Copy link
Owner

No, I don't think this effect requires GPU readbacks, though it may currently change the output.

@Konrad1374
Copy link

Konrad1374 commented Nov 20, 2023

on 1.16.6 yesterday it was broken but today was working perfectly.
2080ti(backend: d11)
rendering res: 4x
frameskip off
anisotropic filtering: 4x
texture filtering: auto max quali

@Kleqo
Copy link

Kleqo commented May 5, 2024

DUMP.zip

3 dumps from my phone. First one has no artifacts. The other 2 have 2 different patterns. Same exact spot.

The thing that I noticed is that most times the flashlight works correctly at the beginning. I can turn it on-off without an issue. As soon as I go through a door and turn off-on the flashlight, there's the mess. If I don't turn it off, it will stay fine.

Sometimes I can even make it work correctly on another area by repeatedly turning the flashlight on-off.

@IrfanH495
Copy link

wanted to create an issue but it turns out it already exists
Vulkan
Screenshot_2024-08-01-04-29-22-128
Screenshot_2024-08-01-04-23-09-125
Opengl
Screenshot_2024-08-01-04-28-48-537
Screenshot_2024-08-01-04-24-02-186

@NotASimpleGuy
Copy link

NotASimpleGuy commented Oct 9, 2024

How can I fix it on mobile?

I've looked it up on YouTube but nothing works

@NotASimpleGuy
Copy link

As you can see changing it to open gl or Vulcan it seems the same and touching the developer options doesn't work
Screenshot_20241009_103748
Screenshot_20241009_103736
Screenshot_20241009_103727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

No branches or pull requests