fgsfdsfgs / sm64-port

PS2, PS3, OG Xbox and DOS ports of sm64-port.
https://discord.gg/7bcNTPK
242 stars 38 forks source link

[Software] Texture glitch with transparent ghosts #83

Closed DrUm78 closed 1 year ago

DrUm78 commented 1 year ago

Software: SM64 decompilation fork: https://github.com/DrUm78/sm64-funkey Hardware: FunKey S device (armv7 32-bit) with 64MB of RAM

Description: The ghosts have a texture glitch when they are transparent: their face texture is not displayed (see screenshot 2). That's not happening when they are opaque (see screenshot 3).

Steps to reproduce:

  1. Use the attached save or use one where you have the ghosts in the castle (sm64_save_file.zip)
  2. Enter the castle and on the right, take the wood door (see screenshot below): IMG_0252
  3. Go to the right to meet the ghost and notice that it's missing its face texture: IMG_0261
  4. Enter the door at the end of the row and meet the ghosts
  5. Notice that their face is properly displayed when they are opaque IMG_0251
fgsfdsfgs commented 1 year ago

Is this only happening on the funkey fork? If not, it's likely missing a decal-mode shader implementation.

DrUm78 commented 1 year ago

I cannot test right now on another platform but my FunKey fork is up to date with your dos branch.

fgsfdsfgs commented 1 year ago

The soft renderer just has a list of shader IDs in it for which to use decal texturing, defined here. It's likely that I either just forgot the shader ID for the translucent Boo face in there or combine_tex_rgba_decal is broken.

DrUm78 commented 1 year ago

Does this shader ID exist so I can try to compile with it?

fgsfdsfgs commented 1 year ago

I don't know it. I'll have to log them in gfx_soft_create_and_load_new_shader and go to that spot in the game.

DrUm78 commented 1 year ago

@fgsfdsfgs I confirm that the issue also happens on Windows DOS port in software mode (built from your repo):

Sans titre

DrUm78 commented 1 year ago

I'm not very familiar with code logging but I tried printf("shader_id=%d\n", shader_id); before line 688 in gfx_soft.c but all I get is a list of numbers that are not similar to the existing shader_id:

shader_id=18874880
shader_id=69
shader_id=512
shader_id=18876928
shader_id=2560
shader_id=27263045
shader_id=1361
shader_id=17059909
shader_id=94374400
shader_id=18874437
shader_id=84168773
shader_id=17062400
shader_id=27265536
shader_id=909
shader_id=17305729
shader_id=18875277
shader_id=52428869
shader_id=52431360
shader_id=27265647
shader_id=18092101
shader_id=127928832
shader_id=85983744
shader_id=52429312
shader_id=153092608
shader_id=153093005
shader_id=153092165
fgsfdsfgs commented 1 year ago

Should be fixed in da5b744.

DrUm78 commented 1 year ago

Fixed. Thank you for your reactivity as usual. 🙏 IMG_0204