POV-Ray : Newsgroups : povray.general : The sun and stars : Re: The sun and stars Server Time
4 Aug 2024 14:20:53 EDT (-0400)
  Re: The sun and stars  
From: Tek
Date: 19 Apr 2003 12:58:19
Message: <3ea1802b$1@news.povray.org>
Well the physical phenomenon that stops the stars being visible is the iris of
your eye or the camera. so to simulate that you'd want a sun that was much
brighter than the stars, then darken the entire image when the sun's in view.

But anyway, the code you posted seems a little strange, because bits of your sky
will become transparent. Your pigment_map uses two textures, one of which has
some transparency.

The way I do it is to layer the sun texture over the stars:

sky_sphere {
    pigment {
        pStars
    }
    pigment {
       gradient y scale 2
       translate -1 poly_wave 50
       colour_map {
            [0 rgb <3,2,1> transmit 1]
            [1 rgb <3,2,1> transmit 0]
       }
   }
}

The important thing here is that the transmit channel of the sun is controlling
how visible the stars are, so in the centre of the sun there's no stars
(transmit 0), and as the sun fades out they fade in.

If you want a larger region without stars but without affecting the sun's fade,
things get more complex, but something like this should work:


sky_sphere {
    pigment {
        pStars
    }
    pigment {
       gradient y scale 2
       translate -1 poly_wave 50
       colour_map {
            [0 rgb <3,2,1>*.5 transmit 1]
            [.5 rgb <3,2,1>*.5 transmit 0] //darken the sun but don't show any
stars through
            [1 rgb <3,2,1> transmit 0]
       }
   }
}

But I'm not entirely sure what effect you're trying to get. If you just fade out
the stars earlier you'll get a dark ring round the sun.

BTW, the "rgbt 1" was a typo in my original code, it was meant to be "rgb
<3,2,1> transmit 1", but I didn't fix it cause it didn't look too bad. With rgbt
1 it means the sun colour fades from orange to white as it becomes more
transparent, which is not the effect I wanted.

--
Tek
http://www.evilsuperbrain.com


"Rich" <SrP### [at] ricoswebcom> wrote in message
news:Xns### [at] 204213191226...
>     Tek has posted some really nice work in the images group, and I've
> borrowed some of the code that he and others have posted regarding the
> rendering of realistic star fields and the sun.  The problem I'd like to
> address in my render is the fact that if the sun is visible to any degree
> in an image, there's absolutely no way you'd be able to see the stars.
>     So, realism is not the best option here, but I'd at least like to
> get rid of the stars that are visible through the sun's "atmosphere" and
> a bit beyond that.  I've attempted to place the pigments in a
> pigment_map, but for some reason the star pigment is washed out and I
> can't figure out why.
>
> Here's the code:
>
> global_settings {
>   assumed_gamma 1.0
> }
>
> camera {
>   location  <0.0, 1.5, -10.0>
>   direction 1.5*z
>   right     x*image_width/image_height
>   look_at   <0.0, 0.0,  0.0>
> }
>
> #declare pStars = pigment {
>   pigment_pattern {
>    crackle form <1,0,0>
>    pigment_map {
>     [0 crackle solid
>        pigment_map {
>          [0 bozo scale 30
>             colour_map {
>               [0 rgb .7]
>               [1 rgb 1.3]
>             } ]
>          [0.75 rgb 0]
>        } ]
>     [1 rgb 0]
>    }
>   }
>   colour_map {
>    [.5 rgb 0]
>    [1 rgb 3]
>   }
>   scale 0.004
>   rotate <45,90,45>
>  }
>
> #declare pSun = pigment {
>   gradient y scale 2
>   translate -1 poly_wave 50
>   colour_map {
>     [0 rgbt 1]
>     [1 rgb <3,2,1>]
>   }
> }
>
> sky_sphere {
>   pigment {
>     gradient y
>     pigment_map {
>       [0.0  pStars]
>       [0.85 pSun]
>     }
>     rotate <80,325,0>
>   }
> }
>
>
> --
> Rich Allen
> (Remove SPAM from my address to reply by e-mail)


Post a reply to this message

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