Author Topic: another idea - radar range on geoscape  (Read 95115 times)

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #45 on: July 08, 2012, 10:18:03 am »
There is only 100% transparency in 8bit mode (not to draw)
Though, as StarCraft was using number of 8x8bit LUTs of color blending for different transparency levels. But this is rude hack for 8bit mode, I don't think it worth it considering going into 24bit.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: another idea - radar range on geoscape
« Reply #46 on: July 08, 2012, 11:58:58 am »
 ???  Wait, is there no transparency or is there no partial transparency?

Because basic transparency is really all we need for now. Like I suggested, an additional transparent hemisphere upon which circles (not discs!) can be drawn. And lines for UFO flight paths, if you want.

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #47 on: July 08, 2012, 12:06:21 pm »
There is no transparancy in 8bit mode. There is only option not to draw something. Is it transparency anyhow? I doubt.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: another idea - radar range on geoscape
« Reply #48 on: July 08, 2012, 12:28:04 pm »
???  Wait, is there no transparency or is there no partial transparency?

There's no "alpha blending". ie, you can't get a cyan pixel from a blue pixel by drawing a semi-transparent green pixel.

What actually exists isn't really transparancy. It's basically a single chosen colour from the palette (usually pink) is just not drawn. Allowing you to retain the background when drawing non-rectangular sprites.

Hope that helps clarify how it works.

If might be interesting to add a lookup table of prealpha'd values (ie, palette index A + palette index B = palette index C). It would be a 64KB table. Though it would certainly complicate any painting routines

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #49 on: July 08, 2012, 12:35:00 pm »
pmprog, yeah, it's what I've mentioned. There could be number of such tables for different transparency values (like 25%,50%,75%).
Actually we may use this for ellipse drawing - it won't get much cpu since it's only lines, not areas.

But I'd prefer to wait until openxcom go opengl with 24bit to have maximum of what we want, without palette perversions.
« Last Edit: July 08, 2012, 12:39:23 pm by Volutar »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: another idea - radar range on geoscape
« Reply #50 on: July 08, 2012, 12:59:45 pm »
Right, I know about the indexed palette System, with color 0 being not drawn, from working with the soldier and weapon sprites. (It's not necessarily pink, being an indexed Palette system  - it's often drawn pink so it's easily distinguishable, but it's really just "color 0", the palette dictates what it will look like )

So again, why not make an overlay sphere? It appears to be easy to implement and will suffice for now, and can be easily adapted to an alpha blend version later.


EDIT: I've added a mockup picture of what I think it could look like.
« Last Edit: July 08, 2012, 02:38:41 pm by moriarty »

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #51 on: July 08, 2012, 03:12:43 pm »
As far as I know they've intended not to accumulate ranges when using multiple radars (this is physically imposible), but increasing detection rate, so one radar detects craft once in 30 minutes, and if alien craft have passed by detection zone between radar waves, it won't be detected. So second radar will make them detectable twice probable (like each 15 minutes), 3rd radar - each 10 minutes, and 4th radar - 7.5 minutes.

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: another idea - radar range on geoscape
« Reply #52 on: July 08, 2012, 03:24:28 pm »
What actually exists isn't really transparancy. It's basically a single chosen colour from the palette (usually pink) is just not drawn. Allowing you to retain the background when drawing non-rectangular sprites.
I think that it's what we want. And it actually is transparency. AFAIK semi-transparent things (which use alpha blending to draw) are called translucent. And since we need just a solid (non-transparent) line(s) to draw the radar ranges, it shouldn't be really hard to make.

EDIT: I've added a mockup picture of what I think it could look like.
Yes, that's exactly what I thought of :)

Offline Yankes

  • Commander
  • *****
  • Posts: 3192
    • View Profile
Re: another idea - radar range on geoscape
« Reply #53 on: July 08, 2012, 03:43:29 pm »
If might be interesting to add a lookup table of prealpha'd values (ie, palette index A + palette index B = palette index C). It would be a 64KB table. Though it would certainly complicate any painting routines
That will be impossible, because lack of colors in 8bits. When I try mix Red + Yellow but not have any Orange color in palette? What color I should use instead?
Only thing that is possible to mix is brightens of colors. I used it once to create transparent units in Battlescape.

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #54 on: July 08, 2012, 04:24:01 pm »
Yankes, have you saw Starcraft1 ? they've been using 8bit paletted mode and they've managed to get somekind of semitransparent things.
These LUT tables could be pre-calculated after game started, automatically, to be used to pick _approximated_ color from palette.

Quote
can be easily adapted to an alpha blend version later.
moriarty, don't you think to have lines and ellipses drawn over globe in OpenGL as primitives?

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: another idea - radar range on geoscape
« Reply #55 on: July 08, 2012, 04:51:15 pm »
moriarty, don't you think to have lines and ellipses drawn over globe in OpenGL as primitives?

I'm not sure I understand what you mean. 
What I meant is that right now we can simply draw circles and it will look alright. As soon as we have 24bit opengl rendering, we turn the circles into semi-transparent (or "translucent") discs, possibly even with a rotating radial line like the old radar screens in the movies use. The rotation speed could even indicate the detection probability.
My point is, both could be done by adding a second "layer", a slightly bigger transparent sphere that can be toggled.

Offline Yankes

  • Commander
  • *****
  • Posts: 3192
    • View Profile
Re: another idea - radar range on geoscape
« Reply #56 on: July 08, 2012, 05:37:13 pm »
Indeed Volutar, SC1 use 256 colors. I toughs that its use 16bit palette, but after looking on screenshot, I find that its use 8bit.
But still, I say that in OXC is hard to archive similar effects. XC palette was designed to allow easy & realistic shading. We have 16 colors with 16 dark values (with some exceptions). SC1 have lot of more unique colors. I can guess that if you take 2 random colors form SC1 palette and mix them, then you can find color very close it in that palette.


btw, I made another test in experimental radar ranges :) (2 first are fail tests)

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #57 on: July 08, 2012, 05:39:45 pm »
Yankes, looking at your screenshots I think you've gone wrong way. Why do you rerender __whole__ globe screen just because of 1 pixel thick ellipse overlay? That's unreasonable.
« Last Edit: July 08, 2012, 06:14:33 pm by Volutar »

Offline Yankes

  • Commander
  • *****
  • Posts: 3192
    • View Profile
Re: another idea - radar range on geoscape
« Reply #58 on: July 08, 2012, 06:33:09 pm »
That is true :) but my goal isnt to draw 1pixel thick ellipse. I want to draw interior in special way too, maybe something like frog of war? If I do it in correct way, I could still show day/night cycles.
Another think that I can do is merge two radar fields to one field with one border.

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: another idea - radar range on geoscape
« Reply #59 on: July 08, 2012, 06:42:40 pm »
Good job Yankes with the mixing. That's a nice effect and I was hoping that someone can achieve that.

But still - how will it look like with the day/night cycle (if it even can work together)?

Also I live the "void" on the second screenshot in #56

Can you please try to render 1px wide circle? I'm interested in how that would look like.