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

Graphics issue: Jak 3 (USA) - SCUS97330 - Corrupted textures and excessive player shadow #168

Closed
Byrkoet opened this issue Jul 26, 2014 · 63 comments · Fixed by #5580
Closed

Comments

@Byrkoet
Copy link

Byrkoet commented Jul 26, 2014

1
2
3

-PCSX2 version:
1.2.1.r5873 - compiled on Feb 3 2014

-PCSX2 options:
Defaults, no settings modifications affect the issue.

-Plugins used:

  • gsdx32-sse4-r5875
  • lilypad-r5875
  • spu2-x-r5875
  • cdvdGigaherz

-Plugin settings:
Tested GSdx DX9/11 hardware;
DX11 seems to make things worse by having more of an impact.
SkipDraw 1 used to remove player shadow altogether.

-Description:
Basically, most textures are corrupted. One great example is the right eye of most characters (also an issue in previous installments of the game).

-How to replicate:
Boot the game and enjoy the black-textured landscape and corrupted eyes and miscellaneous objects.

-Last known version to work:
Unknown, probably never worked.

-PC specifications: CPU:

  • Intel Core i5 650 @ 4.1GHz 54 °C
  • 4.00GB Dual-Channel DDR3 @ 819MHz (9-9-9-24)
  • Gigabyte Technology Co., Ltd. P55-UD6 (Socket 1156) 50 °C
  • 1023MB NVIDIA GeForce GTX 560 Ti (EVGA) 69 °C
  • 465GB Western Digital WDC WD5000AAKX-00ERMA0 ATA Device (SATA) 45 °C

-Other comments:
The graphical corruption, including the missing eye(s), is also present in previous installments, including, but not limited to Jak and Daxter (SCUS97558 & SCUS97124).

@refractionpcsx2
Copy link
Member

DX11 mode making things worse is due to the newer Nvidia drivers not working correctly with PCSX2, downgrading your driver to the 327 series or lower will fix those issues.

as for the missing eyes, i believe this is a known issue, i believe putting GSDX in software mode fixes it.

@ghost
Copy link

ghost commented Jul 27, 2014

This is this unfamous mipmapping bug.

@sudonim1
Copy link
Contributor

The cause of the shadow volumes being displayed is unknown for this engine, previous attempts to debug it have not been productive. The GS does not support actual stencil buffers so game engines have to simulate their functionality in various ways.

@gregory38
Copy link
Contributor

Could you test the shadows issue on the openGL renderer?

@charliebruce
Copy link
Contributor

Latest version 1.3.1 20150813215402 from git, using OpenGL, all default settings except 4x scaling, i7-4702HQ @ 2.2GHz / nVidia 765M / 8GB RAM.

how the transporter should look


Seems that the latest version has fixed some, but not all of the texture issues (water in previous screenshot fixed), but the shadow issue remains. Shadows are not fixed in Jak 1 either.

Re texture issues - eyes sometimes work perfectly, sometimes they work but look in the wrong direction (up not down), and sometimes they are either noise or black. No obvious pattern as to when the eyes do/don't work. Other mipmapping issues are still visible. Jak 1 textures all look fine apart from the eyes (as they do in 1.2.1).

@gregory38
Copy link
Contributor

Increase the level of accuracy blending (likely high). It will normally fix the shadow issue.

@charliebruce
Copy link
Contributor

Just tried all the different blending levels - none of them have any effect on the shadow issue, in Jak 1 or Jak 3.

@gregory38
Copy link
Contributor

Strange. Can someone make me a gs dump of the shadow issue (disable all speedhack in PCSX2)

@Nobbs66
Copy link
Contributor

Nobbs66 commented Aug 14, 2015

i just posted a dump in the gsdx 1.0 thread on the forums

@gregory38
Copy link
Contributor

You know I follow the 2 threads ;) It would have been better to post it here. Anyway I will try to give it a quick look in coming days.

@charliebruce
Copy link
Contributor

@gregory38
Copy link
Contributor

Do you confirm that shadow is broken on SW renderer too?

@gregory38
Copy link
Contributor

Hum, I think I understand the issue for the shadow. I'm not sure that we can emulate it.

The bad draw call have both input texture and render target at the same address (0x3300).
The game renders triangle with basically does Alpha RT = Alpha Fragment * Alpha Texture.
However Texture and RT is the same on the GS but not on the plugin.

So they manage to implement a kind of alpha blending of the alpha channel which is normally impossible on the GS.

@gregory38
Copy link
Contributor

The best will be to allow to read the RT from the shader but it isn't easy.

Just another idea that could work.
1/ detect the effect (RT == Tex and TFX_MODULATE and only_write_alpha)
2/ Create a float texture
3/ Render with blending on with this kind of equation

  • GL_FUNC_ADD
  • GL_SRC_ALPHA: Alpha fragment
  • GL_ZERO
    4/ Convert back the RT to integer color.

We need an unclamped texture because as always alpha range from 0 to 2. However it means clamping won't be accurate. But it could be enough. Otherwise we can still do a 2 pass like the older colclip algo.

@Nobbs66
Copy link
Contributor

Nobbs66 commented Aug 15, 2015

Yes, it's broken in the software renderer as well.

Hmm, didn't know this was such a complex issue.

@gregory38
Copy link
Contributor

On gpu textures are read-only or write-only. Recent GPU (gl4) support RW texture but out-of-order with atomic. Hum I need to check if mult is supported as atomic. Or maybe replace with +/- 1, it must be close of it.

@gregory38
Copy link
Contributor

Yeah no multiplication in atomic. Anyway it won't work neither the blending method above due to rounding.The game uses 127/128 factor to do a -1 and 130/128 to do a +1. Maybe we can replace the draw call with a pseudo colclip.

@gregory38
Copy link
Contributor

@charliebruce
Did you generate the above dump with VU cycle stealing enabled?

@charliebruce
Copy link
Contributor

No, I don't think so - all speedhacks should have been switched off for
both of the dumps I did

On 15 August 2015 at 19:04, Gregory Hainaut notifications@github.com
wrote:

@charliebruce https://github.com/charliebruce
Did you generate the above dump with VU cycle stealing enabled?


Reply to this email directly or view it on GitHub
#168 (comment).

@gregory38
Copy link
Contributor

I pushed a hack for the shadow. Note, it is likely quite slow => UserHacks_AutoFlush = 1

@MrCK1
Copy link
Member

MrCK1 commented Sep 8, 2016

I can test in an hour or so unless somebody else beats me to it :p

@pepiczech77
Copy link

I tested the hack and the shadows are nearly perfect. But from some camera angles they glitch out a bit.
The performance without the hack is about 30fps SW mode, 52fps HW mode.(OGL)
With the hack enabled it's about 25fps SW mode, 13fps HW mode.(OGL)
Intel Core i7-4700MQ
nVidia geforce GT 740M
Windows 8.1
gsdx_20160908212148
screen when the shadows are glitched
gsdx_20160908213953
2x native, now shadows are glitched all the time (about 2fps)

@gregory38
Copy link
Contributor

SW renderer has wrong skin color on Jak3. If you have the issue could you test the PR #1843

@FlatOutPS2
Copy link
Contributor

FlatOutPS2 commented Feb 27, 2017

SW renderer has wrong skin color on Jak3. If you have the issue could you test the PR #1843

It's fixed by PR #1843

@FlatOutPS2
Copy link
Contributor

@gregory38 Jak 3 still has skin issues in Direct3D11 Hardware mode when using upscaling. Direct3D9 and OpenGL are fine, and Direct3D11 is fine on native resolution. The skin issue is basically the same as it was in Software mode, except that the markings are black. Any idea what could be causing it?

@gregory38
Copy link
Contributor

Hum, hum. It could be this one.

void GSRendererHW::OO_Jak()
{
	// FIXME might need a CU_Jak too

Draw call N:

  • the input texture is the CLUT content
  • upscaled output is the frame buffer.

Following draw calls:

  • reuse the upscaled output as CLUT table

It means that texture sampling must be 100% correct otherwise you won't have the good color. A slight rounding and you will get the neighbor texel which contains a wrong color.

@gregory38
Copy link
Contributor

I would advice to just dump all the texture/frame buffers.

@PabloDL
Copy link

PabloDL commented Mar 13, 2017

i don't know if some developer already knows this, but i found that if you put the rendering in software mode, and then return to hardware mode the textures on the sand remain correctly loaded, it works every time, i don't know if its worth mentioning

@gregory38
Copy link
Contributor

Yes because the bug are related to texture cache. Toggling force a reload of all textures from GS memory. If you're​ lucky it might help to fix bug. Or it will create new ones

@Traace
Copy link

Traace commented May 13, 2019

I tested Jax 3 US with current nightly build (crash tag team crc) and a AMD RX 480 on game's native resolution.

Shadows issue still existing for me on opengl hw render and dx11 hw render. When I use dx11 sw render it looks fine, but the sw render is to slow to play.

When I enable UserHacks_AutoFlush = 1 its getting even worse. More shadow bugs, the map under the ship (intro) is just black.

Also dx11 hw render gives me 60fps ~ while opengl hw render gives 20-30 fps ~ (in every game I tested).

@yiays
Copy link
Contributor

yiays commented Mar 16, 2020

I've tested Jak 3 on build 1.5.0-3391, which should be indicitive of performance on the final 1.6.0 release (running on a Ryzen 2400G and a GTX 1060 6GB, at least)

Shadows are 90% fixed in both DX11 and OGL, Eyes are 100% fixed, however DX11 performance is abysmal, while OGL performance is fantastic. The GPU is definitely the bottleneck, I'm able to run at 4x internal resolution scale smoothly on OpenGL with my 1060, but I can barely keep up 60fps at native on DX11.

vlcsnap-error048

@Dreadmoth
Copy link
Contributor

@yiays You can eliminate those shadow issues - use OpenGL (Hardware), set Blending Accuracy to Basic (or higher) and disable the Auto Flush hack.
The Auto Flush hack may also be contributing to the DX11 performance issue (but is necessary for decent shadows on that renderer).

@yiays
Copy link
Contributor

yiays commented Mar 19, 2020

Yep, you're spot on. The auto flush hack causes the unusual shadows in OpenGL, and causes the terrible performance in DX11.

@lightningterror
Copy link
Contributor

Maybe we can do if auto flush on, disable the blending code for jak shadows. Need to ask Greg.

@gregory38
Copy link
Contributor

Auto flush will do a full GS draw by primitive. I.e. we will do a texture cache lookup and downscaling (hence the no pixel perfect rendering of the shadow).

Blending will render primitive by primitive at the GL level. So we skip the expensive texture cache. And we could work at the upscaled resolution hence the better shadow.

@giovanni9793
Copy link

@yiays I have an AMD GPU (RX 580), so I couldn't use OpenGL, so I fixed the shadow problem using Skipdraw Range at 1.

@jokoputera
Copy link

any update in this?

@TheTechnician27
Copy link
Contributor

Update: Within the last couple months, a regression has been fixed in Jak X, and another issue which I don't believe was a regression has seemingly become more limited in scope. Both of these relate to texture corruption. Using latest dev version with D3D11 and OpenGL renderers; tested at both native resolution and 3x (1080p).

  • Regression fixed: In Jak X, the wheels had corrupted, greenish textures, especially prominent when the car is moving. Having looked at all 15 wheel types, this is no longer an issue.

  • Other "fix" (can't tell, but it seems like it): there was a texture corruption issue in Jak X which corrupted the paneling textures on certain panels of certain vehicles. I can't recall exactly which parts and which vehicles, but as of right now, the only two corruptions are on the rear fender of the Howler 99 (no matter which fender style you choose) and the roof panel on the Boomer (no matter which roof panel style you choose). The software renderer eliminates both of these, but they are both present on both hardware renderers.

@SyeThunder
Copy link

SyeThunder commented Jan 23, 2022

Update: Within the last couple months, a regression has been fixed in Jak X, and another issue which I don't believe was a regression has seemingly become more limited in scope. Both of these relate to texture corruption. Using latest dev version with D3D11 and OpenGL renderers; tested at both native resolution and 3x (1080p).

* Regression fixed: In Jak X, the wheels had corrupted, greenish textures, especially prominent when the car is moving. Having looked at all 15 wheel types, this is no longer an issue.

* Other "fix" (can't tell, but it seems like it): there was a texture corruption issue in Jak X which corrupted the paneling textures on certain panels of certain vehicles. I can't recall exactly which parts and which vehicles, but as of right now, the only two corruptions are on the rear fender of the Howler 99 (no matter which fender style you choose) and the roof panel on the Boomer (no matter which roof panel style you choose). The software renderer eliminates both of these, but they are both present on both hardware renderers.

With the 1.7.0 and1.7.2 daily updates (1.7.2260) the green corrupted textures have resurfaced and an intermittent short freezing seems to happen on all hardware renderers, NTSC and PAL copies

Update: editing this as I go through the game again
only certain wheels affected,

@refractionpcsx2
Copy link
Member

I have marked this as fixed by #5580 as the textures and shadows are perfect as of that. However the SW mode regression is still a thing, we're aware of it and I have passed it on to the people who are concerned.

@SyeThunder
Copy link

SyeThunder commented Mar 5, 2022 via email

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Mar 5, 2022

yes please, saying "Minor bugs" doesn't really helps us fix anything.

and GS dumps would be helpful too

@SyeThunder
Copy link

SyeThunder commented Mar 5, 2022 via email

LibretroAdmin pushed a commit to libretro/pcsx2 that referenced this issue Mar 30, 2023
Added dead zone options for L and R gamepad thumbsticks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.