PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.46k stars 1.59k forks source link

[BUG]: NFL 2K5 - Facemask Not Affected By Custom Texture #5626

Closed xflamexofxhopex closed 2 years ago

xflamexofxhopex commented 2 years ago

Describe the Bug

When the helmet textures dump, they include a square where it indicates facemask color. A square on it controls the facemask color. However, when we do our custom textures, all but the facemask gets replaced. See attached screenshots. One shows in-game of Falcons and Titans having default facemask colors from the original helmet textures. Also attached is the PNG that is the custom texture, with the facemask area circled by me on each, to show what color they should be. We tested that this area is correct for the facemask color or what should be affecting them by comparing each team's dumped helmet texture.

Also, this issue has been going on since the texture replacement became a thing.

Titans2 76af1cdf684ec8ec-20aa57f78ef3ae97-00005dd3

falconshelmet 48b8c5b516d5bab9-ea6f452ee84e34cf-00005dd3

Reproduction Steps

Play any game, and see. Best to go into replay mode to get even more up close.

Expected Behavior

Facemask should be affected by square highlighted on helmet texture.

PCSX2 Revision

v1.7.2428

Operating System

Windows 10 (64bit)

If Linux - Specify Distro

No response

CPU

i5-7300U

GPU

Intel(R) HD Graphics 620

GS Settings

Default

Emulation Settings

Default

GS Window Screenshots

No response

Logs & Dumps

2K5FacemaskBug.zip

TellowKrinkle commented 2 years ago

Reminder that correlation is not causation. Sure, there's a colored square there. Does that mean it's what the game uses to draw the facemask? No.

If you want to know what a game uses to draw a specific thing, please use RenderDoc (Windows/Linux) or the Xcode GPU debugger (Mac).

I assume this wire mesh looking thing is the "facemask"?

image

Look at the attached texture. What color is it? 8x8 of white pixels. The game does not use textures at all for coloring that, but instead uses colors attached to the vertices that it's drawing. You won't be able to change that with texture replacement, but you might be able to do it by modifying some game assets in the iso. (And no, we don't offer support for how to do that)

xflamexofxhopex commented 2 years ago

Reminder that correlation is not causation. Sure, there's a colored square there. Does that mean it's what the game uses to draw the facemask? No.

If you want to know what a game uses to draw a specific thing, please use RenderDoc (Windows/Linux) or the Xcode GPU debugger (Mac).

I assume this wire mesh looking thing is the "facemask"? image Look at the attached texture. What color is it? 8x8 of white pixels. The game does not use textures at all for coloring that, but instead uses colors attached to the vertices that it's drawing. You won't be able to change that with texture replacement, but you might be able to do it by modifying some game assets in the iso. (And no, we don't offer support for how to do that)

So the square does replace in 2K3 and 2K3 on Dolphin, which has the same texture layout. And when you dump a helmet texture a team like the Redskins or Patriots, it's clear the square I highlighted is the facemas color. If that is the case, why would it not be, here?

xflamexofxhopex commented 2 years ago

Also should add that there is a cut scene where when the quarterback throws his helmet at the bench after he throws an interception, the facemask color is changed.

RedDevilus commented 2 years ago

Different architectures are going to use different methods on how to use textures. I know you want to compare 2 visually similar games but it's not the right way to go on about it.

xflamexofxhopex commented 2 years ago

Different architectures are going to use different methods on how to use textures. I know you want to compare 2 visually similar games but it's not the right way to go on about it.

I gotcha, it's the same devs though and neither them nor EA changed much on their modeling on PS2 Era games, so I wanted to point it out and if not affected by replacement, if someone could point where I could figure that out, even if they pointed me unofficially or privately. Our work on replacement has former NFL players using it now, but sadly no one has ever figured out the files, so this is all we have to revise a classic that almost brought EA sports to their knees. All the devs either died or have no online presence, so its been hard for plenty who have tried, to figure the game's files themselves. Aluigi came close. But not quite. Its pretty much seen as a feat if anyone can figure them out haha. Thank you all though. The work you all have done is incredible.

xflamexofxhopex commented 2 years ago

One more question though. When making the helmet opacity to 0%, the helmet is see through,is there a way to make it a white background when opacity reaches that, or is that just how 2K did the texture? I noticed some wall ads (like the ones in the Saints stadium) become white at 0% opacity and EA does the white on their helmets at 0%, so I was wondering if that's just how 2k did the model or what.

RedDevilus commented 2 years ago

Make sure your alpha channel is at 128 (halving the value and looks gray in file explorer) if that's what you meant.

xflamexofxhopex commented 2 years ago

Yes, tried that. Was fully transparent. I was trying to see if there's a way that bringing the opacity down on the image (I use PS) that it would reduce the reflection on the helmet only on the part I did that to without making it see through.

xflamexofxhopex commented 2 years ago

I was trying to make like a matte effect for the main shell of the helmet (essentially the reflection image not affecting said part of helmet while reflection does affect the logos). I noticed NCAA 06 does this when you do the custom textures, set opacity to 1 on the main shell and leave opacity as is on the logos, so I was just curious if 2k just makes it behave differently. In theory, setting opacity on the shell in PS to 0% should make it fully white as compared to it being see through in game. That was the result I meant, sorry about that

TellowKrinkle commented 2 years ago

If that is the case, why would it not be, here?

That would be a good question to ask the game developers. "Why did you decide to ignore the facemask color patch in the texture and use vertex colors instead?" As emulator developers, all we can really do is look at the game and go "yep, that's what they did".

When making the helmet opacity to 0%, the helmet is see through, is there a way to make it a white background when opacity reaches that, or is that just how 2K did the texture?

If you're trying to affect the application of this reflection texture: 00335_f5003_itex0_02d20_P_8

It's applied with the blending equation SourceColor * SourceAlpha + DestinationColor, which means the only thing that is able to affect how it's applied is its own alpha value.

The game renders to a 16-bit framebuffer, which only gives it 1 bit of alpha. Not much room to store alpha for doing fancy effects.