POV-Ray : Newsgroups : povray.general : Realistic sky sphere at twilight Server Time
1 Nov 2024 11:14:08 EDT (-0400)
  Realistic sky sphere at twilight (Message 1 to 6 of 6)  
From: rodv92
Subject: Realistic sky sphere at twilight
Date: 7 Feb 2012 13:05:00
Message: <web.4f3167556a6d59495d50475e0@news.povray.org>
hello group !

I found on the net a decent model of the sunset sky some years ago.

http://povray.tashcorp.net/tutorials/qd_realskysphere/

the problem is that with the function max(min(y,1),0) or simply gradient y
the sky is red at the horizon at all azimuth.

To be 100% realistic it should be blue and darker at the opposite direction of
the sunset.

So i thought : Change the function, but correct me if i am wrong, the function
should be (z,y) -> f(z,y) and not y -> f(y) only (when the camera is looking
along the +z axis)

I don't think that a color map can handle two degrees of freedom ??

Other option : two pigment declarations for the sky sphere, one for x, other for
z, and play with transparency : results are quite disappointing , since a dark
streak appears from 0 to 180*y (the goal is to make the sky darker / blue only
near the horizon at the opposite azimuth of the sunset.

Thanks for any ideas !


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Realistic sky sphere at twilight
Date: 7 Feb 2012 15:38:11
Message: <4f318bb3$1@news.povray.org>
rodv92 wrote:

> I don't think that a color map can handle two degrees of freedom ??

the pattern function is 3d to 1d (x,y,z) -> f(x,y,z)

the color_map only maps the 1d value to a color.

So the color may depend on more than one dimension,
(of course, not when using the gradient pattern).


Post a reply to this message

From: rodv92
Subject: Re: Realistic sky sphere at twilight
Date: 7 Feb 2012 22:15:01
Message: <web.4f31e82db6d52b385d50475e0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> rodv92 wrote:
>
> > I don't think that a color map can handle two degrees of freedom ??
>
> the pattern function is 3d to 1d (x,y,z) -> f(x,y,z)
>
> the color_map only maps the 1d value to a color.
>
> So the color may depend on more than one dimension,
> (of course, not when using the gradient pattern).

thanks, i updated the function, and in my case i can simplify the function since
sunset is at z = 1 on the sky sphere and the opposite point is z = -1, i think
that there are no variations along the x axis, or at least we can omit them and
still have a quite realistic sky sphere.

so i figured this function :

{function { min(max(min(y,1),0) * pow((1 + abs(z - 1)),2),1)

I think that using the f(x) * f(z) form is good to "squeeze" the color segments,
but maybe what i need is to "stretch" the sky sphere to make the entries with a
red hue on the color map go below the horizon.

so maybe this is what i need :

f(x) * f(z) + g(z) (with g(z) growing when z decreasing)
or simply f(x) - g(z)

of course if anyone has some knowledge of the "real" mathematical model for a
twilight sky sphere (and an approximative function) , i ll be glad to hear it !


Post a reply to this message

From: waggy
Subject: Re: Realistic sky sphere at twilight
Date: 7 Feb 2012 23:45:00
Message: <web.4f31fd01b6d52b389726a3c10@news.povray.org>
> of course if anyone has some knowledge of the "real" mathematical model for a
> twilight sky sphere (and an approximative function) , i ll be glad to hear it !

I looked into this a couple of years ago.  If I recall correctly, a good
approximation can be made by combining a ground fog (Copper can work well) with
a regular gradient on the sky_sphere oriented in the same direction as the sun.
 The gradient's scale and wave form pick the first color in the color_map for
the sky right behind the sun, while the last color shows up on the opposite side
of the sky_sphere (usually below the horizon).  The color_map for the gradient
will vary with the time of day.

The sky sphere simulates the molecular (Raleigh) scattering, while the ground
fog approximates lower-atmosphere aerosol (water and solid particle) scattering.


Post a reply to this message

From: Alain
Subject: Re: Realistic sky sphere at twilight
Date: 8 Feb 2012 16:21:46
Message: <4f32e76a@news.povray.org>

>
>> of course if anyone has some knowledge of the "real" mathematical model for a
>> twilight sky sphere (and an approximative function) , i ll be glad to hear it !
>
> I looked into this a couple of years ago.  If I recall correctly, a good
> approximation can be made by combining a ground fog (Copper can work well) with
> a regular gradient on the sky_sphere oriented in the same direction as the sun.
>   The gradient's scale and wave form pick the first color in the color_map for
> the sky right behind the sun, while the last color shows up on the opposite side
> of the sky_sphere (usually below the horizon).  The color_map for the gradient
> will vary with the time of day.
>
> The sky sphere simulates the molecular (Raleigh) scattering, while the ground
> fog approximates lower-atmosphere aerosol (water and solid particle) scattering.
>
>

You can combine that with some layered pigments on your sky_sphere.
A gradient with a bright spot where the sun is located, then, a mostly 
transparent, filtering, vertical gradient used to tint the "sun" spot.
Then, you can use some fog or even media in a container some distance up 
to make your clouds.



Alain


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Realistic sky sphere at twilight
Date: 20 Feb 2012 23:15:01
Message: <web.4f43191cb6d52b38d7f39bd00@news.povray.org>
"rodv92" <nomail@nomail> wrote:
> hello group !
>
> I found on the net a decent model of the sunset sky some years ago.
>
> http://povray.tashcorp.net/tutorials/qd_realskysphere/
>
> the problem is that with the function max(min(y,1),0) or simply gradient y
> the sky is red at the horizon at all azimuth.
>
> To be 100% realistic it should be blue and darker at the opposite direction of
> the sunset.
>
> So i thought : Change the function, but correct me if i am wrong, the function
> should be (z,y) -> f(z,y) and not y -> f(y) only (when the camera is looking
> along the +z axis)
>
> I don't think that a color map can handle two degrees of freedom ??
>
> Other option : two pigment declarations for the sky sphere, one for x, other for
> z, and play with transparency : results are quite disappointing , since a dark
> streak appears from 0 to 180*y (the goal is to make the sky darker / blue only
> near the horizon at the opposite azimuth of the sunset.
>
> Thanks for any ideas !

Excellent idea!

I only have one suggestion.  Why not construct the color_map automatically using
a loop and eval_pigment?

load the image as an image_map pigment, scale it to the right proportions
(dimensions don't matter), an

color_map {
    #local cStep = 0;
    #while(cStep < pigment_size)
        [1/numSteps srgb eval_pigment(...) ]
    #local cStep = cStep + stepSize * (pigment_size / image_height);
    #end
    }

Regards,

A.D.B.


Post a reply to this message

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