delroth Broken Code ¶ 436 u32 getTexCoord(int i) Wait, why is the TextureCache trying to load from texture stage 1 then?! but it turns out this is normal, the deformation map is loaded to texture stage 5 (hardcoded in the DOL).
Logged that and yes: nothing gets loaded to texture stage 1!. I started to suspect the BP write that loads the texture parameters "did not work" somehow. So apparently we're not using the right texture object when rendering! The GXTexObj that maps to the JPATextureArc is at offset 0x81577bf0 and points to data at 0x80ed0460, but we're loading texture data from 0x0039d860 instead.
Fun fact: "kagerou" means "heat haze" in JP. AK_kagerouInd01 is a 32x32 texture that really looks like a deformation map. Fortunately got me the texture I wanted in less than 10min after I asked him on Twitter.
Unfortunately I don't know how to do that. We can probably use that to see how this texture should look like, by loading it "manually" from the Wind Waker DVD. For this object, it returns "AK_kagerouInd01". Nice feature of JPATextureArc: they have a getName method. Index a map and get a JPATextureArc object stored at 0x81577bec. When this is called, the returned texture ID is used to 3 different objects go through this code path, by breaking each one we can notice that the one "controlling" the heat effect is the one at 0x81575b98.įollowing the path of this object a bit more, we can see that it has a method called "getIndTexId". The parameters used for this call come from the results of methods of JPAExTexShapeArc objects. Let's see how it's loaded!īy NOPing random calls to GXSetTevIndirect, we find a call that when removed breaks the effect completely. Seeing how the heat effect glitches, this deformation texture being wrong looks like a good candidate for the problem. It also does not have any feature that you would expect from a deformation map. Interestingly, when looking at apitrace, the deformation texture was only 4x4 pixels.
An EFB copy texture is created, using the hardware scaler to divide the texture resolution by two and that way create the blur effect.Basic debugging using apitrace shows that the heat effect is rendered in an interesting way: