open-goal / jak-project

Reviving the language that brought us the Jak & Daxter Series
https://opengoal.dev
ISC License
2.74k stars 165 forks source link

[jak3] Bad eyes on Jak #3459

Closed water111 closed 2 months ago

water111 commented 2 months ago

The eyes on jak are using the wrong textures for drawing the pupil/iris, even after merc texture uploads are enabled.

In renderdoc, it's grabbing this weird rainbow thing instead of the iris texture: image

The iris texture tbp is 179, which is also shared by hud-npcring-bar-01.

I printed out the sequence of texture uploads to 179, and eye rendering:

flush uploads for [ 4] tex-lcom-sky-pre
doing eye for [340] tex-lcom-tfrag
pupil background tex: 179, level-default-minimap/hud-npcring-bar-01
eye done
doing eye for [340] tex-lcom-tfrag
pupil background tex: 4578, common/autoeye-iris
eye done
flush uploads for [351] tex-l0-pris
flush uploads for [401] tex-lcom-pris
uploading tex 179: level-default-pris/bam-iris-16x16 bucket
flush uploads for [461] tex-lcom-sky-post
flush uploads for [563] tex-lcom-water
flush uploads for [568] tex-sprite
flush uploads for [575] tex-warp
flush uploads for [578] tex-hud-hud-alpha
uploading tex 179: level-default-minimap/hud-npcring-bar-01 bucket

I think there are two possible issues:

water111 commented 2 months ago

Evidence for the first one: setting (set! (-> *target* draw default-texture-page) 1) makes sense (it says that target uses the pris tpage), and makes the eyes work. Maybe defualt-texture-page is not being set correctly.