Author Topic: Rendering Fields without Palettes, any tips?  (Read 2188 times)

dangarfield

  • *
  • Posts: 12
    • View Profile
Rendering Fields without Palettes, any tips?
« on: 2020-08-01 20:12:44 »
Hi all,

I'm just having a look at reconstructing fields on a layer by layer approach for something I'm doing and am adding some code to picklejars' kujata repo. Whilst I do have a few questions that I may post to this community to help me understand and I'm am constantly looking through the Makou Reactor source code for tips, there is something that I just want to run by you.

I've decoded all fields except these:
'blin67_4',
  'nivgate2',
  'nivgate3',
  'nivl_e3',
  'gldst',
  'gldinfo',
  'rckt3',
  'kuro_11',
  'hyoumap',
  'gaiin_6',
  'trnad_52',
  'junone22',
  'rckt32',
  'jtemplc'.

The reason being is that the palette lengths are '12' bits, headers something like:
{
  length: 12,
  palX: 0,
  palY: 480,
  colorsPerPage: 256,
  pageCount: 0,
}

The thing here is pageCount = 0. So there are no palettes. None (other than the 6 colors on the flevel.background.palette object). So my question is, how do we overcome this? How do we get the rendered data? I've tried swapping calculating the colour from the texture value itself instead of accessing a palette, but no luck.

Any ideas? Apologies if I have missed something in Makou Reactor.

Thanks,
Dan

dangarfield

  • *
  • Posts: 12
    • View Profile
Re: Rendering Fields without Palettes, any tips?
« Reply #1 on: 2020-08-02 08:55:51 »
Typo - '12' bits -> '12' bytes

This seems to be happening only on depth 2 tiles.

Also. just to clarify, when I'm saying. When converting the texture to a color directly without a palette, I am:
- Splitting the texture into a array of bytes equal to depth. Eg, depth 1 = 1 byte arrays to get a palette color, depth 2 = 2 byte arrays
- Using the texture byte value, I get the 2 byte array value, and translate this into a colour in the same normal way (5 bit to 8bit).

I'm just getting some funny results:


Any tips?

myst6re

  • *
  • Posts: 625
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Rendering Fields without Palettes, any tips?
« Reply #2 on: 2020-08-07 20:36:41 »
(PC version only)
In palettes, colors are abbbbbgggggrrrrr. In direct color, the format is different: rrrrrgggggabbbbb

dangarfield

  • *
  • Posts: 12
    • View Profile
Re: Rendering Fields without Palettes, any tips?
« Reply #3 on: 2020-08-08 06:21:00 »
Perfect. Thanks!