Author Topic: Paletted 8bit -> 24bit shading.  (Read 58989 times)

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #45 on: March 12, 2015, 08:29:19 pm »
Holy pixels!
Meridian, thanks!

I hope all this... was made not because I asked :)

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #46 on: March 12, 2015, 08:41:19 pm »
No, it was already done before...

...but I would gladly do it again, if it helps OpenXcom/OpenTFTD development.

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #47 on: March 13, 2015, 08:20:02 am »
Well, results are not too good for TFTD.
Since there are 4 different palettes (terrain, shallow, medium and deep), the "semi-shade" sprites are quite different with different palettes. Sprite with full light is the same, but "shading curves" are too different.

Current algorithm for xcom1 which resembles vanilla by 99%:
- Full light sprite.
- Medium shaded sprite (the 6th grade of shade).
- For shade values 0-6 it takes interpolated result between full light and medium shaded sprites.
- For shade values >6 it takes medium shaded sprite and applying linear shading curve with black clamp (decreasing each of RGB values by some number with each step, red is decreased slowly, so shades are slightly reddish, which is xcom1 visual style).

For TFTD sprites medium shaded sprites are different for each depth. Shading curves also slightly differ (terrain is neutral, and different depths has different slopes with different blue component decreasing speed).

For vanilla 8bit sprites we can generate "medium shaded" versions on battlescape load, and use different shading curves, and result might be not that bad.

But for custom sprites, drawn in 32bits, the artist would need to draw 5 different sprites. Full light, and 4 semi-shaded version for each depth. It's not really nice thing, but currently I can't think of other way, besides giving no fucks on vanilla tftd look and feel and implementing something entierly different.


Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #48 on: March 13, 2015, 09:15:03 am »
that picture you had above looks fine. this is a remake is not vanilla. as close to vanilla as possible is good enough .

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #49 on: March 13, 2015, 10:17:49 am »
This picture above WOULD be achieved only if artists gonna make 5 versions of each TFTD battlescape (shadable) sprite (for custom), or with odrinary 8bit sprites for TFTD palette.

Offline FLIR

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #50 on: March 13, 2015, 09:25:20 pm »
vanilla:

hybrid lighting:



Hello Volutar,

First and foremost: Thank you for caring about such details!

I believe that it is very important to copy the lighting and shading of vanilla TFTD as close as possible. Why? The outstanding thing about TFTD was its atmosphere. And this atmosphere was created mostly through TFTDs great art direction: the vibrant colors, the gloomy underwater shading/lighting, the “weird colorful darkness” of deep sea missions.

I compared the two images on my Eizo: hybrid lighting looks extremely flat and the gloomy atmosphere of vanilla is lost. It almost seems as if ambient occlusion was turned off in hybrid ;). In particular, the lack of darkening on the floor produces a flat and uninteresting image.

Maybe some people don't care about such graphical differences, but I am glad, that someone who cares is working on OpenXcom.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Paletted 8bit -> 24bit shading.
« Reply #51 on: March 13, 2015, 10:39:44 pm »
Am I the only one who can't spot a difference between these two pics, no matter how long I look? :)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #52 on: March 13, 2015, 10:43:45 pm »
i can spot the difference ..there is more blue hue at the top darkness is different in hybrid is more black and clear. darkness in vanilla is more foggy blue. i personally like vanilla look less. also hybrid light is a bit brighter. i like it more hybrid as it's more clear and contrast is higher between dark light. in vanilla is more flat and goes into generic blue hue . tftd is kinda barfy looking anyway. i'm not a fan. i do like some clors in the palette esp blue/green hues and lots of orange/yellows.
« Last Edit: March 13, 2015, 10:46:42 pm by tollworkout »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Paletted 8bit -> 24bit shading.
« Reply #53 on: March 13, 2015, 10:47:11 pm »
Yeah, I can see it now after you've directed me to the right place. But is it really a thing to worry about? Apart from fulfilling a programmer's ambition, which I respect.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #54 on: March 13, 2015, 10:49:46 pm »
not really but volutar wants it faithful to original game look. i personally want it playable and looking good. by looking good doesn't have to be the same as original .  tftd has 4 palettes so is annoying cause the color curves are different you can't use one formula for everything. but maybe you can.

Offline FLIR

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #55 on: March 13, 2015, 11:01:04 pm »
Am I the only one who can't spot a difference between these two pics, no matter how long I look? :)

You have to download and view them in fullscreen. As a fact: only some fully lit objects/tiles are the same; the whole shading of not fully lit areas seems to be different. This will have great impact on the look of deep sea and underwater night missions.


Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #56 on: March 13, 2015, 11:41:35 pm »
i think special effects like bubbles or bullet projectile wake effect can really make it underwatery..you can even add a slight wavy shader effect if you want for more realism

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #57 on: March 14, 2015, 12:15:19 am »
Am I the only one who can't spot a difference between these two pics, no matter how long I look? :)

I can't say I dislike the non-vanilla look. It is more than acceptable. But I can definitely see a huge difference between the vanilla and non-vanilla too.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Paletted 8bit -> 24bit shading.
« Reply #58 on: March 14, 2015, 12:24:39 am »
I can't say I dislike the non-vanilla look. It is more than acceptable. But I can definitely see a huge difference between the vanilla and non-vanilla too.

Yeah, I concur.  I would certainly enjoy playing in that environment.

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: Paletted 8bit -> 24bit shading.
« Reply #59 on: May 05, 2015, 08:01:25 am »
I'm looking at that gif and I'm with FLIR on this one. That's going to make a huge difference in-game even if it's a subconscious one.

If I understand Volutar correctly then the lame version is after doing the whole conversion thing with 5 versions of each tile sprite, so I'm assuming it's even worse before that. Either way I don't see many moders being able to correctly shade different light levels for ambiance.

Would it be possible to apply lighting to 3 different alpha channels for red green and blue, and then use transparency to apply the gradients differently to different colors?

Maybe someone could make a 8-bit X-COM-color GIMP mod, but I just don't see that working out really well.