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

Gensou Suikoden blur screen #5205

Closed
daniel229 opened this issue Jan 25, 2014 · 41 comments
Closed

Gensou Suikoden blur screen #5205

daniel229 opened this issue Jan 25, 2014 · 41 comments
Labels
Depth / Z Issue involves depth drawing parameters. GE emulation Backend-independent GPU issues
Milestone

Comments

@daniel229
Copy link
Collaborator

OpenGL Rendering
01

Software Rendering looks similar to PSP
02

PSP
201401250936_002

A gif showing Gedebugger processing that from the clear screen to blur screen.
1

@dbz400
Copy link
Contributor

dbz400 commented Jan 25, 2014

It is similar 3rd birthday

@unknownbrackets
Copy link
Collaborator

If you look at the texture tab, is it using a clut any of those times under tex format?

I see it setting the clut addr so that seems likely.

-[Unknown]

@daniel229
Copy link
Collaborator Author

tex format is changing
01
02
03
04

@dbz400
Copy link
Contributor

dbz400 commented Jan 25, 2014

Just wonder if change as follow in statemapping.cpp , helps ? (Note , it is incorrect change , just for testing)

    // Let's not write to alpha if stencil isn't enabled.
    if (!gstate.isStencilTestEnabled()) {
        //amask = false;
    } else {
        // If the stencil type is set to KEEP, we shouldn't write to the stencil/alpha channel.
        if (ReplaceAlphaWithStencilType() == STENCIL_VALUE_KEEP) {
            amask = false;
        }
    }

@daniel229
Copy link
Collaborator Author

background appearing a clear screen last for 3~4 seconds,then blur agains.
01

then
02

@dbz400
Copy link
Contributor

dbz400 commented Jan 25, 2014

I see. Wondering how its look like in framebuffer to memory mode?

@daniel229
Copy link
Collaborator Author

Still blur and a little darker.
01

@dbz400
Copy link
Contributor

dbz400 commented Jan 25, 2014

I see.Looks like only softgpu renders close to PSP .

@dbz400
Copy link
Contributor

dbz400 commented Mar 21, 2014

This should be helped by the Alpha Mask Hack .

@daniel229
Copy link
Collaborator Author

Still blur with Alpha Mask Hack
01

@dbz400
Copy link
Contributor

dbz400 commented Mar 21, 2014

Ooops i think it is same issue as 3rd birthday one .Probably another issue.

@unknownbrackets
Copy link
Collaborator

The alpha mask thing is basically an accident that it works around 3rd Birthday. It doesn't mean this is not the same issue, it just means it doesn't have the same accident.

This is another reason I hate such hacks.

-[Unknown]

@hrydgard
Copy link
Owner

Emulating the PSP GPU 100% accurately using OpenGL is not really possible. We do it anyway because it's worth the speed boost compared to a software renderer. Hacks are inevitable, no matter how distasteful - although the 3rd Birthday one is probably avoidable by catching some CPU clear or something - but that's a hack in itself.

Really need to get around to implementing per-game settings though.

@unknownbrackets
Copy link
Collaborator

See, even you don't know what the real issue is because of a hack. In 3rd Birthday, there's no CPU writes to 0x04154000 after the video ends. However, it is a render-to-texture with a CLUT that is currently ignored. Possibly the same is the case with this game.

It just happens that the alpha mask thing probably makes the render-to-texture transparent, and therefore not blend, and so the CLUT doesn't matter. Or something.

Maybe there are more issues, but there's definitely the CLUT issue.

-[Unknown]

@hrydgard
Copy link
Owner

Ah right, yes :(

I plan to try doing the CLUT thing in the near future, using a texture for the palette lookups.

@unknownbrackets
Copy link
Collaborator

How does this look now with simulate block transfer on and the clut stuff merged? If not right, does the framebuffer size thing help?

-[Unknown]

@daniel229
Copy link
Collaborator Author

No chang with whatever option or with framebuffer size branch.

@daniel229
Copy link
Collaborator Author

add part of the log
N[SCEGE]: GLES\Framebuffer.cpp:709 44044000 V: 480x272, R: 480x272, S: 480x272, STR: 512, THR:1, Z:00000000 = 480x272
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 256x128, R: 240x128, S: 240x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440fc000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 512, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 496x128, S: 496x128, STR: 512, THR:1, Z:00000000 = 496x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440f4000 V: 64x32, R: 64x32, S: 64x32, STR: 64, THR:1, Z:00000000 = 64x32
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 44044000 V: 480x272, R: 480x272, S: 480x272, STR: 512, THR:1, Z:44088000 = 480x272
W[HLE]: HLE\sceMt19937.cpp:37 sceMt19937UInt(08a69188)
I[HLE]: HLE\scePower.cpp:412 222=scePowerGetPllClockFrequencyInt()
N[SCEGE]: GLES\Framebuffer.cpp:709 44000000 V: 480x272, R: 480x272, S: 480x272, STR: 512, THR:1, Z:00000000 = 480x272
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 256x128, R: 240x128, S: 240x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440fc000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 512, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 496x128, S: 496x128, STR: 512, THR:1, Z:00000000 = 496x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440f4000 V: 64x32, R: 64x32, S: 64x32, STR: 64, THR:1, Z:00000000 = 64x32
N[SCEGE]: GLES\Framebuffer.cpp:709 440ec000 V: 128x64, R: 128x64, S: 128x64, STR: 128, THR:1, Z:00000000 = 128x64
N[SCEGE]: GLES\Framebuffer.cpp:709 440cc000 V: 256x128, R: 256x128, S: 256x128, STR: 256, THR:1, Z:00000000 = 256x128
N[SCEGE]: GLES\Framebuffer.cpp:709 44000000 V: 480x272, R: 480x272, S: 480x272, STR: 512, THR:1, Z:44088000 = 480x272

@hrydgard
Copy link
Owner

hrydgard commented Jun 3, 2014

Hm, this looks like some kind of depth focus blur. Perhaps it is clut-texturing from the depth buffer to generate some map which is then used to fade between blurred and non-blurred images? (not seeing proof of that in the log above though...)

@unknownbrackets
Copy link
Collaborator

If you step through the textures, does it use any of these addresses as textures?

04088000
04288000
04488000
04688000

It definitely is doing something similar to the bloom seen in other games based on the above framebuffer stages.

-[Unknown]

@daniel229
Copy link
Collaborator Author

Found one.
02

@hrydgard
Copy link
Owner

hrydgard commented Jun 3, 2014

Alright, then that's what it's doing. Annoying, because we currently have no support for using depth buffers as textures. Should be possible though, although on ES it will require an extension. Or we use MRT and render depth as a color to a secondary target (Dolphin does this in some cases, IIRC) but MRT is also not consistently available on ES...

@unknownbrackets
Copy link
Collaborator

Other games possibly doing the same thing:
http://report.ppsspp.org/logs/kind/644

-[Unknown]

@daniel229
Copy link
Collaborator Author

the blur did not change with the latest build.
01

@daniel229
Copy link
Collaborator Author

Uncheck Simulate block transfer makes the screen clear.
03

@vsub
Copy link

vsub commented Jul 6, 2014

Hmm,yes,I can confirm(0.9.8-1450)
First cut scene of the game and battles are not blurry with that option disabled

@unknownbrackets
Copy link
Collaborator

Just to clarify, this ain't gonna get accidentally fixed. Depth texturing is something special. Don't think it's even possible on my gles device for example.

So anything that makes it work differently may as well be temporary.

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented Jan 25, 2015

In the directx 9 blur
2
opengl do not blur
1

GE debugger
3

v0.9.9.1-1601-gf1bca47 log:
https://gist.github.com/sum2012/32f2d7dd24309ade0f1f

@sum2012
Copy link
Collaborator

sum2012 commented Feb 26, 2015

@unknownbrackets
OpenGL fix in unknownbrackets@b20cd3c

Does Directx 9 also some fix change ?

@unknownbrackets
Copy link
Collaborator

Does this work? I have not really tested it at all.

https://github.com/hrydgard/ppsspp/compare/hrydgard:master...unknownbrackets:d3d9?expand=1

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented Feb 26, 2015

Unlucky,it doesn't work

@Panderner
Copy link
Contributor

Here's a GE Dump:
NPJH50535_0001.ppdmp.zip

For me it's does not blur in OpenGL and Vulkan

@sum2012
Copy link
Collaborator

sum2012 commented Jan 3, 2021

v1.10.3-1459-g678d881a1 only have problem in dx9
https://youtu.be/h15c5GbJcgQ

@sum2012 sum2012 added the D3D9 Direct3D 9 label Jan 3, 2021
@hrydgard hrydgard modified the milestones: v1.12.0, Future Jul 11, 2021
@ghost
Copy link

ghost commented Sep 14, 2021

Maybe this can be fixed by #14833?

@hrydgard
Copy link
Owner

No, it's a different issue.

@hrydgard hrydgard modified the milestones: Future, v1.14.0 Jul 26, 2022
@hrydgard
Copy link
Owner

How is this now? Maybe the Kuroyou/Ratchet fixes were enough to fix this?

@hrydgard hrydgard added GE emulation Backend-independent GPU issues and removed D3D9 Direct3D 9 labels Sep 1, 2022
@hrydgard
Copy link
Owner

hrydgard commented Sep 1, 2022

Looks to me like this is working now, looking at the frame dump:

image

Closing.

@hrydgard hrydgard closed this as completed Sep 1, 2022
@ghost
Copy link

ghost commented Sep 23, 2022

Ca still reproduce using opengl ppsspp bb6919e

Record_2022-09-23-18-38-59.mp4

EDIT: NVM it need simulate block transfer effects to be enable.

ghost referenced this issue Sep 23, 2022
It does run without but looks really bad, don't want reports of this.
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. GE emulation Backend-independent GPU issues
Projects
None yet
Development

No branches or pull requests

7 participants