Author Topic: unit shadows and all units at above levels are visible as outlines?  (Read 9044 times)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: unit shadows and all units at above levels are visible as outlines?
« Reply #15 on: February 18, 2015, 01:58:45 pm »
Surely it's the easiest way, and the ugliest by the results (from my point of view).
Voxels (lofts) are considered only for the fire/throw tracing, for unit<->unit "can see" estimation, and I added functionality for shaded particles of projectile coordinate estimation. There is no other usage of it.  And exactly this function theoretically could be used to find out all 4 sides, and the center of the "unit shadow", to estimate slope. Or we can project multiple "particles" down to the sprite, with smallest sprites, pre-render them into "shadow" sprite and cache it. And then use it not as ordinary sprite, but as special "darkening" sprite, perhaps using Yankes' shader function.
And as I already said, it 100% will cause visual glitches during the movement, because rendering with movement now is really tricky and fancy, and it would need to be refactored before anything new added.

Volutar i just got an idea!

What if the unit's corpse FLOOROB graphic is filled with black  and placed under the unit. That way the shadow always matches the unit. That's kinda what the projectile shadow seems to do. If the unit turns around the shadow is rotated too.


It will work with floorob items or corpses as well by using same system but on the graphic itself and  offsetting the position 1 pixel down and 1 pixel right.

This way tanks shadows will be more or less correct.

« Last Edit: February 18, 2015, 02:19:34 pm by tollworkout »

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: unit shadows and all units at above levels are visible as outlines?
« Reply #16 on: February 18, 2015, 02:34:04 pm »
Floor objects are not rotatable, and they don't match standing unit in any manner. Frankly, I don't see why we need to invent something weird.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: unit shadows and all units at above levels are visible as outlines?
« Reply #17 on: February 18, 2015, 02:59:38 pm »
Understood & understood :)

Hmm.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: unit shadows and all units at above levels are visible as outlines?
« Reply #18 on: February 19, 2015, 04:04:04 pm »
Surely it's the easiest way, and the ugliest by the results (from my point of view).
Voxels (lofts) are considered only for the fire/throw tracing, for unit<->unit "can see" estimation, and I added functionality for shaded particles of projectile coordinate estimation. There is no other usage of it.  And exactly this function theoretically could be used to find out all 4 sides, and the center of the "unit shadow", to estimate slope. Or we can project multiple "particles" down to the sprite, with smallest sprites, pre-render them into "shadow" sprite and cache it. And then use it not as ordinary sprite, but as special "darkening" sprite, perhaps using Yankes' shader function.
And as I already said, it 100% will cause visual glitches during the movement, because rendering with movement now is really tricky and fancy, and it would need to be refactored before anything new added.

what if instead of having a sprite shadow follow the unit which will create artifacts you create a shadow sheet for each unit type and merge the unit sprite with it's shadow into one image before presenting it to the screen? that way all unit sprites stay as 1 sprite and avoids glitches.

SDL can probably merge two images (unit sprite and it's shadow) into memory into a new image and present that to the screen as the unit sprite.