Thread: RE: [Algorithms] It looks terrible (was: Lightmap Terrain)
Brought to you by:
vexxed72
From: Phil B. <ph...@de...> - 2000-08-27 14:53:07
|
hey, i do the same thing as you except i have one directional light for the sun, cast the ray and then if it intersects don't add on the diffuse just leaving the ambient. i found i have to play with the sun's direction a lot to get good results - really long shadows seem to look a little weird for me. >For example, is there a way to have real penumbrae in the >shadows. this is a fudge but what i've been doing is creating 7 lightmaps and then do something like... GenerateLightmap( lightmap0, lightlist ); //x jitter by 10% JitterLights( lightlist, 0.1, 0.0, 0.0 ); GenerateLightmap( lightmap1, lightlist ); JitterLights( lightlist, -0.1, 0.0, 0.0 ); GenerateLightmap( lightmap2, lightlist ); //y jitter by 10% JitterLights( lightlist, 0.0, 0.1, 0.0 ); GenerateLightmap( lightmap3, lightlist ); JitterLights( lightlist, 0.0, -0.1, 0.0 ); GenerateLightmap( lightmap4, lightlist ); //z jitter by 10% JitterLights( lightlist, 0.0, 0.0, 0.1 ); GenerateLightmap( lightmap5, lightlist ); JitterLights( lightlist, 0.0, 0.0, -0.1 ); GenerateLightmap( lightmap6, lightlist ); and then just average all the lightmaps into a final one. all the jitter function is doing is changing the positions of the lights... like i said, it's a big hack but those hard shadows went soft immediately and look pretty good now. the downside of course is that it takes a long time to generate a final lightmap. >I could blur the image, but that just wouldn't be the same. i tried this before doing the above and couldn't get anything decent too. regards. Phil Bak ICQ:11204037 Tel:01908 393837 Email:ph...@de... Web:www.deepred.co.uk --- Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it. -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Klaus Hartmann Sent: 27 August 2000 14:29 To: gda...@li... Subject: [Algorithms] It looks terrible (was: Lightmap Terrain) Hi all, Please have a look at the following image (~310 KB): http://www.thecore.de/TheCore/shadows.jpg This lightmap looks majorly terrible, and I'm looking for ways to enhance this. I use the simple dot-product approach, and I have two light source. One light source (sun) is to the east, and the other ('anti' sun) is to the west. I use two light sources, because I don't like ambient. I compute the light for each texel, and then I cast a ray towards the sun (directional light). If this ray intersect with the surface before it reaches the sun, then I decrease the texel's intensity by some amount. I don't reflect or refract rays. I figured, that reflection probably wouldn't make much sense, because there's only a few cases where the reflected ray would hit the terrain again (or am I wrong?). How can I make this look better? For example, is there a way to have real penumbrae in the shadows. Of course, I could blur the image, but that just wouldn't be the same. Any ideas? Honestly... a simple dot-product (without shadows) looks more than twice as good (I can upload the same scene without shadows, if requested). Niki _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Ralf S. <rap...@ra...> - 2000-08-27 15:23:14
|
Niki, well it do NOT look that terrible! it's a lightmap, isn't it? what du you suspect? shadows make scenes nore realistic, not neccesarily beautiful. you are loosing visual information if yo add shadows to a top down view of a heightfield. you know that already, because you are trying to avoid it, by using a second light source instead of ambient light (we can say the second light is simulating the reflection of the sun at the other mountain...). take a look at some landscape/mountain top-down photos. i guess, you will recognice you lightmap is ok! greetings, ralf | Hi all, | Please have a look at the following image (~310 KB): | http://www.thecore.de/TheCore/shadows.jpg | This lightmap looks majorly terrible, and I'm looking for ways to enhance | this. I use the simple dot-product approach, and I have two light source. | One light source (sun) is to the east, and the other ('anti' sun) is to the | west. I use two light sources, because I don't like ambient. I compute the | light for each texel, and then I cast a ray towards the sun (directional | light). If this ray intersect with the surface before it reaches the sun, | then I decrease the texel's intensity by some amount. I don't reflect or | refract rays. I figured, that reflection probably wouldn't make much sense, | because there's only a few cases where the reflected ray would hit the | terrain again (or am I wrong?). | How can I make this look better? For example, is there a way to have real | penumbrae in the shadows. Of course, I could blur the image, but that just | wouldn't be the same. | Any ideas? Honestly... a simple dot-product (without shadows) looks more | than twice as good (I can upload the same scene without shadows, if | requested). | Niki | _______________________________________________ | GDAlgorithms-list mailing list | GDA...@li... | http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Klaus H. <k_h...@os...> - 2000-08-27 16:37:27
|
Welcome, Ralf :) ----- Original Message ----- From: Ralf Schneider <rap...@ra...> > Niki, > > well it do NOT look that terrible! > it's a lightmap, isn't it? what du you suspect? What I suspect is a nice image :) See, I've actually tried this shadow stuff in my terrain engine, and in 3D it looks far worse than the lightmap. I tried this with a hybrid multifractal, though... maybe it looks better with real world data as show in the image. Gotta try this, but it's a bit more work. > shadows make scenes nore realistic, not neccesarily beautiful. This is a good description. The unrealistic dot-product-only lit scene (in 3D) looks much better, even though it's not as realistic as the shadowed version. >you are loosing visual information if yo add shadows to a top down view of a heightfield. you know that already, because you are trying to avoid it, by using a second light source instead of ambient light (we can say the second light is simulating the reflection of the sun at the other mountain...). Yes, this is quite a problem. If I use no second light source, then there's zero shading on the faces opposite to the sun, which basically means that I lose all the nice features. If, on the other hand, I use a secondary light source (plus shadows), then I get artifacts as the one's in the upper-right shadow-area of the image I posted. This looks as if I used false gays (as in false color). In 3D this becomes even worse. > take a look at some landscape/mountain top-down photos. i guess, you will recognice you lightmap is ok! You should see John Ratcliff's work... I remember his moon-lightmap and it looks great. John, are you still a member of this list? Could you please upload that moon-lightmap of yours again? Niki |
From: Jim O. <j.o...@in...> - 2000-08-27 21:21:54
|
Hey Niki, Some suggestions which might make your lightmap (and not to forget your terrain) look better/nicer. Maybe you have already considered these, but then again, you never know :-) - Perhaps you could use a lighter ambient color (instead of something nearing total blackness, say about 20-25% gray or something). Near black shadows are not really common in real life, specially not in open terrains - always plenty of ambient light. - When raytracting your lightmap, you could perhaps use the corners of each pixel/texel instead of the centers and then use the average of the four corners as the pixel's color, essentially applying a bilinear filter to your light map. - It is just a hunch (no scientific basis, other than my own observations), but it might look good if you lighten the shadow areas based on the slope of the terrain, so that shadows on steep areas look darker than those on flat areas, which in my eyes also happens in reality. Reason for this effect could be that more diffuse light is being reflected on the flat areas by the clouds, but again, I have no scientific basis for this assumption. Jim Offerman Innovade - designing the designer ----- Original Message ----- From: "Klaus Hartmann" <k_h...@os...> To: <gda...@li...> Sent: Sunday, August 27, 2000 6:32 PM Subject: Re: [Algorithms] It looks terrible (was: Lightmap Terrain) > Welcome, Ralf :) > > ----- Original Message ----- > From: Ralf Schneider <rap...@ra...> > > Niki, > > > > well it do NOT look that terrible! > > it's a lightmap, isn't it? what du you suspect? > > What I suspect is a nice image :) See, I've actually tried this shadow stuff > in my terrain engine, and in 3D it looks far worse than the lightmap. I > tried this with a hybrid multifractal, though... maybe it looks better with > real world data as show in the image. Gotta try this, but it's a bit more > work. > > > shadows make scenes nore realistic, not neccesarily beautiful. > > This is a good description. The unrealistic dot-product-only lit scene (in > 3D) looks much better, even though it's not as realistic as the shadowed > version. > > >you are loosing visual information if yo add shadows to a top down view of > a heightfield. you know that already, because you are trying to avoid it, by > using a second light source instead of ambient light (we can say the second > light is simulating the reflection of the sun at the other mountain...). > > Yes, this is quite a problem. If I use no second light source, then there's > zero shading on the faces opposite to the sun, which basically means that I > lose all the nice features. If, on the other hand, I use a secondary light > source (plus shadows), then I get artifacts as the one's in the upper-right > shadow-area of the image I posted. This looks as if I used false gays (as in > false color). In 3D this becomes even worse. > > > take a look at some landscape/mountain top-down photos. i guess, you will > recognice you lightmap is ok! > > You should see John Ratcliff's work... I remember his moon-lightmap and it > looks great. John, are you still a member of this list? Could you please > upload that moon-lightmap of yours again? > > Niki > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Klaus H. <k_h...@os...> - 2000-08-28 06:58:21
|
----- Original Message ----- From: Jim Offerman <j.o...@in...> > Hey Niki, > > Some suggestions which might make your lightmap (and not to forget your > terrain) look better/nicer. Maybe you have already considered these, but > then again, you never know :-) > > - Perhaps you could use a lighter ambient color (instead of something > nearing total blackness, say about 20-25% gray or something). Near black > shadows are not really common in real life, specially not in open terrains - > always plenty of ambient light. I don't use any ambient color at all. Instead I use a second directional light source (opposite to the sun). > - When raytracting your lightmap, you could perhaps use the corners of each > pixel/texel instead of the centers and then use the average of the four > corners as the pixel's color, essentially applying a bilinear filter to your > light map. I do use the pixel-corners, but I don't average them. This is sort of an accident really. Perhaps, I should cast the rays through the center of each pixel. Thanks for reminding me :) > - It is just a hunch (no scientific basis, other than my own observations), > but it might look good if you lighten the shadow areas based on the slope of > the terrain, so that shadows on steep areas look darker than those on flat > areas, which in my eyes also happens in reality. Reason for this effect > could be that more diffuse light is being reflected on the flat areas by the > clouds, but again, I have no scientific basis for this assumption. Funny! This is exactly what I did last night :) This made the lightmap look a bit better, but I haven't tried it in 3D, yet. Well, I think I'll bite the bullet and try some true recursive ray tracing (with reflected rays), today. Technically this is wrong for diffuse light, but maybe it looks better, and that's what counts. Thanks, Niki > > Jim Offerman > > Innovade > - designing the designer > > ----- Original Message ----- > From: "Klaus Hartmann" <k_h...@os...> > To: <gda...@li...> > Sent: Sunday, August 27, 2000 6:32 PM > Subject: Re: [Algorithms] It looks terrible (was: Lightmap Terrain) > > > > Welcome, Ralf :) > > > > ----- Original Message ----- > > From: Ralf Schneider <rap...@ra...> > > > Niki, > > > > > > well it do NOT look that terrible! > > > it's a lightmap, isn't it? what du you suspect? > > > > What I suspect is a nice image :) See, I've actually tried this shadow > stuff > > in my terrain engine, and in 3D it looks far worse than the lightmap. I > > tried this with a hybrid multifractal, though... maybe it looks better > with > > real world data as show in the image. Gotta try this, but it's a bit more > > work. > > > > > shadows make scenes nore realistic, not neccesarily beautiful. > > > > This is a good description. The unrealistic dot-product-only lit scene (in > > 3D) looks much better, even though it's not as realistic as the shadowed > > version. > > > > >you are loosing visual information if yo add shadows to a top down view > of > > a heightfield. you know that already, because you are trying to avoid it, > by > > using a second light source instead of ambient light (we can say the > second > > light is simulating the reflection of the sun at the other mountain...). > > > > Yes, this is quite a problem. If I use no second light source, then > there's > > zero shading on the faces opposite to the sun, which basically means that > I > > lose all the nice features. If, on the other hand, I use a secondary light > > source (plus shadows), then I get artifacts as the one's in the > upper-right > > shadow-area of the image I posted. This looks as if I used false gays (as > in > > false color). In 3D this becomes even worse. > > > > > take a look at some landscape/mountain top-down photos. i guess, you > will > > recognice you lightmap is ok! > > > > You should see John Ratcliff's work... I remember his moon-lightmap and it > > looks great. John, are you still a member of this list? Could you please > > upload that moon-lightmap of yours again? > > > > Niki > > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Johan H. <jh...@mw...> - 2000-08-28 09:01:42
|
Hi One of the most important aspet in the final scene, is the color of the light map. By making the light orange / yellow, and the shadows blue, you inrease the visual experience a lot. Currently I am tweaking my lightmaps in photoshop to do this. Johan Hammes |
From: Klaus H. <k_h...@os...> - 2000-08-28 12:02:55
|
Hi, I've now modified my ray tracer into a true recursive ray tracer that reflects rays, and I also included the light-jittering that was suggested by Phil. It looks better now, as can be seen in the following image (290 KB): http://www.thecore.de/TheCore/shadows2.jpg Please, note that there's no longer a second light source. Instead, the details on the shadow sides now come from the reflected rays. I know that pieces of this image look like rubble. This makes it a bit difficult to understand the image, but you must never forget that this is a lightmap, and in 3D you have actual elevations that help to understand the lighting. I very much appreciate all the usefull help and suggestions from you people. I appreciate it so much, that I decided to make this test program (+ source) available to the members of this list (only to the members of this list). I'll leave a note as soon as I've made the code a bit prettier. Thanks a lot, Niki |
From: Jim O. <j.o...@in...> - 2000-08-28 12:10:46
|
> One of the most important aspet in the final scene, is the color of the > light map. By making the light orange / yellow, and the shadows blue, you > inrease the visual experience a lot. Currently I am tweaking my lightmaps > in photoshop to do this. A better use of complementary colors would be to use the complementary colors of the texture in the shaded area. I.e. if you want to create a really dark shadow in a green area, use a red tint in the shadow (note: this trick is frequently applied in pencil art). An obvious problem is calculating complementary colors on the fly... Jim Offerman Innovade - designing the designer |
From: Jim O. <j.o...@in...> - 2000-08-28 12:10:24
|
> I don't use any ambient color at all. Instead I use a second directional > light source (opposite to the sun). I have read your disliking of ambient light in the other post. I always use a little ambient light in my scenes - I dislike those totally black shadows, takes away all the texture... but that's an arguable opinion though. > I do use the pixel-corners, but I don't average them. This is sort of an > accident really. Perhaps, I should cast the rays through the center of each > pixel. Thanks for reminding me :) Your welcome. I'd also play with averaging four rays to get a single shade value, since it should nicely soften the shadow's edges. > Funny! This is exactly what I did last night :) This made the lightmap look > a bit better, but I haven't tried it in 3D, yet. Well what do you know... Let me know the results. I would certainly like to know whether it is worth the effort, before I start wasting time on such a thing. > Well, I think I'll bite the bullet and try some true recursive ray tracing > (with reflected rays), today. Technically this is wrong for diffuse light, > but maybe it looks better, and that's what counts. Alternatively, you might consider using five (or even more) directional light sources, each with a slightly different direction and blend the results together. We always treat sunlight as being parrallel in our simulations, but it is not 100% parrallel in real life... Jim Offerman Innovade - designing the designer |
From: Sam K. <sa...@ip...> - 2000-08-27 16:11:31
|
Niki, Here's something I've done in the past, which gets rid of the hard edge from "just darkening by some ammount if the ray intersected" and looks pretty good: Cast a ray from the sun to the sample point (Instead of Sample point to sun). (Starting at the edge of the map, or further if the terrain is tiled). You have a running shadow height (SHeight) which is set to 0. and a (RayDy) variable which is the y dropoff of the ray per pixel moved. Move along the ray (in x & z) towards the sample point. At each Heightmap pixel the ray passes over on the way do the following: If(SHeight<HeightmapPixelVal) { SHeight = HeightmapPixelVal; } else { SHeight -= RayDy; } When the sample point is reached, the value in SHeight is examined, the smaller it is the "less shadow" is here the bigger the "more shadow". This gives lovely graduations in the shadow, and real dark areas, and subtle lighter areas. Another nice trick is, if you store the resulting shadow height at every sample point to form a "shadow buffer", objects on the terrain can fall into shadow correctly if you compare their heights to the height in the "shadow buffer" even when they are not on the ground. This in effect is 2.5d volumetric shadows. Hope this helps, sam -----Original Message----- From: Klaus Hartmann <k_h...@os...> To: gda...@li... <gda...@li...> Date: 27 August 2000 2:48 PM Subject: [Algorithms] It looks terrible (was: Lightmap Terrain) >Hi all, > >Please have a look at the following image (~310 KB): >http://www.thecore.de/TheCore/shadows.jpg > >This lightmap looks majorly terrible, and I'm looking for ways to enhance >this. I use the simple dot-product approach, and I have two light source. >One light source (sun) is to the east, and the other ('anti' sun) is to the >west. I use two light sources, because I don't like ambient. I compute the >light for each texel, and then I cast a ray towards the sun (directional >light). If this ray intersect with the surface before it reaches the sun, >then I decrease the texel's intensity by some amount. I don't reflect or >refract rays. I figured, that reflection probably wouldn't make much sense, >because there's only a few cases where the reflected ray would hit the >terrain again (or am I wrong?). > >How can I make this look better? For example, is there a way to have real >penumbrae in the shadows. Of course, I could blur the image, but that just >wouldn't be the same. > >Any ideas? Honestly... a simple dot-product (without shadows) looks more >than twice as good (I can upload the same scene without shadows, if >requested). >Niki > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Klaus H. <k_h...@os...> - 2000-08-27 16:45:16
|
I wrote: > ...shadow-area of the image I posted. This looks as if I used false gays (as in > false color). Of course, I wanted to write "grays"... if at least I had written it with an 'e' instead of an 'a'. Sorry... I'll blame Outlook Express :) Niki |
From: Pallister, K. <kim...@in...> - 2000-08-28 06:20:27
|
Niki, Why are you anti-ambient lighting? Everyone else, am I the only one that find's Ralf's email address intriguing? Kim Pallister We will find a way or we will make one. - Hannibal > -----Original Message----- > From: Ralf Schneider [mailto:rap...@ra...] > Sent: Sunday, August 27, 2000 8:27 AM > To: gda...@li... > Subject: Re: [Algorithms] It looks terrible (was: Lightmap Terrain) > > > Niki, > > well it do NOT look that terrible! > it's a lightmap, isn't it? what du you suspect? > shadows make scenes nore realistic, not neccesarily > beautiful. you are loosing visual information if yo add > shadows to a top down view of a heightfield. you know that > already, because you are trying to avoid it, by using a > second light source instead of ambient light (we can say the > second light is simulating the reflection of the sun at the > other mountain...). > > take a look at some landscape/mountain top-down photos. i > guess, you will recognice you lightmap is ok! > > greetings, ralf > > > | Hi all, > > | Please have a look at the following image (~310 KB): > | http://www.thecore.de/TheCore/shadows.jpg > > | This lightmap looks majorly terrible, and I'm looking for > ways to enhance > | this. I use the simple dot-product approach, and I have two > light source. > | One light source (sun) is to the east, and the other > ('anti' sun) is to the > | west. I use two light sources, because I don't like > ambient. I compute the > | light for each texel, and then I cast a ray towards the sun > (directional > | light). If this ray intersect with the surface before it > reaches the sun, > | then I decrease the texel's intensity by some amount. I > don't reflect or > | refract rays. I figured, that reflection probably wouldn't > make much sense, > | because there's only a few cases where the reflected ray > would hit the > | terrain again (or am I wrong?). > > | How can I make this look better? For example, is there a > way to have real > | penumbrae in the shadows. Of course, I could blur the > image, but that just > | wouldn't be the same. > > | Any ideas? Honestly... a simple dot-product (without > shadows) looks more > | than twice as good (I can upload the same scene without shadows, if > | requested). > | Niki > > | _______________________________________________ > | GDAlgorithms-list mailing list > | GDA...@li... > | http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Klaus H. <k_h...@os...> - 2000-08-28 07:14:28
|
----- Original Message ----- From: Pallister, Kim <kim...@in...> > Niki, > > Why are you anti-ambient lighting? I don't like to lose the shading on the shadow sides of the mountains. In 3D terrain it looks *much* better if you use an anti-sun light source instead of ambient light. Ambient light is, in my opinion, one of the worst features of the Phong reflection model... especially when you use to light terrain. > Everyone else, am I the only one that find's Ralf's email address > intriguing? This is not the 'rappongi' you are thinking about :) If I remember correctly, then the other 'rappongi' is even spelled differently... Niki > Kim Pallister > > We will find a way or we will make one. > - Hannibal |
From: Ralf S. <rap...@ra...> - 2000-08-28 11:47:52
|
Hello Kim, i don't know what you are talking about! i joined the mailing-list 3 days ago. if you take a look wou will see "ralf schneider" has registered the domain "rappongi.com". nothing special about that. klaus hartmann alias niki know me, i wrote 2 small games for him when i was working as a freelancer. by the way rappongi.com came from "roppongi" a district in tokyo: nightclubs, bars, discos, ... some people say: roppongi is the place where you can feel the pulse of the city. i like the name and i like roppongi, so i have choosen it as my domain name. but i'm german, anyway. ... this is the last time, i will write about an off-topic, personal thread in the mailinglist. but i think i missed something in the past, wich would explain this behaviour. have a nice day! - ralf | Everyone else, am I the only one that find's Ralf's email address | intriguing? |
From: <sro...@te...> - 2000-08-28 12:40:46
|
>I very much appreciate all the usefull help and suggestions from you people. >I appreciate it so much, that I decided to make this test program (+ source) >available to the members of this list (only to the members of this list). >I'll leave a note as soon as I've made the code a bit prettier. Cool, I got my raytracing working but it's only black and white :) How many time in sec that take to perform your lightmap (1025x1025)? Just for me curiosity :) Corrosif -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Klaus Hartmann Sent: Monday, August 28, 2000 7:58 AM To: gda...@li... Subject: Re: [Algorithms] It looks terrible (was: Lightmap Terrain) Hi, I've now modified my ray tracer into a true recursive ray tracer that reflects rays, and I also included the light-jittering that was suggested by Phil. It looks better now, as can be seen in the following image (290 KB): http://www.thecore.de/TheCore/shadows2.jpg Please, note that there's no longer a second light source. Instead, the details on the shadow sides now come from the reflected rays. I know that pieces of this image look like rubble. This makes it a bit difficult to understand the image, but you must never forget that this is a lightmap, and in 3D you have actual elevations that help to understand the lighting. I very much appreciate all the usefull help and suggestions from you people. I appreciate it so much, that I decided to make this test program (+ source) available to the members of this list (only to the members of this list). I'll leave a note as soon as I've made the code a bit prettier. Thanks a lot, Niki _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: <sro...@te...> - 2000-08-28 12:53:05
|
>I very much appreciate all the usefull help and suggestions from you people. >I appreciate it so much, that I decided to make this test program (+ source) >available to the members of this list (only to the members of this list). >I'll leave a note as soon as I've made the code a bit prettier. Just a idea for your demo: Put a part of your heightfield data all in black with some basic white form like a square, cercle, line, triangle to see the shadow of this object on the lightmap Regards, Corrosif |
From: Pallister, K. <kim...@in...> - 2000-08-28 15:22:31
|
On topic: Niki, I understand what you are saying about ambient. Would then your 'anti sun' best be approximated with a directional light from straight above? Not sure this captures it well, but at least overhang's would get complete shadow. Off topic: > From: Ralf Schneider [mailto:rap...@ra...] >... > by the way rappongi.com came from "roppongi" a district in > tokyo: nightclubs, bars, discos, ... some people say: > roppongi is the place where you can feel the pulse of the > city. i like the name and i like roppongi, so i have choosen > it as my domain name. I know, that's why I made the comment. I'll be there on business in a couple weeks. BTW, Maybe you could sell web page space to clubs there :-) Kim Pallister We will find a way or we will make one. - Hannibal > -----Original Message----- > From: Ralf Schneider [mailto:rap...@ra...] > Sent: Monday, August 28, 2000 4:51 AM > To: gda...@li... > Subject: RE: [Algorithms] It looks terrible (was: Lightmap Terrain) > > > Hello Kim, > > i don't know what you are talking about! i joined the > mailing-list 3 days ago. > if you take a look wou will see "ralf schneider" has > registered the domain "rappongi.com". nothing special about > that. klaus hartmann alias niki know me, i wrote 2 small > games for him when i was working as a freelancer. > > by the way rappongi.com came from "roppongi" a district in > tokyo: nightclubs, bars, discos, ... some people say: > roppongi is the place where you can feel the pulse of the > city. i like the name and i like roppongi, so i have choosen > it as my domain name. > but i'm german, anyway. > > ... this is the last time, i will write about an off-topic, > personal thread in the mailinglist. but i think i missed > something in the past, wich would explain this behaviour. > > have a nice day! > > - ralf > > | Everyone else, am I the only one that find's Ralf's email address > | intriguing? > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Klaus H. <k_h...@os...> - 2000-08-28 16:38:18
|
Kim, it sure is worth a try to let the 'anti sun' shine from above :) Curious to see what it looks like, but can't try it right now. The reason why I chose to place the 'anti sun' to the west, and the sun to the east is, because I saw our artist model terrain. The results looked way great, and he placed the 'anti sun' to the west, and the sun to the east. Also, I was thinking about something completely different: Create an invisible sphere that represents the atmosphere and encloses the whole terrain. Then light the 'faces' of the sphere so that it is brightest where the sun is. Then for each ray/surface intersection point compute the normal at that point and use it to cast a ray towards the sphere. You'll hit a more or less bright on that sphere, and this point is then used as a light source (the color of that point on the sphere then represents the color of the light emitted from the 'virtual' light source). I'm not quite sure what will happen to the shadows, but it's possible that they'll be correct (including penumbrae). Maybe I'm wrong, but I have the feeling, that this can look more than just good. Everyone: What do you think? Niki From: Pallister, Kim <kim...@in...> > On topic: Niki, I understand what you are saying about ambient. Would then > your 'anti sun' best be approximated with a directional light from straight > above? Not sure this captures it well, but at least overhang's would get > complete shadow. |
From: Mark W. <mwi...@cy...> - 2000-08-28 20:27:00
|
Hi Niki, You could also try the trick that many people used when making outdoor levels for Quake based games. They create a 2D grid of lightsources on a plane in the sky. The brightness of each light is adjusted based on the sun position. This method approximates an area light source (sky/clouds) instead of just a point light (sun). Search around the Quake modeling sites for more details. By the way... I think your lightmap looks fine. Lightmaps never look very good when viewed alone. You have to blend them with a noisy base texture to get a decent effect. -Mark ----- Original Message ----- From: "Klaus Hartmann" <k_h...@os...> To: <gda...@li...> Sent: Monday, August 28, 2000 12:33 PM Subject: Re: [Algorithms] It looks terrible (was: Lightmap Terrain) > Kim, > > it sure is worth a try to let the 'anti sun' shine from above :) Curious to > see what it looks like, but can't try it right now. > > The reason why I chose to place the 'anti sun' to the west, and the sun to > the east is, because I saw our artist model terrain. The results looked way > great, and he placed the 'anti sun' to the west, and the sun to the east. > > Also, I was thinking about something completely different: Create an > invisible sphere that represents the atmosphere and encloses the whole > terrain. Then light the 'faces' of the sphere so that it is brightest where > the sun is. Then for each ray/surface intersection point compute the normal > at that point and use it to cast a ray towards the sphere. You'll hit a more > or less bright on that sphere, and this point is then used as a light source > (the color of that point on the sphere then represents the color of the > light emitted from the 'virtual' light source). I'm not quite sure what will > happen to the shadows, but it's possible that they'll be correct (including > penumbrae). > > Maybe I'm wrong, but I have the feeling, that this can look more than just > good. > > Everyone: What do you think? > > Niki > |
From: Klaus H. <k_h...@os...> - 2000-08-29 06:11:54
|
Mark, From: Mark Wilczynski <mwi...@cy...> > Hi Niki, > > You could also try the trick that many people used when > making outdoor levels for Quake based games. They create a > 2D grid of lightsources on a plane in the sky. The > brightness of each light is adjusted based on the sun > position. This method approximates an area light source > (sky/clouds) instead of just a point light (sun). This would be another option, but if I understand it correctly, then you lose the properties of a directional light source. I'll have a look at the modeling sites, though. > Search > around the Quake modeling sites for more details. By the > way... I think your lightmap looks fine. Lightmaps never > look very good when viewed alone. I disagree. I have tried the method I described, and the results look great (including the dark sides of the mountains). The method has all the features I was looking for, except that the shadows are still sharp (didn't take care about this, yet). My current implementation of this is sort of brute force, though: I specify the position of the sun as a point on a unit sphere (longitude, latitude). Then for each vertex of the surface, I calculate the vertex normal, and then use this normal to calculate a second point on the unit sphere (longitude, latitude). Then I compute the shortest distance between the two points on the sphere (that is along the great circle). This gives a distance in the range [0; PI]. I divide this distance by PI to get a distance in the range [0; 1], and then I apply a bias-function to the distance in order to compute the light intensity. I'm sure there's cheaper methods to compute this, but here's some help for those who'd like to try this: float GreatCircleDistance(float lon1, float lat1, float lon2, float lat2) { float theta = lon2 - lon1; float dist = acos(sin(lat2) * sin(lat1) + cos(lat1) * cos(lat2) * cos(theta)); if (dist < 0) dist += PI; return dist / PI; } A vertex normal can be converted into (lonVertex, latVertex) as follows (y-component represents elevation): lonVertex = atan2(normal.z, normal.x) latVertex = atan2(normal.y, sqrt(normal.x^2 + normal.z^2)) For the shadow casting you may also need to convert the light source's (lonLight, latLight) into a unit vector: lightDir.x = cos(lonLight) * cos(latLight); lightDir.y = sin(latLight); lightDir.z = sin(lonLight) * cos(latLight); The intensity is computed as follows: I = GreatCircleDistance(lonLight, latLigh, lonVertex, latVertex); I = 1.0f - pow(I, log(b) / log(0.5)); Where b is the bias. In this case, b is some value > 0.5 (I used 0.6). This basically defines the gradient of the intensity over the sphere. I'll probably try a couple of other functions, too, and see what yields the best results. > You have to blend them > with a noisy base texture to get a decent effect. The noisy base texture will further enhance the quality, yes. Thanks, Niki |
From: Klaus H. <k_h...@os...> - 2000-08-27 16:22:41
|
Phil, Yes, this is sort of like distributed ray tracing. I was hoping to avoid this, because it's very slow as you already say. In distributed ray tracing you basicall cast 16 different ray through the same pixels, and then average the result. The additional features of this are (more information in "Advanced Animation and Rendering Techniques"): - blurred reflections - blurred refractions - soft shadows (penumbrae) - depth of field (focusing) - blur due to relative motion of the virtual camera and the scene. As far as I understand it, it's also pretty memory intense, but maybe there's no other option. However, I'll try your method first, as it's easy to incorporate into my current implementation. Thanks, Niki ----- Original Message ----- From: Phil Bak <ph...@de...> > hey, > > i do the same thing as you except i have one directional > light for the sun, cast the ray and then if it intersects > don't add on the diffuse just leaving the ambient. > > i found i have to play with the sun's direction a lot > to get good results - really long shadows seem to look > a little weird for me. > > >For example, is there a way to have real penumbrae in the > >shadows. > > this is a fudge but what i've been doing is creating 7 > lightmaps and then do something like... > > GenerateLightmap( lightmap0, lightlist ); > file://x jitter by 10% > JitterLights( lightlist, 0.1, 0.0, 0.0 ); > GenerateLightmap( lightmap1, lightlist ); > JitterLights( lightlist, -0.1, 0.0, 0.0 ); > GenerateLightmap( lightmap2, lightlist ); > file://y jitter by 10% > JitterLights( lightlist, 0.0, 0.1, 0.0 ); > GenerateLightmap( lightmap3, lightlist ); > JitterLights( lightlist, 0.0, -0.1, 0.0 ); > GenerateLightmap( lightmap4, lightlist ); > file://z jitter by 10% > JitterLights( lightlist, 0.0, 0.0, 0.1 ); > GenerateLightmap( lightmap5, lightlist ); > JitterLights( lightlist, 0.0, 0.0, -0.1 ); > GenerateLightmap( lightmap6, lightlist ); > > and then just average all the lightmaps into a final one. > > all the jitter function is doing is changing the positions > of the lights... like i said, it's a big hack but those hard > shadows went soft immediately and look pretty good now. > > the downside of course is that it takes a long time to > generate a final lightmap. > > >I could blur the image, but that just wouldn't be the same. > > i tried this before doing the above and couldn't get > anything decent too. > > regards. > > Phil Bak > ICQ:11204037 Tel:01908 393837 Email:ph...@de... Web:www.deepred.co.uk > --- > > Privileged/Confidential Information may be contained in this message. If > you are not the addressee indicated in this message (or responsible for > delivery of the message to such person), you may not copy or deliver this > message to anyone. In such case, you should destroy this message and kindly > notify the sender by reply email. Please advise immediately if you or your > employer does not consent to Internet email for messages of this kind. > Opinions, conclusions and other information in this message that do not > relate to the official business of my firm shall be understood as neither > given nor endorsed by it. |
From: Johan H. <jh...@mw...> - 2000-08-27 17:20:18
|
Hi,, have you read my previous email on radiocity in hardware? Thta should solve most of this? I dont really know how this comares in speed to your current method though. Johan |
From: Klaus H. <k_h...@os...> - 2000-08-28 07:02:25
|
Johan, yes I did read your post, but it was too late to completely understand it. But... I have all intentions to make things look good with the approach I'm currently using. Your two methods would be completely different from what I'm doing right now, and I'd like to avoid that. Maybe I'll give it a try as soon as the my current version yields acceptable results. I'll let you know, when I do. Niki ----- Original Message ----- From: Johan Hammes <jh...@mw...> > Hi,, have you read my previous email on radiocity in hardware? Thta should > solve most of this? > I dont really know how this comares in speed to your current method though. > > Johan > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |