GoomiiV2 / TS-ReSplit

Reverse Engineering TimeSplitters games to make an assest compatable engine
MIT License
2 stars 0 forks source link

Correct texture loading, odd spots on some textures #2

Closed GoomiiV2 closed 5 years ago

GoomiiV2 commented 5 years ago

Currently the PS2 texture loader works well for the most part but has glitches on some pixels in some textures and need more investigation.

Here is how a texture should be as it is on the PS2 version. PS2 Ingame

And here it is in ReSplit: Unity_qDp0MmwYSH (The PS2 version is brighter due to an overlay blend)

Can see the dark spots in ReSplit version that aren't present in the PS2 version.

It seems to affect palette entries where the Red, Green and Blue channels are all the same value, eg. 20, 20, 20. Perhaps the bbp isn't quite 8 per channel, I tried a few others but none seem to fit either.

This TS2Img tool has the option now to create a debug texture to help debug this

eg, DebugOut

GoomiiV2 commented 5 years ago

Fixed, GARRRRGHHH This was annoying, the palette is swizzled! So the pixel indices were expecting different colors to those that you get if you treat the palette as a linear array.

The Indices should have bits 3 and 4 swapped with each other to get the correct swizzled index. SO what I did was swizle the CLUT on load so that the indices are now pointing to the colors they expect.

Looks good now :D

image

Fixed in: 6c3b3417eb9a853f9a21b145c89dcc68550c0e1e