POV-Ray : Newsgroups : povray.newusers : How can I make a sun-like object? Server Time
23 Dec 2024 01:32:34 EST (-0500)
  How can I make a sun-like object? (Message 1 to 10 of 10)  
From: D103
Subject: How can I make a sun-like object?
Date: 4 Sep 2010 19:55:01
Message: <web.4c82da9e901b2f6783747d3f0@news.povray.org>
I have made a scene using heightfields to make a mountain range, and I wanted to
add a sun positioned just above the mountains. I have tried using a sphere with
media, a disc object with a pigment map, and a looks_like statement, but nothing
seems to work. If anyone can help I would appreciate it.

D103


Post a reply to this message

From: clipka
Subject: Re: How can I make a sun-like object?
Date: 5 Sep 2010 12:22:58
Message: <4c83c3e2@news.povray.org>
Am 05.09.2010 01:52, schrieb D103:
> I have made a scene using heightfields to make a mountain range, and I wanted to
> add a sun positioned just above the mountains. I have tried using a sphere with
> media, a disc object with a pigment map, and a looks_like statement, but nothing
> seems to work. If anyone can help I would appreciate it.

You might want to explain /what/ seems wrong with those approaches.


Post a reply to this message

From: Warp
Subject: Re: How can I make a sun-like object?
Date: 5 Sep 2010 15:00:40
Message: <4c83e8d8@news.povray.org>
D103 <nomail@nomail> wrote:
> I have made a scene using heightfields to make a mountain range, and I wanted to
> add a sun positioned just above the mountains. I have tried using a sphere with
> media, a disc object with a pigment map, and a looks_like statement, but nothing
> seems to work. If anyone can help I would appreciate it.

  A disc object would probably work ok. It's just a question of designing
a good and realistic texture for it.

-- 
                                                          - Warp


Post a reply to this message

From: D103
Subject: Re: How can I make a sun-like object?
Date: 5 Sep 2010 19:45:01
Message: <web.4c84284fb7c5d6bffbcf4b170@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 05.09.2010 01:52, schrieb D103:
> > I have made a scene using heightfields to make a mountain range, and I wanted to
> > add a sun positioned just above the mountains. I have tried using a sphere with
> > media, a disc object with a pigment map, and a looks_like statement, but nothing
> > seems to work. If anyone can help I would appreciate it.
>
> You might want to explain /what/ seems wrong with those approaches.

The disc had a pigment map, which started of as white, changed to yellow about
half way, and then faded to transparency. It also had an ambient of 1, and was
at the same position as the light source. When rendered the disc showed up as
pure white, even when I reversed the pigment map.

The sphere was also at the same position, and used scattering media with a
density map. When I rendered it, it looked like a flat yellow disc.

Both objects were positioned at about <2000, 250, 0> and had radii of 100, with
the camera at <2, 0.01, 0> and looking at <1, 0.05, 0>. There were two planes
simulating clouds at y*0.3 and y*0.7, and at one stage I replaced these with a
box covering the area from <3, 0.3, 4> <-3, 1, -4> with media, but this still
did not give any glare.

I hope this makes it clearer.


Post a reply to this message

From: Warp
Subject: Re: How can I make a sun-like object?
Date: 6 Sep 2010 14:50:15
Message: <4c8537e7@news.povray.org>
D103 <nomail@nomail> wrote:
> The disc had a pigment map, which started of as white, changed to yellow about
> half way, and then faded to transparency. It also had an ambient of 1, and was
> at the same position as the light source. When rendered the disc showed up as
> pure white, even when I reversed the pigment map.

  What pigment map, exactly? (Better yet: Show us the entire object
definition.)

-- 
                                                          - Warp


Post a reply to this message

From: D103
Subject: Re: How can I make a sun-like object?
Date: 7 Sep 2010 09:50:00
Message: <web.4c863f02b7c5d6bfde8f61900@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> D103 <nomail@nomail> wrote:
> > The disc had a pigment map, which started of as white, changed to yellow about
> > half way, and then faded to transparency. It also had an ambient of 1, and was
> > at the same position as the light source. When rendered the disc showed up as
> > pure white, even when I reversed the pigment map.
>
>   What pigment map, exactly? (Better yet: Show us the entire object
> definition.)
>
> --
>                                                           - Warp

Here are the relevant objects :

#declare LiPo = <-2000, 250, 0>;

light_source { LiPo White }

disc { 0, y, 100 pigment { cylindrical pigment_map { [ 0 rgb 1 ] [ 0.5 rgb <1,
1, 0.5> ] [ 1 rgbt 1 ] }
} finish { ambient 1 } rotate z*90 translate LiPo }

sphere { LiPo, 100 hollow pigment { Clear } interior { media { scattering { 1, 1
} density { spherical density_map { [ 0 rgb 1 ] [ 0.25 rgbt <1, 1, 0.5, 0.5> ] [
1 rgbt 1 ] } } } } }

camera { location <2, 0.05, 0> right x*16/9 look_at <0, 0.2, 0> }

I have enabled radiosity with media on for this scene.


D103


Post a reply to this message

From: Warp
Subject: Re: How can I make a sun-like object?
Date: 7 Sep 2010 14:26:31
Message: <4c8683d7@news.povray.org>
D103 <nomail@nomail> wrote:
> disc { 0, y, 100 pigment { cylindrical pigment_map { [ 0 rgb 1 ] [ 0.5 rgb <1,
> 1, 0.5> ] [ 1 rgbt 1 ] }
> } finish { ambient 1 } rotate z*90 translate LiPo }

  Your pigment makes a small circle of radius 1 at the center of a huge disc
of radius 100.

  Make your disc have a radius of 1, then apply the pigment, then scale it
up to 100. (And you might want to use a color_map instead of a pigment_map.)

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: How can I make a sun-like object?
Date: 7 Sep 2010 17:51:07
Message: <4c86b3cb$1@news.povray.org>

> Warp<war### [at] tagpovrayorg>  wrote:
>> D103<nomail@nomail>  wrote:
>>> The disc had a pigment map, which started of as white, changed to yellow about
>>> half way, and then faded to transparency. It also had an ambient of 1, and was
>>> at the same position as the light source. When rendered the disc showed up as
>>> pure white, even when I reversed the pigment map.
>>
>>    What pigment map, exactly? (Better yet: Show us the entire object
>> definition.)
>>
>> --
>>                                                            - Warp
>
> Here are the relevant objects :
>
> #declare LiPo =<-2000, 250, 0>;

> sphere { LiPo, 100 hollow pigment { Clear } interior { media { scattering { 1, 1
> } density { spherical density_map { [ 0 rgb 1 ] [ 0.25 rgbt<1, 1, 0.5, 0.5>  ] [
> 1 rgbt 1 ] } } } } }
>
That media is white at the origin (absolute location <0,0,0>), shifting 
to light yellow at 0.25 unit radius, then back to white at 1 unit and 
stay white everywhere. The sphere is not centered at the origin, the 
non-white part of the pattern is totaly outside the sphere.
> I have enabled radiosity with media on for this scene.
>
>
> D103
>
>

Radiosity have no effect on the media. "media on" in the radiosity block 
enable the media to affect it's surrounding.

Why do you use rgbt in your density map? rgbt 1 acts like rgb 1.

I'd use simply this:

sphere { 0, 1 // unit sphere at the origin
hollow pigment { Clear }
interior { media { scattering { 1, 1}
  density {
  spherical density_map { [ 0 rgb 1 ] [ 0.75 rgb <1, 1, 0.5> ] [1 rgb 1 
] } } } }
  // NO transmit as it don't work for media
scale 100 // Scale up to desired dimention
translate LiPo // Finaly, place it where you want it.
}



Alain


Post a reply to this message

From: D103
Subject: Re: How can I make a sun-like object?
Date: 8 Sep 2010 08:50:01
Message: <web.4c8784d3b7c5d6bf8652f2de0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> D103 <nomail@nomail> wrote:
> > disc { 0, y, 100 pigment { cylindrical pigment_map { [ 0 rgb 1 ] [ 0.5 rgb <1,
> > 1, 0.5> ] [ 1 rgbt 1 ] }
> > } finish { ambient 1 } rotate z*90 translate LiPo }
>
>   Your pigment makes a small circle of radius 1 at the center of a huge disc
> of radius 100.
>
>   Make your disc have a radius of 1, then apply the pigment, then scale it
> up to 100. (And you might want to use a color_map instead of a pigment_map.)
>
> --
>                                                           - Warp

I have done as you suggested with the disc, and got a relatively successful
result. It still needs some adjusting, but I think you've put me on the right
track.

Thanks very much everyone who's helped.

D103


Post a reply to this message

From: clipka
Subject: Re: How can I make a sun-like object?
Date: 17 Sep 2010 17:18:48
Message: <4c93db38@news.povray.org>
Am 07.09.2010 15:41, schrieb D103:

> light_source { LiPo White }
>
> disc { 0, y, 100 pigment { cylindrical pigment_map { [ 0 rgb 1 ] [ 0.5 rgb<1,
> 1, 0.5>  ] [ 1 rgbt 1 ] }
> } finish { ambient 1 } rotate z*90 translate LiPo }

Some things to note here:

* rgb<1,1,0.5> is not saturated yellow; you do have blue within this.

* The finish sets ambient to 1, but does not explicitly force the other 
components to 0, so as a result they will be left to their defaults.

As a result, in the region where yellow colour should show, the disc 
gets rgb<1,1,0.5> /plus/ a (guesstimated) rgb<1,1,0.5>*0.6 diffuse 
illumination from the light source, /plus/ some radiosity illumination 
coming back from the scene, maybe another rgb<1,1,0.5>*0.3, /plus/ 
possibly some specular highlight from the light source, /plus/ some 
light scattered from the atmosphere (which, by the way, is mainly 
blue!), giving a total of maybe rgb<1,1,0.5>*2 + blue 0.5 = 
rgb<2,2,1.5>. As the color is clipped to a maximum of 1.0 by most output 
formats (namely by all except HDR and EXR), you get a value of around 
rgb<1,1,1>, which is white as white can be.

* At the rim, the disc fades to fully-transparent white, rather than 
fully-transparent yellow. As a result, the colours further off the 
center will be more pale than you'll probably expect.

* You got the cylindrical pattern wrong way round: 0.0 (where you placed 
white) is at a distance of 1.0, while 1.0 (where you placed full 
transparency) is at the very center.

* You use a 100-unit-radius disc, yet the pattern already yields 0.0 at 
a distance of 1 unit or more.


So to fix this up, you should...

* set up a disc of 1 unit radius, apply a pigment, /then/ scale it to 
the desired size and position it; e.g.:

     disc { 0, y, 1
       pigment { ... } finish { ... }
       scale 100
       rotate ...
       translate ...
     }

* fix the pigment_map indices:

     pigment_map {
       [ 0   ...(transparent)... ]
       [ 0.5 ...(yellow)... ]
       [ 1.0 ...(white)... ]
     }

* Change your yellow and transparent colors:
- If you're using scattering media for the atmosphere, theoretically the 
scattering media should take care of giving your sun a yellowish hue 
(that's what the "extinction" parameter is for; set it to 1.0), so your 
sun should fade from opaque white to transparent white:

     pigment_map {
       [ 0   rgb 1 transmit 1 ]
       [ 0.5 rgb 1 ]
       [ 1.0 rgb 1 ]
     }

- If you're using a sky sphere for the atmosphere, you will need to toy 
around with your yellow a bit, but make sure you use the same colour, 
except with added transparency, to fade to, e.g.:

     pigment_map {
       [ 0   rgb <1,1,0.5> transmit 1 ]
       [ 0.5 rgb <1,1,0.5> ]
       [ 1.0 rgb 1 ]
     }

* explicitly specify finish components you don't want:

     finish {
       ambient 1 // (use "ambient 0 emission 1" for current 3.7 betas)
       diffuse 0
       specular 0
     }


I think that should get you back on the tracks with the disc approach.


> sphere { LiPo, 100 hollow pigment { Clear } interior { media { scattering { 1, 1
> } density { spherical density_map { [ 0 rgb 1 ] [ 0.25 rgbt<1, 1, 0.5, 0.5>  ] [
> 1 rgbt 1 ] } } } } }

Your media approach suffers from similar issues as stated above (plus 
it's more difficult to control even when it works).


Post a reply to this message

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