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

Red blocks on card pictures in Yu-Gi-Oh! 5D's Tag Force 6. #9457

Closed
mercury233 opened this issue Mar 19, 2017 · 18 comments
Closed

Red blocks on card pictures in Yu-Gi-Oh! 5D's Tag Force 6. #9457

mercury233 opened this issue Mar 19, 2017 · 18 comments
Milestone

Comments

@mercury233
Copy link

qq 20170319202758

This card pic should be like http://yugioh.wikia.com/wiki/File:AtomicScrapDragon-TF06-JP-VG.png , but on my PPSSPP, some red parts have "red block" on it.

1

I'm using ppsspp-v1.3-992-g47a814c-windows-amd64. And I tested on my android device, it have same issue.

@hrydgard
Copy link
Owner

I don't think this is an emulator bug, more likely the image is heavily JPEG-compressed in the game, causing these artifacts. You'll probably see the same thing on a real PSP, though it may be partly concealed by the low resolution.

@mercury233
Copy link
Author

mercury233 commented Mar 19, 2017

-5d829de35c9413ca

-34e8b766427396b3

The screenshot from a real PSP of my friend, don't have the blocks.

That pic on wikia is taken from this game too.

@unknownbrackets
Copy link
Collaborator

Can you try to look at how the game is drawing using the GE debugger?

https://github.com/hrydgard/ppsspp/wiki/How-to-find-a-graphic-issue-with-the-GE-debugger

Maybe this is related to antialiased lines or something.

-[Unknown]

@mercury233
Copy link
Author

ok i will see it

@mercury233 mercury233 reopened this Mar 19, 2017
@mercury233
Copy link
Author

image

Name Value
Lighting enable 0
Light 0 enable 0
Light 1 enable 0
Light 2 enable 0
Light 3 enable 0
Clip enable 0
Cullface enable 1
Texture map enable 1
Fog enable 0
Dither enable 0
Alpha blend enable 1
Alpha test enable 0
Depth test enable 0
Stencil test enable 0
Antialias enable 0
Patch cull enable 0
Color test enable 0
Logic op enable 0
Depth write disable 0

Name Value
Ambient color 9e9e9e
Ambient alpha 0000c1
Material update ambient, diffuse, specular
Material emissive 606060
Material ambient ffffff
Material diffuse ffffff
Material alpha 0000ff
Material specular ffffff
Mat. specular coef 0.000000
Reverse normals 0
Shade model flat
Light mode separate specular (disabled)
Light type 0 type: directional, comp: diffuse + spec (disabled)
Light type 1 type: directional, comp: diffuse + spec (disabled)
Light type 2 type: directional, comp: diffuse + spec (disabled)
Light type 3 type: directional, comp: diffuse + spec (disabled)
Light pos 0 0.000000, 0.000000, 0.000000 (disabled)
Light pos 1 -163840.000000, -327680.000000, 5.000000 (disabled)
Light pos 2 0.000000, 0.000000, 1.000000 (disabled)
Light pos 3 0.000000, 0.000000, 1.000000 (disabled)
Light dir 0 0.000000, 0.000000, 0.000000 (disabled)
Light dir 1 0.000000, 0.000000, 0.000000 (disabled)
Light dir 2 0.000000, 0.000000, 0.000000 (disabled)
Light dir 3 0.000000, 0.000000, 0.000000 (disabled)
Light att 0 0.000000, 0.000000, 0.000000 (disabled)
Light att 1 1.000000, 0.000000, 0.000000 (disabled)
Light att 2 1.000000, 0.000000, 0.000000 (disabled)
Light att 3 1.000000, 0.000000, 0.000000 (disabled)
Lightspot coef 0 0.000000 (disabled)
Lightspot coef 1 0.000000 (disabled)
Lightspot coef 2 0.000000 (disabled)
Lightspot coef 3 0.000000 (disabled)
Light angle 0 0.000000 (disabled)
Light angle 1 0.000000 (disabled)
Light angle 2 0.000000 (disabled)
Light angle 3 0.000000 (disabled)
Light ambient 0 000000 (disabled)
Light diffuse 0 606060 (disabled)
Light specular 0 606060 (disabled)
Light ambient 1 000000 (disabled)
Light diffuse 1 606060 (disabled)
Light specular 1 606060 (disabled)
Light ambient 2 000000 (disabled)
Light diffuse 2 000000 (disabled)
Light specular 2 000000 (disabled)
Light ambient 3 000000 (disabled)
Light diffuse 3 000000 (disabled)
Light specular 3 000000 (disabled)

Name Value
Tex U scale 1.000000
Tex V scale 1.000000
Tex U offset 0.000000
Tex V offset 0.000000
Tex mapping mode gen: tex coords, proj: pos
Tex shade srcs s: 0, t: 0
Tex mode 1 levels
Tex format 8888
Tex filtering min: linear, mag: linear
Tex wrapping clamp s, clamp t
Tex level/bias bias: 0.000000
Tex lod slope 0.000000
Tex func modulate, RGB
Tex env color ffffff
CLUT 08981090, w=0
CLUT format ABGR 4444 ind & ff
Texture L0 addr 09106240, w=512
Texture L1 addr 00000000, w=0
Texture L2 addr 00000000, w=0
Texture L3 addr 00000000, w=0
Texture L4 addr 00000000, w=0
Texture L5 addr 00000000, w=0
Texture L6 addr 00000000, w=0
Texture L7 addr 00000000, w=0
Texture L0 size 512x512
Texture L1 size 1x1
Texture L2 size 1x1
Texture L3 size 1x1
Texture L4 size 1x1
Texture L5 size 1x1
Texture L6 size 1x1
Texture L7 size 1x1

Name Value
Clear mode 0
Framebuffer 00000000, w=512
Framebuffer format 8888
Depthbuffer 00110000, w=512
Vertex type through, u16 texcoords, float positions, u8 indexes
Offset addr 09000000
Vertex addr 09f07ae4
Index addr 09f07c94
Region 0,0 - 479,271
Scissor 0,0 - 479,271
Min Z 002710
Max Z 00c350
Viewport Scale 240.000000, -136.000000, -20000.000000
Viewport Offset 2048.000000, 2048.000000, 30000.000000
Offset 1808.000000x1912.000000
Cull mode front (CW)
Color test pass if (c & 000000) NEVER (000000 & 000000) (disabled)
Alpha test pass if (a & ff) > (00 & ff) (disabled)
Stencil test pass if (00 & 00) NEVER (a & 00) (disabled)
Stencil test op fail=KEEP, pass/depthfail=KEEP, pass=KEEP (disabled)
Depth test pass if src >= dst (disabled)
Alpha blend mode add: src.a, 1.0 - src.a
Blend color A 000000
Blend color B 000000
Logic Op clear (disabled)
Fog 1 100.000000 (disabled)
Fog 2 0.020000 (disabled)
Fog color 404040 (disabled)
RGB mask 000000
Stencil/alpha mask 000000
Morph Weight 0 0.000000
Morph Weight 1 0.000000
Morph Weight 2 0.000000
Morph Weight 3 0.000000
Morph Weight 4 0.000000
Morph Weight 5 0.000000
Morph Weight 6 0.000000
Morph Weight 7 0.000000
Patch division 001010
Patch primitive triangles
Patch facing 000000 (disabled)
Dither 0 001d0c (disabled)
Dither 1 00f3e2 (disabled)
Dither 2 000c1d (disabled)
Dither 3 00e2f3 (disabled)
Transfer src 00000000, w=0
Transfer src pos 0,0
Transfer dst 00000000, w=0
Transfer dst pos 0,0
Transfer size 0,0

X Y Z U V Color
112.000000 200.000000 0.000000 0.000000 384.000000 00000000
112.000000 232.000000 0.000000 0.000000 448.000000 00000000
144.000000 200.000000 0.000000 64.000000 384.000000 00000000
144.000000 232.000000 0.000000 64.000000 448.000000 00000000
176.000000 200.000000 0.000000 128.000000 384.000000 00000000
176.000000 232.000000 0.000000 128.000000 448.000000 00000000
208.000000 200.000000 0.000000 192.000000 384.000000 00000000
208.000000 232.000000 0.000000 192.000000 448.000000 00000000
240.000000 200.000000 0.000000 256.000000 384.000000 00000000
240.000000 232.000000 0.000000 256.000000 448.000000 00000000
272.000000 200.000000 0.000000 320.000000 384.000000 00000000
272.000000 232.000000 0.000000 320.000000 448.000000 00000000
304.000000 200.000000 0.000000 384.000000 384.000000 00000000
304.000000 232.000000 0.000000 384.000000 448.000000 00000000
336.000000 200.000000 0.000000 448.000000 384.000000 00000000
336.000000 232.000000 0.000000 448.000000 448.000000 00000000
368.000000 200.000000 0.000000 512.000000 384.000000 00000000
368.000000 232.000000 0.000000 512.000000 448.000000 00000000

Name 0 1 2 3
World 0 1.000000 0.000000 0.000000 0.000000
World 1 1.000000 0.000000 0.000000 0.000000
World 2 1.000000 0.000000 0.000000 0.000000
View 0 1.000000 0.000000 0.000000 -0.000000
View 1 0.426277 0.904587 0.000000 -0.904587
View 2 0.426277 -0.000000 0.166874 -29.343262
Proj 0 5.656128 0.000000 0.000000 0.000000
Proj 1 0.000000 9.981445 0.000000 0.000000
Proj 2 -0.294998 0.000000 -1.666656 -1.000000
Proj 3 0.000000 0.000000 -26.666504 0.000000
Texgen 0 1.000000 0.000000 0.000000 0.000000
Texgen 1 1.000000 0.000000 0.000000 0.000000
Texgen 2 1.000000 0.000000 0.000000 0.000000
Bone #0 row 0 -2.049988 0.000000 0.000000 -0.000000
Bone #0 row 1 -2.049988 0.000000 0.000000 0.000000
Bone #0 row 2 2.049988 -1.674988 0.190327 0.000000
Bone #1 row 0 -2.049988 0.000000 0.000000 -0.000000
Bone #1 row 1 -2.049988 0.000000 0.000000 0.000000
Bone #1 row 2 2.049988 -1.674988 0.190327 0.000000
Bone #2 row 0 1.000000 0.000000 0.000000 0.000000
Bone #2 row 1 1.000000 0.000000 0.000000 0.000000
Bone #2 row 2 1.000000 0.000000 0.000000 0.000000
Bone #3 row 0 1.000000 0.000000 0.000000 0.000000
Bone #3 row 1 1.000000 0.000000 0.000000 0.000000
Bone #3 row 2 1.000000 0.000000 0.000000 0.000000
Bone #4 row 0 1.000000 0.000000 0.000000 0.000000
Bone #4 row 1 1.000000 0.000000 0.000000 0.000000
Bone #4 row 2 1.000000 0.000000 0.000000 0.000000
Bone #5 row 0 1.000000 0.000000 0.000000 0.000000
Bone #5 row 1 1.000000 0.000000 0.000000 0.000000
Bone #5 row 2 1.000000 0.000000 0.000000 0.000000
Bone #6 row 0 1.000000 0.000000 0.000000 0.000000
Bone #6 row 1 1.000000 0.000000 0.000000 0.000000
Bone #6 row 2 1.000000 0.000000 0.000000 0.000000
Bone #7 row 0 1.000000 0.000000 0.000000 0.000000
Bone #7 row 1 1.000000 0.000000 0.000000 0.000000
Bone #7 row 2 1.000000 0.000000 0.000000 0.000000

Start PC PC Stall State Started Interrupted
0x08A6A1C0 0x08A749DC 0x00000000 Running Yes No

@unknownbrackets
Copy link
Collaborator

Hm. The texture on the left (you can double click to zoom) already seems to have the aliasing problems at that point. Is that right?

If you keep stepping, does it draw anything on top of it to correct for the aliasing? It seems like the problem is baked into the texture already.

-[Unknown]

@mercury233
Copy link
Author

yes,
image

Then those buttons will be drawed, nothing more I guess.
image

I enabled "Save new textures", and in \memstick\PSP\TEXTURES\ULJM05940\new I got

09106240000009096aef0337

which already have the problem.

@hrydgard
Copy link
Owner

hrydgard commented Mar 19, 2017

If the game is using sceJpeg to decompress that picture, this could be a result of the crappy color space conversion we do in sceJpeg.cpp . We don't interpolate the UV the way you should if you want really good results. I would say this is a very minor issue though and probably won't work on that anytime soon, but I'll leave it open.

@hrydgard hrydgard added this to the Future milestone Mar 19, 2017
@mercury233
Copy link
Author

Thank you for this information!

@unknownbrackets
Copy link
Collaborator

We also have two conversions happening here.

We'll decode from JPEG to RGB (within jpgd), then potentially convert that to YCbCr (if sceJpegDecodeMJpegYCbCr was used) and back to RGB again. Could definitely be losing something in that conversion.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Mar 8, 2020

Yeah, ideally we'd use a JPEG library that let us intercept the buffers before the first conversion to RGB, and then do bilinear upsampling during conversion to RGB. Definitely doable, just a bunch of work.

@unknownbrackets
Copy link
Collaborator

#16179 may help this, because the swizzle was wrong in one of the sceJpeg colorspace conversion funcs in a way that might match this pattern. You can try the build from the Checks tab (once it's complete), or if it's already showing as merged, you can use the latest git build.

-[Unknown]

@mercury233
Copy link
Author

ULJM05940_00000
@unknownbrackets The pictures have more glitched color but the red blocks do disappeared

@unknownbrackets
Copy link
Collaborator

Thanks for checking, that's interesting. I wonder if it means DecodeYCbCr needs to use the 2x2 format... just worried what that means for MJpegCsc.

-[Unknown]

@mercury233
Copy link
Author

BB7EBAC0
that is the jpeg dumped with JPEG_DEBUG defined in sceJpeg.cpp

BTW, with JPEG_DEBUG the ubuntu and mac build will fail: https://github.com/mercury233/ppsspp/actions/runs/3212316545/jobs/5251077762#step:10:979

@unknownbrackets
Copy link
Collaborator

Thanks, I just pushed an update with what I'm hoping is a fix to that. I fixed the debug file access too.

I don't know why my tests are behaving weirdly for sceJpegMJpegCsc, but when I copy its output to VRAM and screenshot it, it looks like it does it the normal 2x2 way, so I think the old code was just wrong.

-[Unknown]

@mercury233
Copy link
Author

ULJM05940_00000 (3)
Thank you! It looks nice now.

@unknownbrackets unknownbrackets modified the milestones: Future, v1.14.0 Oct 9, 2022
@unknownbrackets
Copy link
Collaborator

Thanks for confirming, closing as fixed.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants