fgsfdsfgs / perfect_dark

work in progress port of n64decomp/perfect_dark to modern platforms
MIT License
1.22k stars 75 forks source link

List of broken textures #101

Open Graslu opened 1 year ago

Graslu commented 1 year ago

Updated the thread removing the already fixed textures. Carrington Institute: Base Profile Screenshot 2023 08 26 - 15 29 11 34 dataDyne Defection, Extraction, Mr. Blonde's Revenge (When you shoot out the lights): Base Profile Screenshot 2023 09 03 - 18 29 56 66 Crossbow: image

Graslu commented 1 year ago

Compared to 1964GEPD:

Carrington Institute: 1964 exe Screenshot 2023 08 26 - 15 44 54 69 dataDyne Defection, Extraction, Mr. Blonde's Revenge: 1964 exe Screenshot 2023 09 03 - 18 50 34 91 Crossbow: image

Graslu commented 1 year ago

Another one on Crash Site: fixed

ghost commented 1 year ago

Some of these seem to be caused by lack of texture mirroring and mipmapping (Possibly even both for Defections carpets). Not sure what would cause the second issue in Attack Ship to not render correctly, however.

iamgreaser commented 1 year ago

The corrupted textures in CI and the dataDyne tower are of type I4. (I flipped the green component of each type to check until something showed up.) Not sure what causes it to all be white rather than blue in the CI case, however. Haven't looked into the other cases yet.

Anyway, here's what happens when you force the carpet texture to be 64x16 rather than 32x32: image

Hmm... What about 64x64? image

It doesn't explain why it's misrendered, but I'm suspecting this isn't a bug in the RDP emulation layer.

fgsfdsfgs commented 1 year ago

I think I fixed the CI door thing texture in one of the latest commits. IIRC it was actually CI4. The carpet though I don't know. Definitely size is calculated wrong in the renderer somewhere.

ghost commented 1 year ago

According to the GoldenEye setup editor, the texture for Defection carpets is a 64x64 4bit grayscale mirrored image using a detail map texture.

editor1 editor2

What is likely happening is that the UVs for the carpet are using the detail map UVs, thus making them appear smaller

ghost commented 1 year ago

Is this a similar issue in grid? Looks kind of like the detail map texture too

Screenshot 2023-08-27 135425

Graslu commented 1 year ago

Oh yeah forgot about the multiplayer maps... There's also the computer in the firing range that breaks after you play through a few weapons.

ghost commented 1 year ago

Oh i noticed that too, actually the computer in the start conference room did the exact same thing with the lines going down

Edit: lol is that her office? It sure doesn't look like one, at least i never thought of it as one

ghost commented 1 year ago

Is this a similar issue in grid? Looks kind of like the detail map texture too

grid walls

The setup editor says Grid uses detail maps too so it's likely grabbing the wrong texture.

iamgreaser commented 1 year ago

The computer in the firing range isn't just the only computer that breaks, the one in Jo's office also breaks after some time.

As for the carpet, I did suspect it was using a mirroring mode, but good spotting w/ the detail map. Heck, if the mirroring gets implemented, then it might also fix the bullet holes that appear when you shoot at metal.

Which is to say that this statement

I'm suspecting this isn't a bug in the RDP emulation layer.

may be partially wrong.

fgsfdsfgs commented 1 year ago

See, the problem is mirroring is implemented. It just doesn't turn on.

ghost commented 1 year ago

Is it being detected by the texture itself, or per triangle? Not sure how it's done internally, but the setup editor allows selecting and assigning texture mirroring per triangle. Same with detail map and no Mipmap. It should be working since envmap works, and has the same per triangle system.

LanHikariDS commented 1 year ago

Oh yeah forgot about the multiplayer maps... There's also the computer in the firing range that breaks after you play through a few weapons.

All computers seem to break over time, I'd been meaning to report. The Bar Graph ones break the quickest

iamgreaser commented 1 year ago

The most telling of the breaking computers is the scrolling "text" one. If you wait for enough iterations of the texture to wrap around, you eventually notice that it tends to "lock" at the bottom and it stretches out the top. This suggests that the texture coordinates are getting clamped weirdly.

The result of the bar graph one (dark green on the bottom half, black on the top half) might suggest that it's being animated horizontally.

iamgreaser commented 1 year ago

An update on the monitors: They glitch out differently if you compile the game with Clang.

The bar graph monitors tend to briefly show 2 animation frames of a moire pattern before continuing on as usual. The scrolling text monitors scroll a moire pattern for a few seconds before continuing.

So it seems that GCC will saturate a number here while Clang will wrap it.

fgsfdsfgs commented 1 year ago

-fwrapv should make that behavior the same on both of them, but I'm more interested in where in the code that happens.

ghost commented 1 year ago

Is this a similar issue in grid? Looks kind of like the detail map texture too

grid walls

The setup editor says Grid uses detail maps too so it's likely grabbing the wrong texture.

For sure, this texture is the Borg Crate placeholder texture, originally from Goldeneye.

https://tcrf.net/GoldenEye_007_(Nintendo_64)#Borg_Crate

https://tcrf.net/Perfect_Dark_(Nintendo_64,_Xbox_360)#Borg_Crate

ghost commented 1 year ago

A shoot in the ahem dark. Saw this bug on the gliden64 bug tracker https://github.com/gonetz/GLideN64/issues/158

Saw this too, I remember gliden64 used to have bugs with upscaled stuff https://github.com/gonetz/GLideN64/blob/7dc5b9ffcb0df73952208b528f4c20ed28d9c745/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactoryAccurate.cpp#L28

fgsfdsfgs commented 1 year ago

Worked around the detail texture issue by just skipping them I think. This does not fix all of the textures, so there are definitely more LOD-related issues.

ghost commented 1 year ago

It's a pretty good solution for now, the carpets look much much better

fgsfdsfgs commented 1 year ago

Grid textures should also be fixed now.

Graslu commented 1 year ago

The latest update also fixed the textures on Crash Site, including the mountain one that kept switching back and forth like the Air Base one... Which weirdly enough, is still affected by the same issue.

fgsfdsfgs commented 1 year ago

Might have fixed some more, mostly snow, rain and sparks. The blood splatter texture is now correct, but it still doesn't render quite right.

ghost commented 1 year ago

rain The rain now no longer looks like GTA Definitive edition. Sparks and snow also render correctly too.

Graslu commented 1 year ago

Played through the whole game just now and I could only notice the RC-P90 world model, Crossbow, Attack Ship and Skedar Ruins broken textures, all the rest seem to be working fine now. Will have to check multiplayer soon but I think those are fixed as well.

Forgot to say on the thread that the wooden and metallic bullet holes are also broken as they're not mirroring.

Graslu commented 1 year ago

Ok, I've found this earlier but forgot to report it. The metallic frames / beams in columns turn transparent when the lights go out: (Merged with main post)

1964 GEPD: 1964 exe Screenshot 2023 09 03 - 18 50 34 91

Port: Base Profile Screenshot 2023 09 03 - 18 29 56 66

LanHikariDS commented 1 year ago

Ok, I've found this earlier but forgot to report it. The metallic frames / beams in columns turn transparent when the lights go out:

1964 GEPD: 1964 exe Screenshot 2023 09 03 - 18 50 34 91

Port: Base Profile Screenshot 2023 09 03 - 18 29 56 66

Crap, I found that too, but I didn't know it had to do with the lights, so I assumed it was silently fixed

Graslu commented 1 year ago

Bullet trails seem to be affected by some similar issue to the lasers: (Merged with main post)

image

image

Phnod commented 1 year ago

I noticed that some surfaces are using the wrong texture for the scorched bullet decals. (These screenshots were taken outside of Cassandra's office on the ceiling) When also trying to look at the metal impact issue, I couldn't figure out much, other than it only loading half the texture in memory. Port: 2023 09 16 T(16 25 28)1694895928_pd_ooQ5I9qxHD Original Game: 2023 09 16 T(19 56 41)1694908601_1964_8UwfmiScDd

LanHikariDS commented 1 year ago

It would probably be worth editing the posts to denote which ones are fixed, at least to make this easier to see what's left at a glance.

pHANTOMpHREAK9P commented 1 year ago

Screenshot 2023-10-21 233529 Screenshot 2023-10-21 233547 Screenshot 2023-10-21 233636 Screenshot 2023-10-21 233943

There are pink outlines on the edges of certain faces in the Carrington Institute. Especially on hidden doors (the one in Daniel Carrington's office is also a misaligned texture).

fgsfdsfgs commented 1 year ago

This is not a texture issue, these are seams in geometry. Which ones of them are portal-related and which ones are just there in the level data I don't know. As you can see, they are also visible in 1964GEPD at high enough resolutions: image

Graslu commented 12 months ago

I've updated the thread removing the fixed textures as requested.

fgsfdsfgs commented 11 months ago

Bullet holes, lasers and Attack Ship/Skedar Ruins stuff should be fixed now.

Graslu commented 11 months ago

Updated the thread again, only three left of the ones we noticed at least!

fgsfdsfgs commented 5 months ago

Detail textures should more or less work as of 1d040b1.

Atari-Dude commented 1 month ago

Just noticed this; the Crossbow's bolts texture is also broken. PC port: image N64: image