Jump to content
  • 0

Palettes in OoT


SanguinettiMods
 Share

Question

11 answers to this question

Recommended Posts

  • 0

What kinds of palettes do you mean? That is, those of CI-type textures? The coloration of ex. the A/B/C buttons on the interface? There's different things controlled by (or that appear to be controlled by) palettes...

 

Yes, those of CI-type textures, like Link's face textures for example. I found them in the file, but I don't know how to edit them, because I'm not sure how they work.

Link to comment
Share on other sites

  • 0

They're 16-bit RGBA5551 values, either 64 or 256 entries depending on the color depth, so it's 5 bits for red, 5 for green, 5 for blue and 1 (on or off) for alpha. Converting 8-bit RGBA values into 5551 or the other way round needs some bitwise operations, although maybe there's a tool for this, or some image editing software is capable of doing so, not sure. SO has some C# code to convert into RGBA5551, while libbadRDP has C code to convert from 5551 to 8-bit.

 

To 5551: http://code.google.com/p/sharpocarina/source/browse/trunk/MapDev/NTexture.cs#131

From 5551: http://code.google.com/p/ozmav/source/browse/trunk/badrdp/gdp.c#265

Link to comment
Share on other sites

  • 0

Thanks for the help, xdan. I ended up using SO to convert my textures, rather than ZLE2, like I was going to. I want to know, though, if converting all of the textures in the same piece of geometry will keep the textures from being assigned different palettes? This is a problem for animating facial textures.

Link to comment
Share on other sites

  • 0

SO, at least, will always create a new palette for each new texture. With some more logic it should be possible to have it automatically reassign already created palettes to other textures, tho...

 

...like: Texture will be converted to CI -> create the palette -> compare palette colors with existing, converted palettes -> if an existing palette contains at least all the colors of the current palette, use the existing one.

 

Good idea to implement, I suppose, I'll look into it when I get the chance.

Link to comment
Share on other sites

  • 0

You can manually edit the Display List; if I recall, palettes are assigned via a SetTImg command before it's loaded by LoadTLUT. Change the address SetTImg points to to that of your other palette.

 

I'm not sure if that would work, see, I'm talking about animating textures, the only pointers to them are in code.zdata...

Link to comment
Share on other sites

  • 0

The only "pointers" I can find to 0x5500 (Child Link's Face Palette) or 0x5C00 (Adult Link's Face Palette) are the FD commands within their files. I don't think that each of the eye or mouth textures are set up to be pointed to their own palette, just pointed to one in general. I guess I'll have to wait until you implement that addon into SharpOcaina.

Link to comment
Share on other sites

  • 0

The only "pointers" I can find to 0x5500 (Child Link's Face Palette) or 0x5C00 (Adult Link's Face Palette) are the FD commands within their files. I don't think that each of the eye or mouth textures are set up to be pointed to their own palette, just pointed to one in general.

Those 0xFD commands are the pointers. The palette is loaded, then the image is changed to the pointers you mentioned in code.zdata. The colors in each of link's face textures are the same, therefore, only one palette is needed. It is the arrangement of the colors that is changed with the pointers in code.zdata.
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.