(Updating...) RECV MODDING BASICS - TEXTURES - Ch.2 (By CBNJ)

Moderators: pcwzrd13, deluxux, VasiliyRS

Post Reply
cbnj
brutal
Posts: 248
Joined: Sat Sep 16, 2023 6:17 am

(Updating...) RECV MODDING BASICS - TEXTURES - Ch.2 (By CBNJ)

Post by cbnj »

PREVIOUS CHAPTER: RECV MODDING BASICS - TEXTURES - Ch.1
https://www.dreamcast-talk.com/forum/vi ... 52&t=17007
-------------------------------------------------------------------
GLOBAL INDEX

Each texture in the game have a global index number wich is only a hex number given to each texture and stored in the texture header to ensure no any repeated texture gets loaded into any of the two texture memory DC uses.

Open pl00.ald and do a string search for PVRT this will take you to the first texture header at offset 49570

Above this byte there is a GBIX header, next a 00000008 value followed by a 00000065 value, this 65 is the global index for this texture and this layout will be the same for every texture we can find in CV game (whit very few almost not existent exceptions).
Attachments
pvrthed.jpg
gbixhed.jpg
8value.jpg
globalidxvalue.jpg
cbnj
brutal
Posts: 248
Joined: Sat Sep 16, 2023 6:17 am

Re: (Updating...) RECV MODDING BASICS - TEXTURES - Ch.2 (By CBNJ)

Post by cbnj »

When game loads a texture it checks if the texture being loaded is already in memory by comparate this numbers, if a texture whit index 65 is already in memory, this texture in memory will be used instead to load it again, really simple, efficent and resource saving.... but a pain for a easy texture modding - altough also brings some advantages when you get the hang of it.

There is some important things to take in count when changin texture global index values.

- the maximum range for a texture will be FFFFFFEF, last 4 bytes are reserved to be used by the console in this and every other existent DC game.

- the system.afs textures have priority over the rest of the textures due system.afs loads before the rooms, this causes the system textures to be overlayed onto every model wich holds the same global indexes as the system ones.

- Texture global indexes will be handled Manualy due export plugings to be unable to export textures whit a very high global index value (some console tools does it tough).

- Global indexes are the only true identifier for textures, the texture table names are irrelevant for the console in cv, if two textures have diferent name but same global index, the firts texture loaded will overwrite the second one, equally if the textures have the same name, if the textures have same names but diferent global index, each texture will be loaded individualy into memory.

Is time to put this to practice!,
Lets make a simple texture mod by modify texture global indexes.
Post Reply