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

Offline Zharik1999

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: another idea - radar range on geoscape
« Reply #105 on: July 17, 2012, 02:29:45 pm »
These results looks fine. Can we somehow test them in openxcom?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: another idea - radar range on geoscape
« Reply #106 on: July 17, 2012, 07:54:03 pm »
Daiky, Yankes was joking... Directional shading will require "fire" tracing for each visible pixel, combined with voxels info. And I really doubt it possible even in 1fps mode.
I was serious :D Maybe I used wrong word to describe it. More accurate is probably Bump mapping :)
I mean shading that depend of position and direction of pixel compare to light source position.
My idea of this would be exactly like globe shading that is directional. It will ignore anything between light source and pixel. And will be impossible to made any
shadow on surfaces. Light range will be determined by current implementation of light spread (only done independent for every light source).


And about visual aspects of my work, I try find hard limits of my algorithm. Looks isnt important right now, when I will finishing it I will apply most of your suggestion to it :)

 

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #107 on: July 17, 2012, 07:58:07 pm »
Yankes, where will you take 3d data of sprites from?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: another idea - radar range on geoscape
« Reply #108 on: July 17, 2012, 08:24:32 pm »
Yes, this is one of problems :D This probably need some hand work, but nothing more complicated than drawing that sprites.
Simplest solution can be drawing "depth buffer" of sprites and for that try create normals. This will have some glitch probaby but because low resolution it will be hard to see :)

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: another idea - radar range on geoscape
« Reply #109 on: July 24, 2012, 02:52:39 am »
Sorry for maybe very silly question but are you sure that there is no way to make detection ranges be shown this way?
I already did the "radar ranges as just thin lines" approach earlier, if people missed it:


If you mean something else, I don't know, this thread already seems to have every possible implementation you could ask for. :P

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #110 on: July 24, 2012, 07:00:45 am »
SupSuper, I see you haven't correct circles, they seems to be distorted because those circles are in "lat/lon" terms, not actual sphere circles. Considering this you wouldn't get any circle at all when try to put your base near the pole :)
And integer lines looks jagged (better to write floating-point lines drawing function).
Have you implemented this already in openxcom code, or it's just a "5min test without commit"?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: another idea - radar range on geoscape
« Reply #111 on: July 24, 2012, 07:36:28 am »
SupSuper, I see you haven't correct circles, they seems to be distorted because those circles are in "lat/lon" terms, not actual sphere circles. Considering this you wouldn't get any circle at all when try to put your base near the pole :)
And integer lines looks jagged (better to write floating-point lines drawing function).
Have you implemented this already in openxcom code, or it's just a "5min test without commit"?
Yeah I know about the crappy circles (they only have 16 points), it was just a crude 5min test to prove it could be done before everyone went crazy with it, but I was too late. :P

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #112 on: July 24, 2012, 07:59:32 am »
SupSuper, I was thinking about real, 3d projected circle drawing (I already have pixe-by-pixel floating point line drawing algorithm, so this is not an issue). And for the moment I have no IDEA how to do it:). There seems to be alot of trigonometry stuff like arccos if I try to do it that way. Though there is another way - by simple ellipse drawing, without actual projecting, just simulating circles of the sphere (but need of tweaking to hide parts of circles).

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: another idea - radar range on geoscape
« Reply #113 on: July 24, 2012, 08:29:06 pm »
my globe radars matured to beta stage. give me lat&lon and I will draw circle there.
github.com/Yankes/OpenXcom/tree/GlobeRadar source code of this, if someone want try it.

right now I have 400 random circles with different radius for test (most of them are overlapping, this is good because if they would cover all globe this would run faster :D ).

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #114 on: July 24, 2012, 10:06:49 pm »
Yankes, use circles with variable light level,  that will look more "nice". (3 radar ranges per base also should be distinguishable)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: another idea - radar range on geoscape
« Reply #115 on: July 24, 2012, 10:56:53 pm »
I will made some test, and after that I can try do it as you want.

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: another idea - radar range on geoscape
« Reply #116 on: July 25, 2012, 01:51:54 am »
Yankes, it looks very nice. Is it possible to mix the color? So day/night cycle would be better distinguishible apart of the radars?

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #117 on: July 25, 2012, 08:20:25 am »
And this is my experiment for correct globe circles (not like SupSuper's).
It uses arcsin/arctan2 and number of sin/cos for sphere projection of each point of circle. Since those coordinates can be (and should be) cached for each base, it won't be a performance issue of anykind..
« Last Edit: July 25, 2012, 08:38:18 am by Volutar »

Offline hsbckb

  • Colonel
  • ****
  • Posts: 275
  • Gill Man
    • View Profile
Re: another idea - radar range on geoscape
« Reply #118 on: July 25, 2012, 10:21:44 am »
Voluta, your radar look the best. However, can we see the flying UFO if the radar range is cached?

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #119 on: July 25, 2012, 11:04:20 am »
hsbckb, only radar circle point coordinates are cached, they are just for visual. Detection work very simple way, by distance calculation.
The only radar circles which cannot be cached - xcom craft's radars. They are dynamically changing with each game frame. Though because they are smallest - they may require less points.