xenia-project / xenia

Xbox 360 Emulator Research Project
https://xenia.jp
Other
7.95k stars 1.11k forks source link

Texture format (transparency glitch) #1098

Closed Parovozik closed 4 years ago

Parovozik commented 6 years ago

For some games textures without transparency where it should be. Maybe uses incorrect format textures? For example games as RDR (trees, grass), Midnight Club LA (grass), Naruto games (trees, grass), GTA San Andreas (vegetable, wires), MK vs DCU (trees, effects), Asterix at the Olympic games (effects) and more. xenia naruto storm generation mkv_snapshot_02 21_ 2018 03 04_17 34 21 fragment of mk 003 mp4_snapshot_02 14_ 2018 03 04_17 24 42 desktop 2018 03 04 - 17 48 29 01 mp4_snapshot_00 35_ 2018 03 04_20 48 33

Parovozik commented 6 years ago

Here trouble with compressed textures DXT 4_5 which converted for Vulkan as VK_FORMAT_BC3.

/* k_DXT1                   */ {VK_FORMAT_BC1_RGBA_UNORM_BLOCK},
/* k_DXT2_3                 */ {VK_FORMAT_BC2_UNORM_BLOCK},
/* k_DXT4_5                 */ {VK_FORMAT_BC3_UNORM_BLOCK},

bandicam 2018-03-14 09-44-11-796 I tried replaced on other formats, and came to the conclusion that everything is correct here, and the error occurs already in the rendering (the error is that the alpha channel is not used). For example BC4 instead BC3 for DXT5 textures bandicam 2018-03-14 10-11-11-394

DrChat commented 6 years ago

Hmm... Similar issue to Banjo Kazooie (xenia-project/game-compatibility#206)?

Parovozik commented 6 years ago

I see Banjo rendering correct now (remember screenshot with eggs) i will try replace format, but most likely here other format. bandicam 2018-03-10 23-37-21-844

Parovozik commented 6 years ago

I tried Banjo. Eggs uses texture format k_8888. Alpha channel used but slightly glitch with close other obects and depend on view angel. Transparent turn on 1st egg and 2nd too but only one of them:

here is correct:

bandicam 2018-03-19 00-12-26-393

here is incorrect:

bandicam 2018-03-19 00-52-03-571

DrChat commented 6 years ago

Banjo Tooie's issue is that the game isn't properly enabling alpha tests. Most likely a JIT issue.

LuismaSP89 commented 6 years ago

This issue is present too in Bayonetta 2 1

D1SMBD1D commented 5 years ago

Still present on DX12 in many games

352 396 392

Triang3l commented 5 years ago

Not a format glitch — currently kill shader instructions are totally ignored because they don't write anything to registers. The only reason why I'm not fixing it yet is because when I tried to do so, the Vulkan renderer started giving GPU crashes everywhere — the SPIR-V shader translator in Xenia doesn't really support this scenario.

LuismaSP89 commented 5 years ago

Some transparency glitches solved in latest Xenia build, (Bayonetta plants for example)

illusion0001 commented 5 years ago

Now fixed with commit https://github.com/xenia-project/xenia/commit/9dd62c1e1553cf89bb7e3c4779163ec404b9599f

Triang3l commented 5 years ago

Yes, alpha to coverage is implemented on Direct3D.

Xupi413 commented 8 months ago

Forgive my ignorance, but how exactly can I fix this? I have been having this problem with gta iv and it is quite annoying. (i use vulkan)

Triang3l commented 8 months ago

Forgive my ignorance, but how exactly can I fix this? I have been having this problem with gta iv and it is quite annoying. (i use vulkan)

Alpha-to-coverage hasn't been implemented in the Vulkan backend yet, use Direct3D 12 for now.