|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |