POV-Ray : Newsgroups : povray.binaries.images : Sky : Re: Sky Server Time
11 Aug 2024 03:32:01 EDT (-0400)
  Re: Sky  
From: Abe
Date: 1 May 2004 09:47:06
Message: <4093aa5a@news.povray.org>
Dave VanHorn wrote:
> How can I get a decent looking sky, given that I'm actually modeling the
> surface of a planet, with light coming from a sun at scale distance?
> 
> I haven't been able to make top lit clouds work at all..
> 
> 
> IOW:
> 
> #declare Inch    = 1;
> #declare Foot    = (Inch * 12);
> #declare Yard    = (Foot * 3);
> #declare CM      = (Inch / 2.54);
> #declare MM      = (CM / 10);
> #declare Meter   = (CM * 100);
> #declare kM      = (Meter * 1000);
> #declare Mile    = (Foot * 5280);
> 
> //El Sol
> #declare Solar_Radius = (696000 * kM);
> #declare Hours        = 12;
> #declare Minutes      = 35;
> #declare Seconds      = 00;
> #declare Latitude     = 40;
> 
> #declare Time = (360 / (24 * 60 *60)) * ((Hours * 60 * 60) + (Minutes * 60)
> + Seconds);
> 
> //For animating the sun, use this
> //#declare Time = ((360 / (24 * 60 * 60)) * ((clock + .25) * 60 * 60 * 24))
> 
> #declare Ceiling   = (25000 * Foot) / (2 * pi);
> #declare Sun_Dist  = (93000000 * Mile);
> #declare Sun_Rad   = sin(radians(0.5))*Sun_Dist;
> #declare Sun_Pos   = <0, 1, 0>; //y+z+x
> #declare Sun_Pos   = vnormalize ( vrotate ( Sun_Pos, 0*x )) * Sun_Dist;
> #declare Sun_Paint = texture { pigment {White * 1} finish {Dull} };
> 
> //This model assumes the sun orbits 0.0.0, and that the planet is a sphere,
> translated to put
> //the interesting part of the surface at 0.0.0
> //Not exactly accurate, but close enough.
> //It's also northern-hemispheric.
> light_source { 0*x color White * 1.1 * (Sun_Dist * Sun_Dist) // Follows
> inverse square law
>                media_attenuation on
>                translate Sun_Pos
>                fade_distance 1
>                fade_power 2
>                rotate <-Latitude, 0, (180 + Time)>
>                looks_like { sphere {<0,0,0> Solar_Radius texture {
> Sun_Paint }}}
>                media_attenuation on
>                }
> 
> 

Just from your set up, I'd hazard a guess that you will run into 
numerical truncation problems related to the eplison value considering 
the largest and smallest values of scale (there is a better way to 
express this, but I can't think of it right now). Then again I could be 
wrong.

As an approximate alternative, since you are centering everything on 
<0,0,0>, you could 1) place the light_source far enough away that it is 
behind all scene elements, but not necessarily as far as Sun_Dist and 
give it the parallel attribute. 2) Use the sky_sphere with the 
appropriate pigment to provide the image of the sun disc.

Getting a good looking sky can be achieved any number of ways, but what 
is important is (in close order): the sky colors, how the sky ( or 
atmosphere) interacts with scene elements including light sources, and 
how the sky (or atmosphere) relates to the scene.

Could you be more specific as to what you are trying to do for top lit 
clouds?

Abe


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.