aliens

Author Topic: "grey" fog of war  (Read 30603 times)

Volutar

  • Guest
Re: "grey" fog of war
« Reply #45 on: September 16, 2011, 03:29:37 pm »
Intensive alpha blitting usage will slow fps dramaticaly. Shadows under bullets - probably will be fine, but smoke will require alot more CPU resources. Though same thing with OpenGL will be almost no-cost.

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: "grey" fog of war
« Reply #46 on: September 16, 2011, 04:55:26 pm »
this ISNT alpha bliting :> i simply replace "shade" part from dest pixle by shade from src pixel. color group stay same
Code: [Select]
https://this function will be used for every pixel that is bited
static inline Uint8 func(const Uint8& dest, const Uint8& src, const int& shade, int, int)
{
if(src)
{
int t1 = (dest&ColorGroup) + (((src & ColorShade)+(dest & ColorShade)+ shade + 2)>>1) ;
int t2 = (dest&ColorGroup) | 15;
return (t2> t1)? t1 : 15;
}
else
return dest;
}
it have many limitations. it can be used for shadow, but probably different function could be used instead.
this is very fast function i dont see any big performance loose (i use it only for unit now).
i will soon update my fork of openXcom, if you are interested in my implementation of this :)
« Last Edit: September 16, 2011, 05:01:48 pm by Yankes »

Volutar

  • Guest
Re: "grey" fog of war
« Reply #47 on: September 16, 2011, 06:52:28 pm »
Alpha blitting is totally different. First of all it's a 24bit. Secondly it mixes every pixel from screen with applied, which is quite costy.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2159
    • View Profile
Re: "grey" fog of war
« Reply #48 on: September 16, 2011, 09:10:35 pm »
nice work - alpha blitting !
It would be very nice to add this alpha blitting to the shadows of bullets.
What is the slowdown in fps of this?

anothe usage: to make objects transparent that are in front of a soldier.
Or to make the smoke particles transparent..

I presume it's not actual alpha, he's just using palette tricks so the soldier sprite colors get "added" onto the original tile colors instead, producing a transparent-looking sprite. Probably doesn't affect FPS but you're limited by how far the palette color gradients let you go.

Edit: Whoops didn't notice a page 4...

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: "grey" fog of war
« Reply #49 on: September 17, 2011, 01:10:04 am »
on https://github.com/Yankes/OpenXcom i have my current version of SurfaceShader :D
now with soft shadows :)

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: "grey" fog of war
« Reply #50 on: October 02, 2011, 03:27:40 pm »
Code: [Select]
i have made next step into cloning X-Com soldier (did you remember blue skinned ones? :>). now they have chameleon genes!

Yanks , is your " chameleon Genes" fully working? Do you know if it will be merged with the source code as im having some strange thoughts for its use and have been toying around with a new alien type between redrawing civilians . ;D



NOTE: On the alien there still my Civilian arms :P
« Last Edit: October 03, 2011, 01:35:14 am by luke83 »

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: "grey" fog of war
« Reply #51 on: October 02, 2011, 03:52:17 pm »
yes and no, i can made every unit transparent by replacing normal blit function by my custom one. its cant be turn on/off on demand right now.
this will not be merged anytime soon because this is first mod of openxcom :D this code dont give anything useful or new for standard xcom.
if i could finish new version of globe i will be able to smuggle some code to main repo :D

Offline MKSheppard

  • Colonel
  • ****
  • Posts: 249
    • View Profile
Re: "grey" fog of war
« Reply #52 on: October 02, 2011, 10:18:38 pm »
What about using this to give X-COM different uniform colors?

I always found it hilarious you used the same color of jumpsuits/personal armor/power armor whether it was urban combat, desert combat, jungle combat or arctic combat.

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: "grey" fog of war
« Reply #53 on: July 01, 2012, 09:49:04 am »
Yanks , i had a similar thought to RyanCrierie, but instead of changing the colours to suit the environent , could this be used in the equip craft screen to pick a soldiers  individual colour? 

Example - Billy Bob my love stepping out in a black jump suit but my Ms Piggy wants a pink suit.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: "grey" fog of war
« Reply #54 on: July 01, 2012, 10:44:49 am »
I can see this working with the personal armor and power/flying suit, but shifting palettes on the coveralls will probably result in weird skin colors :) I don't see a way around this, since the arms are only partly covered and the torso/head sprite also has uniform and skin parts.

of course, someone could go and subdivide the sprites from i.e. "left arm" into "upper left arm - uniform covered" and "lower left arm - skin", but that's a bit of work, and somebody else would need to write some code to re-combine them in the game (after palette shift has been applied...).

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: "grey" fog of war
« Reply #55 on: July 01, 2012, 10:54:17 am »
from memory , Yanks specifies only the colours he want to replace , so if you tell to ignore the skin it would.

 Even if it was just a visual feedback for the player and that there not really wearing those colours in game, Just think i could make all my medics have red suits, my main snipers could be wearing black,  etc OR you could create colour teams , red team goes east blue team will serrp the UFO ... This would make it easier to see who is who when scrolling through a map, just activate this with a toggle button on or off.
« Last Edit: July 01, 2012, 01:16:14 pm by luke83 »

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: "grey" fog of war
« Reply #56 on: July 01, 2012, 12:30:12 pm »
yup, if armor have different color than skin I can change it independently.
moriarty you can look on my "skin color" example.