POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Re: Sky simulation Server Time
30 Jul 2024 00:26:50 EDT (-0400)
  Re: Sky simulation  
From: Thomas de Groot
Date: 7 Jun 2013 04:04:25
Message: <51b19409$1@news.povray.org>
On 7-6-2013 9:36, scott wrote:
> I've created a macro called SkySim (I'll post it in p.b.s-f once I've
> tidied it up and added comments) that creates a realistic looking sky
> pigment in a sky_sphere based on the sun position and the "haziness" of
> the sky.
>
Interestingly, I use the following code to the same effect. I do not 
remember who proposed this code first unfortunately.

//code start
#declare fn_horizon = function {max(y, 0)}
#declare fn_sun =
function {
   pattern {
     spherical
     scale 3
     translate z
     rotate -Al*x
     rotate Az*y
   }
}

sky_sphere {
   pigment {
     function {pow(fn_horizon(x,y,z)*(1-fn_sun(x,y,z)), 0.400)}
     color_map {
       [0.000 color SunColor]
       [0.426 color srgb <94,  115,  215>/255]
     }
   }
}
//code end

Al (altitude) and Az (azimuth) are found using sunpos.inc; SunColor with 
CIE.inc.

Thomas


Post a reply to this message

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