Re: [Plib-users] Shadow
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-02-16 06:47:58
|
Ran...@ma... wrote: > Dredging up the stuff from a previous incarnation, the "hotspot" isn't > an optical illusion, rather it is related to the amount of visible > shadow (cast by protruding objects on the surface) relative to the > amount of visible, directly illuminated surface. I don't understand where this 'extra' light comes from. Please explain how light rays that would need to travel through the solid object casting the shadow somehow bend around that object to land on the ground in the halo region. I can't conceive of a mechanism that would do that other than at a microscopic scale. > You are right -- the > hotspot will appear without any additional code if the surfaces do in > fact have a vertical texture (that was what my former incarnation > depended on). In my mind I was imagining that the the surfaces we > were talking about were textured with texture maps, rather than > something with real vertical texture. You have me *completely* confused - how does "texture" have anything to do with it? Let's talk about a simple case. I have a 1' square chunk of metal. I hold it 3 feet above the ground at midday. This will cast a 1' shadow (roughly) with a dark 'umbra' in the center and will fade out to bright sunlight over an inch or two through the 'penumbra' part of the shadow. The edge of the shadow isn't 'hard' because the sun isn't a point light source - and from a spot on the ground just on the edge of the shadow, you only see (say) half of the sun's disk (the other half being occluded by the metal plate). You claim that the region just outside the penumbra will actually be brighter than normal sunlight? If yes - how does this extra light get there from the sun? What geometrical path does it take? If no - then please explain what's wrong with my experiment? > It isn't an optical illusion -- you can use the size and intensity of > the hotspot to elicit information from aerial photography about the > size of (for example) trees in a stand and their mean distance apart. I don't see how... Hmmm - I think that this 'halo' you are talking about is just the penumbra of the shadow...but if so, your description is very confused. But even so, I don't see how using the width of the penumbra allows you to deduce the height of trees in a photo if you didn't know where the camera was relative to those trees...and if you know that information then you don't need the penumbra (or any other shadow information) to tell you that. For an infinite light source (and the sun is pretty close to being infinitely far away for these purposes :-) - the width of the penumbra as measured on the ground depends only on the distance between the shadow caster and the surface you are casting onto. Generally, that doesn't help you determine the size of something in a photo though. The top of 5 meter tree will be twice as close to the ground as a 10 meter tree and therefore have a half-sized penumbra. Unfortunately, in the photograph, the penumbra's width is affected by visual perspective - just like the tree. Hence the shadow from a 10 meter tree photographed from 100 meters up will look EXACTLY the same as a 5 meter tree from 50 meters up. So examining the penumbra gives you no extra information that the size of the tree on the photograph doesn't provide. > Real empirical science ... I can provide a few (old) references for > those that are interested. Yes please! Anyway, if you are talking about rendering the penumbra of an aircraft's shadow, that's an easy thing. Unless the plane is **HUGE** or very close to the ground, it'll appear to be smaller than the sun's disk when seen from the ground and the shadow will be all penumbra and no umbra. In that case, you can just model a fuzzy shadow polygon and make it less and less opaque as the height of the plane above the terrain increases. You *might* want to add a more solid 'umbra' at low altitudes - but frankly, I wouldn't bother. Most people don't notice all this fancy scientific shadow stuff and will be perfectly happy to see a fuzzy outline at all altitudes. That has the (LARGE) benefit that you don't have to be too specific about the exact shape of the shadow - so it doesn't have to change shape as the aircraft changes orientation. Doing *true* shadows in a general situation is *still* a bitch of a problem... Consider a moment just before sunset. The sun is on the horizon. The plane is flying low over very flat terrain. The shadow of the plane stretches all the way to the horizon. Because the terrain undulates, you'd have to cut up the shadow polygon to fit it to the terrain surface - in realtime - at full frame rates! That's one heck of a lot of math! There are some algorithms to use multipass textures that are rendered on-the-fly by rendering the scene from the perspective of the light source. This takes one full scene render for each shadow caster. However, you don't know what resolution that texture needs to be. From the perspective of the sun, your texture will have a nice sharp edge and will look good. But when you apply that to the terrain, it'll be far to coarse in resolution for some eyepoints (eg when you are looking at 90 degrees to the sun's direction vector and you are close to the ground). There are NO good algorithms for general shadow casting. Fortunately, the pragmatist will realise that humans don't care. We like to have a shadow to give a feeling of the height of the object above the ground (especially when close to the ground)...but if it's just a fuzzy cross-shape then that's "good enough". -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |