Thread: [Plib-users] Shadow
Brought to you by:
sjbaker
From: Michael W. <michael.wessels@z.zgs.de> - 2001-02-15 19:27:44
|
Hi all, in my flight simulator I like to introduce shadowing of the airplane to the ground. My question is , if anybody has experiences to do this in conjunction with using PLIB for the geometry presentation. Michael |
From: <Ran...@ma...> - 2001-02-15 22:30:42
|
Michael Wessels writes: > in my flight simulator I like to introduce shadowing of the airplane to > the ground. > My question is , if anybody has experiences to do this in conjunction > with using PLIB for the geometry presentation. If anyone starts on this, they could try to model the "hotspot" which surrounds the shadow. The lit ground/water/trees whatever are quite noticably brighter immediately around the shadow due to the angle of incidence and reflection. The size and intensity of the hotspot can be related to the size and structure of the features on the ground. The effect isn't as pronounced on surfaces such as snow and sand. Occasionally you can notice it looking at your own shadow -- there seems to be a halo around the head. Very good for the ego. Cheers! Randall |
From: Steve B. <sjb...@ai...> - 2001-02-16 04:42:27
|
Ran...@ma... wrote: > > Michael Wessels writes: > > > in my flight simulator I like to introduce shadowing of the airplane to > > the ground. > > My question is , if anybody has experiences to do this in conjunction > > with using PLIB for the geometry presentation. > > If anyone starts on this, they could try to model the "hotspot" which > surrounds the shadow. The lit ground/water/trees whatever are quite > noticably brighter immediately around the shadow due to the angle of > incidence and reflection. NO!!! You are seeing a 'mach band' which is an optical illusion that will happen the same way in your program as it does in the real world and doesn't have to be simulated. There is no significant angle-of-incidence effect for most materials. -- 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 |
From: <Ran...@ma...> - 2001-02-16 04:55:58
|
Steve Baker writes: > > Ran...@ma... wrote: > > NO!!! You are seeing a 'mach band' which is an optical illusion that > will happen the same way in your program as it does in the real world > and doesn't have to be simulated. > > There is no significant angle-of-incidence effect for most materials. 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. 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. 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. Real empirical science ... I can provide a few (old) references for those that are interested. Randall |
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 |
From: <ha...@sl...> - 2001-03-04 23:59:50
|
I'm sure this is a frequently asked question, but the glutCreateWindow() function takes my process memory utilization from 1.2mb to 162mb. On bootup, I get this: agpgart: AGP aperture is 64M @ 0xe4000000 So that's about the aperture size times 2, when I start the process. I guess I should be checking "glut" docs for this, not this mailing list. I figured someone here would know exactly whats going on though. -- Brian Hayward |
From: Wolfram K. <w_...@rz...> - 2001-03-05 11:13:40
|
<ha...@sl...> wrote: >I'm sure this is a frequently asked question, but the glutCreateWindow() >function takes my process memory utilization from 1.2mb to 162mb. Its funny you bring this up now; The day before yesterday we started a discussion about this on PPE devel, please look into the archives. Unfortunately, all of us are fairly confused. > >On bootup, I get this: >agpgart: AGP aperture is 64M @ 0xe4000000 > >So that's about the aperture size times 2, when I start the process.=20 I would guess the aperture is mem space that the AGP may read? I *think* we have the effect with non-AGP cards as well. > I >guess I should be checking "glut" docs for this, not this mailing list. = I >figured someone here would know exactly whats going on though. Is there an expert on all the memory types (private, committed reserved, etc etc) and on mem usage here? Bye bye, Wolfram. |
From: Alexander R. <a_r...@in...> - 2001-03-07 18:54:52
|
Hi, Wolfram Kuss wrote: > > <ha...@sl...> wrote: > > >I'm sure this is a frequently asked question, but the glutCreateWindow() > >function takes my process memory utilization from 1.2mb to 162mb. > > Its funny you bring this up now; The day before yesterday we started a > discussion about this on PPE devel, please look into the archives. > Unfortunately, all of us are fairly confused. On my machine (128MB RAM, tnt2pro/32MB, Xfree4.0.1,Nvidia GL-drivers0.95) I have the effect, that the X-server process takes up about 256MB of RAM, and applications that use GL are shown up with about 200MB of RAM (as shown with qps) I think it's the GL-driver, maybe it let's see the applications all possible AGP-memory or whatever? I've looked more closely with qps at the memory maps of the GL process. /dev/nvidia0 is listed three times with 64MB memory usage and once with 1MB memory usage....? The X-server takes up 3x64MB (on /dev/nvidia0) and 32MB on /dev/mem All other apps (and X-apps) that don't use GL have a 'normal' memory size. Alex -- Alexander Rawass Email: ale...@us... Project Homepage: http://tuxfleet.sourceforge.net ...but some day you'll be a STAR in somebody else's SKY... |
From: Wolfram K. <w_...@rz...> - 2001-02-16 18:51:19
|
Randall wrote: >Real empirical science ... I can provide a few (old) references for >those that are interested. Yes, please do. I haven't heard of the effect. However, the opposite is true: Just outside of the shadow, it is a bit darker. Ok, let me do a Gedanken-experiment as well ;-): You have a perfect, directed lightsource (parallel light), not a sun. You have Steves metal plate a bit above the ground.=20 In first approximation, no direct light from the light source hits the shadow and outside the sahdow the light intensity is 100%, that is, its as high as it would be without the plate.=20 But if you are accurate, the light can slightly bend around objects since it is a wave. You can see this effect on water waves and perhaps remeber Huygens principle from school. This means, the parts of the shadow close to the rim are light a bit. This light of course has to come from somewhere, so just outside of the shadow you have less than 100%.=20 But, of course the physiolgical effect Steve spoke about (that differences are exegarated by your eyes/brain) is much larger. >Randall Bye bye, Wolfram. |
From: <Ran...@ma...> - 2001-02-18 22:21:53
|
http://geography.bu.edu/brdf/brdfexpl.html I think the misunderstanding is because I didn't really make clear that I am talking about the amount of illumination perceived by the eye across the whole field of view. As a thought experiment, place yourself on the line joining the sun and the plate. Notionally pick a spot behind the plate to target your eyes on. Initially *no* shadow will be visible around the plate ("the sun sees no shadows"). Now move away from the line. As you move away, you see more and more shadow. This effect integrated across all the shadow casting things gives the *apparent* increase in brightness. What is really happening is that you are merely seeing less shadow around the shadow cast by the observer. If you want to dispense with the shadow cast by the observer (say the sun is doing the observation), that's ok. It still works. The web-page explains it much better than I do/did. My apologies for the confusion, it wasn't intended. If a means of generating the phenomenon exists which is not too hard and not very CPU intensive exists, it would be worth it. It is one of those things that makes "synthetic" images look really flat at lifeless (unless you are simulating an overcast day). Randall |