Author Topic: Soft Shadows  (Read 3702 times)

0 Members and 1 Guest are viewing this topic.

Offline Aardwolf

  • 211
  • Posts: 16,384
Because Valathil got annoyed by off-topic stuff...





Yes you do have soft shadows in space. The below-illustrated phenomenon has NOTHING to do with the atmosphere:


 

Offline Pred the Penguin

  • 210
  • muahahaha...
    • EaWPR
I'm confused as why there was even a discussion on whether or not to have soft shadows. I don't think I want to know anyways...

 

Offline watsisname

Typical HLP random thread topics out of nowhere. :yes:


In the absence of light-scattering atmospheres, the extent of the softness of shadows depends on the angular diameter of the light source and the distance between the shadow-casting object and the object the shadow is being projected onto.

The shadow of Pluto onto Charon (or vice versa) during eclipses would be quite crisp!
In my world of sleepers, everything will be erased.
I'll be your religion, your only endless ideal.
Slowly we crawl in the dark.
Swallowed by the seductive night.

 

Offline Ghostavo

  • 210
  • Let it be glue!
    • Skype
    • Steam
    • Twitter
What's a soft shadow?

Is it an area bombarded with less photons than an illuminated area but with more than another darkened area?
Is it an area that's being illuminated just by secondary sources (for example, light coming from a lamp, bouncing off a wall into the area, ie. the wall being the secondary source)?

:confused:
"Closing the Box" - a campaign in the making :nervous:

Shrike is a dirty dirty admin, he's the destroyer of souls... oh god, let it be glue...

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
What's a soft shadow?

Is it an area bombarded with less photons than an illuminated area but with more than another darkened area?
Is it an area that's being illuminated just by secondary sources (for example, light coming from a lamp, bouncing off a wall into the area, ie. the wall being the secondary source)?

:confused:
Soft shadow, in the context of 3D rendering of any kind, is a shadow which doesnt have razor sharp edges.

Soft shadow in the real world has no real meaning. All shadows in real world are soft due to the fact that there are no "perfect point light sources" as there are in 3D rendering. In 3D a shadow is generally made from a single point, which is also the point where the light comes from, and there is no light bleeding into the shadow. there are approximations designed to imitate the effect, such as ambient light, and most Global Illumination solutions.

what the people got in an argument about was this, or more specifically, this thing with shadows:
http://en.wikipedia.org/wiki/File:Antumbra.jpg
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 
In half half fairness, it was partially relevant to the original topic but I suppose in the pure state in which it should remain, the bit about soft shadows is that the more deliberate effect is more intensive from what I know. Best to leave the original topic about actually implementing shadows in the first place.

Onto the technical part of my post... a simple simple approach (don't quote me on it) would be to render the shadow map then blur it. Compare to a point light just casting a shadow and not blurring it. Faster and easier to render to avoid going soft altogether. An interesting solution I once saw in Unreal Engine 3 is to essentially emit 2, maybe 3 different shadow maps, each with a varying level of blur and then tied together. The whole is then driven by distance to the light source and various objects. The end effect is a dynamic rendering of a shadow growing stronger the closer an object is to another, and blurrier shadow the farther the object away is.

In a more... how shall we say... 'deep' approach to how light works. I am no genius at this, nor will I claim it fact without doing prior research, but here's something that 'may' partially explain Penumbra and Umbra to celestial bodies. Light, though fast, is still at the mercy of gravity. I recall reading once that a partial reason why light seems to pass around objects is that light rays are partially, marginally bent. Consider that even a momentary bending of a light ray can cause interesting visual effects. To my memory the greatest example of this is Einstein's Cross http://en.wikipedia.org/wiki/Einstein%27s_Cross. Its a huge thing and likely irrelevant in our normal means, but light does become shifted or lensed when in the presence of objects exerting gravity. Mind you this is my 'EXTREME' explanations of how lightrays can go all over the place for a soft shadow  :p. I certainly have NO idea if this is the case barring the whole diagram that is shown.

But more or less, I believe that inevitably there will be soft shadows, especially around huge celestial masses. Possibly even more so in light dense regions of space like a celestial nursery in a nebula or the cluttered galactic core. Frankly and personally... I love such missions that take place in such beautiful locations  :). It has this mystic feeling that general black space missions seem to lack. Creative use of lighting will no doubt make things interesting.
I have created a masterpiece.

 

Offline watsisname

What were people were arguing about with respect to antumbras?

An antumbra is simply the portion of a shadow cone where an observer would see the occulting body to have a smaller angular size than the body light-source it is occulting.  For example, anyone who has seen an annular solar eclipse was standing in the antumbra of the Moon.  And all of us were in the antumbra of Venus back in 2004, and will be again in 2012.
« Last Edit: October 16, 2011, 09:14:21 pm by watsisname »
In my world of sleepers, everything will be erased.
I'll be your religion, your only endless ideal.
Slowly we crawl in the dark.
Swallowed by the seductive night.

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
What were people were arguing about with respect to antumbras?

An antumbra is simply the portion of a shadow cone where an observer would see the occulting body to have a smaller angular size than the body light-source it is occulting.  For example, anyone who has seen an annular solar eclipse was standing in the antumbra of the Moon.  And all of us were in the antumbra of Venus back in 2004, and will be again in 2012.
i will just point you to the first post in this thread and the bloody fact that an argument for "soft shadows" is that penumbras which manifest on a planetary scale actually have ANY influence on FSO scale stuff.

As Vengence said, if you want softened shadows, add some code to the shader to use an equivalent of photoshop's/gimp's "Gaussian Blur" filter and filter a radius around the rendered sillhouete(sp?) of the shadow. Which if memory serves is a computationaly quite a demanding effect which has very limited benefits in most cases.

Also, Vengence, what you said about UE3 engine and its way of doing softer shadows is pretty much spot on. Real life shadows start off looking reasonably sharp and then as the length of the shadow increases (the distance between the light source and the point on the surface where the shadow's edge is), the fuzzier the edges get.

Btw, that is what "Soft shadows" are actually supposed to mean, but as the term "HTL", it got butchered into meaning completely different things... (for those that dont know, HTL originally stands for "Hardware Texture and Lightning", aka one of the things that started off the lovely fad of ****in awesome graphics, way back with the original nvidia's GeForce's? (not sure 100%, cant be arsed to look up atm...). In any case, HTL here stands for a full or partial update of an older model, either in the form of upgraded, higher resolution textures, higher polygone meshes/models or both.)



Me? I'm personally all for hard shadows :p [corn] If we are known as HARD LIGHT, then we also need HARD SHADOWS. [/corn]


[/long rant]
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
the reason why "there are no soft shadows in space" is bacause the light sources are always very far away, as a result the penumbra is razor thin.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline watsisname

Quote
i will just point you to the first post in this thread and the bloody fact that an argument for "soft shadows" is that penumbras which manifest on a planetary scale actually have ANY influence on FSO scale stuff.

Thanks for pointing.  I read the hilariously out-of-context first post of this thread before I made my first response.  There was never explicit mention as to what was being debated about with regard to the shadows and antumbras, which is why I asked.

FYI, penumbras and antumbras are not limited to planetary scales.  ANY object will have such a shadow geometry, even if it's a mere asteroid passing between you and the light source.

the reason why "there are no soft shadows in space" is bacause the light sources are always very far away, as a result the penumbra is razor thin.

I wouldn't call the penumbra of our Earth razor thin...
And it's not the distance that matters, but the angular size.  Many of the stars in Freespace have significant angular diameters.
« Last Edit: October 17, 2011, 12:33:33 am by watsisname »
In my world of sleepers, everything will be erased.
I'll be your religion, your only endless ideal.
Slowly we crawl in the dark.
Swallowed by the seductive night.

  

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Like watsisname said, the geometry of shadows is scale-independent.

The only thing it depends on is the angular diameter of the light source, and the distance between shadow casting object and the surface that the shadow is projected on.


At 1 AU distance, sun appears as about 0.5 degrees wide disk of light. That means every shadow starts to blur out at 0.5 degree angle.


If you have a flat edged surface that casts a shadow line on another surface, the blurring of the edge can be determined as follows:




You can see pretty well that the blurring effect is in linear correlation with the distance. This is also the main reason why lunar eclipses are blurry on the edges. However, the atmosphere of the Earth refracts light passing through it, and that light hits the Moon even at full umbra, giving it a copper or red hue (atmosphere diffuses most of blue light, but refracts the red).

The atmospheric diffusion / refraction of light is a separate phenomenon to shadow geometry which, like shown, is only dependant on light source diameter and shadow projection distance.

It is also significantly meaningless at distances less than a kilometre, and really only starts to affect the shadows at longer range - such as hilltops or mountains casting shadows elsewhere on terrain, or clouds.



The widely popularized idea about perfectly sharp shadows at space is, I think, originated from the fact that there is significantly less diffuse light around, so the contrast between light and shadow is stronger - on Earth, even shadowed areas receive a lot of indirect light from sky and other surfaces.

This actually is true in Earth orbit as well. Earth is a very bright object with reasonably high albedo, so it's not like the shadows are exactly pitch black.





On the Moon, the situation is a bit different. Earth is much further away (although still much brighter than full moon on Earth) and the moon dust has peculiar reflective properties that make it cast light almost directly back to its inbound direction (this is why full moon is so significantly brighter than other phases - 3/4 moon is not even close to 75% of the full moon's brightness). So, the amount of indirect light there on the surface is much less than on Earth or even on Earth orbit. Regardless of this, it is sufficient to illuminate the shadowed side of astronauts or the lunar module. This has led to many a conspiracy theorist spergin over how the shadowed areas are lit against their preconceived notions of perfectly black shadows on space.


In deep space, the amount of diffuse light would be restricted to the light reflected from nearby surfaces of the ship itself, or other ships in the vicinity. Shadows would indeed be nearly pitch black in such an environment, but their edges would still be blurry.


I hope this clarifies the issue sufficiently.

Regarding shadow implementation in FSO (or other space games), performance and feasibility are perfectly good and sufficient reasons not to implement soft shadows.

Arguments about soft shadows in space not being realistic are not, because clearly soft shadows DO occur in space.

That's why my position is that if their implementation were feasible (both coding- and performance-wise), they would obviously be both more realistic and better looking than sharp shadows - but not necessary. With limited shadow map resolution, shadow edges tend to blur anyway in most cases, leading to pseudo-soft shadows that make it really hard to distinguish between actual soft shadows and simple blurring due to upscaling of the map.


I'm ridiculously happy with any working shadow implementation and wouldn't want to give Valathil an idea that his work isn't appreciated because of some ridiculous notion that soft shadows would be the only thing I'd be satisfied with.


Looking at objects casting shadows on each other makes me want to just stare at my screen with a dumb grin on my face... :lol:
« Last Edit: October 17, 2011, 01:51:59 am by Herra Tohtori »
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I wouldn't call the penumbra of our Earth razor thin...
And it's not the distance that matters, but the angular size.  Many of the stars in Freespace have significant angular diameters.

I should have qualified that with a "at the scales we deal with in freespace".
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
I agree that having shadows functionally operational in FS2 is reason enough to live and let live. It will do so much to give the game a volume probably never seen before. I can only hope Ambient Occlusion comes someday  :p, that would make tiled ships look absolutely spectacular. But anyone who knows this stuff and the current state of the engine... erm... lets leave AO out of the discussion  ;).
I have created a masterpiece.

 
OMG Herra, you killed the whole discussion on a single freaking post O_O! *hail to the king*

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
THAT'S  WHAT  IT  WAS

MADE  FOR
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
interesting crossover thar

needs moar shadows

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
oh god it works so so well