POV-Ray : Newsgroups : povray.binaries.images : Probably I'm just in fact too stupid... Server Time
31 Jul 2024 14:22:02 EDT (-0400)
  Probably I'm just in fact too stupid... (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Jörg 'Yadgar' Bleimann
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 17:38:40
Message: <4b0f0370@news.povray.org>
High!

Alain wrote:

> You have TWO (2) medias. An emissive one and a scattering one.

Now I removed the emissive media...

> You did NOT reduce the density of your scattering media, and that is 
> your problem.

After I adapted the scattering media density reciprocally to the scale 
(i. e. 1/36800) I got extremely faint transparent rings - both with and 
without absorption 1/36800, see first two images.

When I increased scattering density to 1/368, the rings became more 
visible - but still almost black on the unlit side, with some bizarre 
geometry showing up on the planet's night side (see third image)!

Could this be an effect of using filter in the color_map?

Here is the code for the last image:

global_settings
{
   max_trace_level 10
}

union
{
   sphere
   {
     0, 1
     texture
     {
       pigment { color rgb <0.6, 0.4, 0> }
       finish { ambient 0.02 diffuse 1 brilliance 0.8 }
     }
   }
   difference
   {
     cylinder
     {
       <0, -0.001, 0>, <0, 0.005, 0>, 3.68
     }
     cylinder
     {
       <0, -0.0011, 0>, <0, 0.0011, 0>, 1.75
     }
     hollow
     pigment { rgbt 1 }
     interior
     {
       media
       {
         // emission 1/36800
         scattering
         {
           5, 1/368
           // eccentricity -0.4
           // extinction 1
         }
         // absorption 1/36800
         density
         {
           cylindrical
           color_map
           {
             [0 rgbf <1, 0.8, 0.7, 0.2> ]
             [0.1 rgbf <1, 0.8, 0.7, 0.2> ]
             [0.1 rgbf <0.1, 0.3, 0.1, 0.5>]
             [0.17 rgbf <0.1, 0.3, 0.1, 0.5>]
             [0.17 rgbf <0.85, 0.89, 0.94, 0.3>]
             [0.18 rgbf <0.85, 0.89, 0.94, 0.3>]
             [0.18 rgbf <0.99, 0.93, 0.45, 0.4>]
             [0.26 rgbf <0.99, 0.93, 0.45, 0.4>]
             [0.26 rgbf <0.5, 0.23, 0.61, 0.5, 0.4>]
             [0.36 rgbf <0.5, 0.23, 0.61, 0.5, 0.4>]
             [0.36 rgbf <1, 0.92, 0.93, 0.3>]
             [0.45 rgbf <1, 0.92, 0.93, 0.3>]
             [0.45 rgbf <0, 0, 0, 1>]

           }
           scale 3.68
         }
       }
     }
   }
   rotate <2, 7, 0>
   scale 10000
   translate z*50000
}


light_source
{
   <500000, 2500, 5000>
   color rgb 1
}

camera
{
   location <1.5, 1.5, 0.12>
   look_at 1.5
   angle 60
}

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2009-11-25 media test, take 44.jpg' (8 KB) Download '2009-11-25 media test, take 45.jpg' (8 KB) Download '2009-11-25 media test, take 46.jpg' (10 KB)

Preview of image '2009-11-25 media test, take 44.jpg'
2009-11-25 media test, take 44.jpg

Preview of image '2009-11-25 media test, take 45.jpg'
2009-11-25 media test, take 45.jpg

Preview of image '2009-11-25 media test, take 46.jpg'
2009-11-25 media test, take 46.jpg


 

From: Jaime Vives Piqueres
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 18:15:39
Message: <4b0f0c1b@news.povray.org>

> High!
>
> Jaime Vives Piqueres wrote:
>> If you scale UP the container, you have to scale DOWN the media
>> strength! Just try .05 instead 1338181 and you will see the effect...
>> I just tried it and works.
>
> With me, it didn't work at all... still the unlit side is completely
> dark! And when I tried the same combination of scattering and absorption
>  on the real Saturn scene, where the rings are about 11 units wide (then
>  respectively 1/11 for scattering and absorption strength), the entire
> ring (when viewed upon from the lit side) remains invisible, although
> its shadow is visible on the planet's body!
>

   Sorry, I did a poor reading, and for the images I assumed too quickly your
problem was just the ultra-bright media... trying with your code on the last
message, I see that using extinction 0 gives the effect you are looking for.
But I still don't know very well why it doesn't works with the default,
teorically realistic, value of 1.

> watching TV shows instead of overburdening my feeble chicken brain with
> such monstrous tasks like raytracing...

   I've a poor brain too, but I discovered it doesn't matters if you have the
power of unlimited "trial&error" at your disposal... ;)

P.S.: You still have the rgbf on the media, which doesn't works as you
think... and you even supplied some of the entries with 5 components colors!
(although it really doesn't matters for your problem).


-- 
Jaime Vives Piqueres

http://www.ignorancia.org


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 19:11:58
Message: <4b0f194e@news.povray.org>
High!

Jaime Vives Piqueres wrote:

 >   Sorry, I did a poor reading, and for the images I assumed too 
quickly your
 > problem was just the ultra-bright media... trying with your code on 
the last
 > message, I see that using extinction 0 gives the effect you are 
looking for.

Yes, that's quite logical... I tried it, and it at least yielded roughly 
the result I want to achieve in the long run! Thank you for the tip... 
perhaps I'll up the extinction value to, let's say, 0.1 or 0.15, as the 
unlit side is of course somewhat darker than the lit side, irrespective 
of light filtering through...

...but I also found out, that with an exactly reciprocal scattering 
strength, the rings become too faint - so I instead made it ten times 
stronger (i. e. 1/3680 rather than 1/36800) - see attached images (first 
image: unlit side, second image: lit side)!

But, to bring my problem to a "meta level": although I now work more or 
less frequently since early 1996 with POV-Ray, I never got much beyond 
beginners' skills - since 2000 I keep track of this group, and I've seen 
thousands of incredibly sophisticated works (@Jaime Vives Piqueres: for 
example your autobahn scene!), and when I compare them to my puny 
primitive scenes, I'm close to cry for an euthanasia injection, as I'm 
obviously virtually unable to learn from my mistakes... and I HATE 
myself for being so dysfunctional!

And I'm really not sure whether having more hobbies than just POV-Ray 
(i. e. astronomy, electronic music, Afghanistan...) is the reason... to 
me it appears that not so few people who regularly contribute pictures 
here have access to, hmmm, time-compressing drugs which allow them to 
learn and work 72 hours a day...

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2009-11-26 media test, take 47.jpg' (13 KB) Download '2009-11-26 media test, take 48.jpg' (13 KB)

Preview of image '2009-11-26 media test, take 47.jpg'
2009-11-26 media test, take 47.jpg

Preview of image '2009-11-26 media test, take 48.jpg'
2009-11-26 media test, take 48.jpg


 

From: Reactor
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 19:35:02
Message: <web.4b0f1e5d9422158050814e370@news.povray.org>
> After I adapted the scattering media density reciprocally to the scale
> (i. e. 1/36800) I got extremely faint transparent rings - both with and
> without absorption 1/36800, see first two images.
>
> When I increased scattering density to 1/368, the rings became more
> visible - but still almost black on the unlit side, with some bizarre
> geometry showing up on the planet's night side (see third image)!
>
> Could this be an effect of using filter in the color_map?
>

Some of the artifacts you are seeing is probably a result of self-shadowing.  To
test this, try varying the angle between the rings and sun a little bit, then
test a different extinction value, probably 0.5

 You should consider removing the filtering component also, as scattering media
is inherently filtering, and the thickness or brightness comes from the color's
distance from black.  Also note that close color control is more easily done by
splitting the single scattering media into a scattering media with no
extinction, and an absorption media that has a different color_map.

The reason for this is that the color scattered is also the color absorbed, and
it can be easier to control the color closely if you scatter the color you wish,
but absorb all colors equally.  This can also be done in reverse - scatter all
light (white), but absorb the color opposite of the color you want the media to
be (this may be closer to what happens in real life).

Anyway, here is some code I made from yours.  It uses a simple macro to createa
a more complex density that gives the rings from "grain" (that probably wouldn't
be visible from this distance, but looks neat IMHO).




//--------------- beginning of code

global_settings
{
   max_trace_level 10
}


#macro wrink(SomeColor, Thickness, ScaleV)
// SomeColor is the color scattered (and absorbed!)
// Thickness defines the ratio of the color supplied as compared to empty
(black)
// ScaleV determines the size of the wrinkle pattern, and therefore the grain
size.
wrinkles
scale ScaleV
color_map{
    [0.00 color rgb SomeColor ]
    [Thickness color rgb <0,0,0>   ]
    [1.00 color rgb <0,0,0>   ]
    }


#end


#declare ShowRings = on;

union
{
   sphere
   {
     0, 1
     texture
     {
       pigment { color rgb <0.6, 0.4, 0> }
       finish { ambient 0.00 diffuse 1 brilliance 1 }
     }
   }
#if( ShowRings )
   difference
   {
     cylinder
     {
       <0, -0.001, 0>, <0, 0.005, 0>, 3.68
     }
     cylinder
     {
       <0, -0.0011, 0>, <0, 0.0011, 0>, 1.75
     }
     hollow
     pigment { rgbt 1 }
     interior
     {
       media
       {
         //emission 1/500
         scattering
         {
           1, 1/200
           extinction 0.5 // 1.00 is also ok
         }
         density
         {
           cylindrical
           density_map
           {
           /*
             [0.00 rgbf <1.00, 0.80, 0.70, 0.20> ]
             [0.10 rgbf <1.00, 0.80, 0.70, 0.20> ]
             [0.10 rgbf <0.10, 0.30, 0.10, 0.50> ]
             [0.17 rgbf <0.10, 0.30, 0.10, 0.50> ]
             [0.17 rgbf <0.85, 0.89, 0.94, 0.30> ]
             [0.18 rgbf <0.85, 0.89, 0.94, 0.30> ]
             [0.18 rgbf <0.99, 0.93, 0.45, 0.40> ]
             [0.26 rgbf <0.99, 0.93, 0.45, 0.40> ]
             [0.26 rgbf <0.50, 0.23, 0.61, 0.50> ]
             [0.36 rgbf <0.50, 0.23, 0.61, 0.50> ]
             [0.36 rgbf <1.00, 0.92, 0.93, 0.30> ]
             [0.45 rgbf <1.00, 0.92, 0.93, 0.30> ]
             [0.45 rgbf <0.00, 0.00, 0.00, 1.00> ]
            */
                [0.00 wrink( <0.00, 0.00, 0.00> * 0.00, 0.5, 10/10000) ]
              #local I = 0;
              #local MaxI = 200;
              #local rs1 = seed(3240);
              #while( I < MaxI )
                // add bands of lighter and darker rings
                  #if( !mod(I,12) ) #local RandTrend = rand(rs1); #end

                [0.00 + 0.45*I/MaxI
                    wrink(
                        <1.00 - 0.20*rand(rs1), 1.00 - 0.10*rand(rs1), 1.00 -
0.05*rand(rs1)> * (0.5 * rand(rs1) + 0.5) * RandTrend,
                        (0.25 * rand(rs1) + 0.5),    (2+rand(rs1)*18)/10000
                    )
                ]
              #local I = I + 1;
              #end
                [0.45 wrink( <0.00, 0.00, 0.00> * 0.00, 0,  4/10000) ]
           }
           scale 3.68
         }
       }
     }
   }

#end

   rotate <15, 7, 1>
   scale 10000
   translate z*50000
   translate y*-2500
}


light_source
{
   <500000, 2500, 5000>
   color rgb 1
}

camera
{
   location <1.5, 1.5, 0.12>
   look_at 1.5
   angle 60
}

//--------------- end of code

    HTH
 -Reactor


P.S.  Please be aware that this was rendered using the default gamma settings
under 3.7, and the brightness may vary, necessitating different scattering
settings.


Post a reply to this message


Attachments:
Download 'yagdar_news.bmp.dat' (2305 KB)

From: Reactor
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 19:45:01
Message: <web.4b0f20269422158050814e370@news.povray.org>
Oops!  I just realized I posted the bmp, not the png as I'd intended:

-Reactor


Post a reply to this message


Attachments:
Download 'yagdar_news.png' (420 KB)

Preview of image 'yagdar_news.png'
yagdar_news.png


 

From: Jörg 'Yadgar' Bleimann
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 19:57:32
Message: <4b0f23fc$1@news.povray.org>
High!

Now as I got at least the planet's shadow on the unlit side of the rings 
  correctly, I wonder how I could have different degrees of transparency 
within the rings - like it is with the real Saturn. I tried adding a 
second density, now with a density_map instead of a color_map - but the 
only thing I observed were different colors, while the transparency 
remained uniform across all ring bands.

What is the difference between a color_map and a density_map within a 
density statement?

Could I achieve different transparencies by adding an absorption media 
with its own density_map? What values of that density map would affect 
transparency?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Reactor
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 20:30:01
Message: <web.4b0f2aae9422158050814e370@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> High!
>
> Now as I got at least the planet's shadow on the unlit side of the rings
>   correctly, I wonder how I could have different degrees of transparency
> within the rings - like it is with the real Saturn. I tried adding a
> second density, now with a density_map instead of a color_map - but the
> only thing I observed were different colors, while the transparency
> remained uniform across all ring bands.
>
> What is the difference between a color_map and a density_map within a
> density statement?
>
> Could I achieve different transparencies by adding an absorption media
> with its own density_map? What values of that density map would affect
> transparency?
>
> See you in Khyberspace!
>
> Yadgar


The second density is very different from a second media - Read the
documentation section on multiple density V.S multiple media.

A density_map is comparable to a pigment_map - it allows density entries within
the map.

The level of transparency is more or less a combination between the distance
from black of the color vector and also the initial color vector for the media
type statement.

example:
emission color rgb <1,1,1>
density{ color rgb 0.01 }

is visually identical to this:

emission color rgb <1,1,1> * 0.01
density{ color rgb 1 }



    HTH
 -Reactor


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Probably I'm just in fact too stupid...
Date: 26 Nov 2009 20:33:27
Message: <4b0f2c67$1@news.povray.org>
High!

Jaime Vives Piqueres wrote:

>   Sorry, I did a poor reading, and for the images I assumed too quickly 
> your
> problem was just the ultra-bright media... trying with your code on the 
> last
> message, I see that using extinction 0 gives the effect you are looking 
> for.
> But I still don't know very well why it doesn't works with the default,
> teorically realistic, value of 1.

Yes, it did - but only with the test scene, not with the Saturn scene! 
With the latter, when using extinction 0, not even the ring shadow is 
visible, let alone the rings, at extinction 0.1 I can at least see the 
shadow, but still no rings...

The code? Too long and complicated to be posted here, I fear...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Probably I'm just in fact too stupid...
Date: 27 Nov 2009 08:50:25
Message: <4b0fd921@news.povray.org>
High!



> The code? Too long and complicated to be posted here, I fear...

(9 hours of sleep later)

O.k., I'll try it:

[...]
#include "starry_sky.inc" // self-programmed macro to generate a starry 
sky sphere according to real astronomical data, 900 stars, configurable 
according to camera angle and image resolution
#include "functions.inc" // for eval_pigment()

[...]

#declare sc=13347; // 1 POV unit = 13347 kilometres

[...]

#declare rs=0; // radiosity flag, 0 = radiosity off
#declare lores=0; // flag for low resolution Saturnian rings (dependent 
on camera distance in the future)

[...]

#declare F_Standard_Planetary_Surface =
finish
{
   #if (!rs)
     ambient 0.0001
   #end
   diffuse 1
   brilliance 0.8
}

#declare F_Saturn_Rings =
finish
{
   #if (!rs)
     ambient 0.01
   #end
   diffuse 1
   brilliance 0.05
}

#declare F_Saturn_Rings_UnlitSide =
finish
{
   #if (!rs)
     ambient 0.3
   #end
   diffuse 5
   brilliance 0.05
}


#declare cam = 7; // camera mode

// CELESTIAL BODIES OF THE SOLAR SYSTEM DATA
// Column 0: orbital semi-major axis (to the Sun or the respective 
planet) in kilometres
// Column 1: radius in x dimension, in kilometres
// Column 2: radius in y dimension, in kilometres (if oblateness is 
given then stated as -1)
// Column 3: radius in z dimension, in kilometres (if oblateness is 
given then stated as -1)
// Column 4: axial tilt in degrees (planets: relative to orbit around 
the Sun, moons: relative to planet's equatorial plane)
// Column 5: orbital inclination in degrees (planets: relative to 
ecliptic, moons: relative to planet's equatorial plane)
// Column 6: orbital eccentricity
// Column 7: perihelion argument (degrees; if variable (Earth's Moon) 
then stated als -1)
// Column 8: longitude of ascending node (degrees; if variable (Earth's 
Moon) then stated als -1)
// Column 9: oblateness (not taken into account if different radii 
explicitly stated)
// Column 10: declination of north pole (degrees)
// Column 11: right ascension of north pole (degrees!)
// Column 12: albedo (if irrelevant (Sun) stated as -1)

#declare bodies = array [74][12]
{
   {           0,     696000,       -1,      -1,	     7.25,     0, 
  0,             0,         0,       0.000009,  63.87,   286.125   }, 
//   0 - Sun

[...]

{  1433449370,      60268,    54364,   60268,  26.73,        2.484, 
0.055723219, 336.013862,113.642811,-1,       83.537,   40.589    } // 
72 - Saturn

[...]

}

// PROVISIONAL PLANETARY POSITIONS (to be replaced later according to 
astronomically accurate orbital data)

[...]

#declare Pos_Saturn = bodies[72][0]*<sin(radians(157.4)), 0, 
cos(radians(157.4))>;

[...]

// CAMERA DATA

#switch(cam)
[...]
   #case (7) // centered on Saturn, rings oblique view
     #declare camPos = Pos_Saturn + 350000 * <sin(radians(64)), 0, 
cos(radians(64))>;
     #declare camLook = Pos_Saturn;
     #declare camAng = 40;
   #break
   #case (7.01) // view through Saturn's D ring
     #declare camPos = Pos_Saturn + 350000 * <sin(radians(64)), 0, 
cos(radians(64))>;
     #declare camLook = Pos_Saturn+<10000, -32000, 0>;
     #declare camAng = 5;
   #break
   #case (7.02) // centered on Saturn, view of unlit ring side
     #declare camPos = Pos_Saturn + 350000 * <sin(radians(244)), 0, 
cos(radians(244))>;
     #declare camLook = Pos_Saturn;
     #declare camAng = 40;
   #break
#end

// CELESTIAL SPHERE
Stars(6, image_width, camAng, 1.5) // invocation of starry sky sphere macro

#macro SetAxis(dec, ras) // macro for orienting planets
   rotate <bodies[3][4]-(90-dec), 0, 0>
   rotate <0, 90-ras, 0>
#end

light_source // Sun
{
   0
   color rgb 1
   looks_like
   {
     sphere
     {
       0, 1
       texture
       {
        pigment { color rgb <1, 1, 0.85> }
        finish { ambient 1 diffuse 0 }
       }
       scale bodies[0][1]/sc
       SetAxis(bodies[0][10], bodies[0][11])
     }
   }
}

[...]

// the following three image files can be obtained at 
http://www.mmedia.is/~bjj/data/s_rings/index.html

#declare Saturn_Rings_Colors =
pigment
{
   image_map
   {
     png "solarsys/sat_ring_color_bjoernjonsson.png"
   }
}

#declare Saturn_Rings_Transparency =
pigment
{
   image_map
   {
     png "solarsys/transparency_bjoernjonsson.png"
   }
}

#declare Saturn_Rings_UnlitSide =
pigment
{
   image_map
   {
     png "solarsys/unlitside_bjoernjonsson.png"
   }
}


currently not yet working with media! (but that would be another thread 
here!)

#declare Ring_Color_Map_1_to_255 =
     color_map
     {
       #declare a=0;
       #while (a<255)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }

#declare Ring_Color_Map_256_to_510 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=255;
       #while (a<510)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings }
}

#declare Ring_Color_Map_511_to_765 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=510;
       #while (a<765)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings }
}

#declare Ring_Color_Map_766_to_1020 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=765;
       #while (a<1020)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings }
}

#declare Ring_Color_Map_1021_to_1275 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=1020;
       #while (a<1275)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings }
}

#declare Ring_Color_Map_1276_to_1500 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=1275;
       #while (a<1500)
         #declare c=eval_pigment(Saturn_Rings_Colors, <2999/3000-a/1500, 
0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings }
}


#declare Ring_UnlitSide_Map_1_to_255 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=0;
       #while (a<255)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

#declare Ring_UnlitSide_Map_256_to_510 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=255;
       #while (a<510)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

#declare Ring_UnlitSide_Map_511_to_765 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=510;
       #while (a<765)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

#declare Ring_UnlitSide_Map_766_to_1020 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=765;
       #while (a<1020)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

#declare Ring_UnlitSide_Map_1021_to_1275 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=1020;
       #while (a<1275)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

#declare Ring_UnlitSide_Map_1276_to_1500 =
texture
{
   pigment
   {
     cylindrical
     color_map
     {
       #declare a=1275;
       #while (a<1500)
         #declare c=eval_pigment(Saturn_Rings_UnlitSide, 
<2999/3000-a/1500, 0.5, 0>);
         #declare f=eval_pigment(Saturn_Rings_Transparency, 
<2999/3000-a/1500, 0.5, 0>);
         [a*(((140390-74510)/140390)/1500) rgb c filter f.gray]
         #declare a=a+1;
       #end
     }
   }
   finish { F_Saturn_Rings_UnlitSide }
}

// the actual planet and rings objects

union
{
sphere // Saturn
{
   0, 1
   texture
   {
     pigment
     {
       image_map
       {
         jpeg "solarsys/saturn_bjoernjonsson.jpg" // also from 
http://www.mmedia.is/~bjj/data/saturn/index.html
         map_type 1
         interpolate 2
       }
     }
     finish { F_Standard_Planetary_Surface }
   }
   scale <bodies[72][1], bodies[72][2], bodies[72][3]>/sc
}


difference // rings
{
   cylinder
   {
     <0, -0.11, 0>/sc, <0, 0.1, 0>/sc, 140390/sc
   }
   cylinder
   {
     <0, -0.12, 0>/sc, <0, 0.11, 0>/sc, 74510/sc
   }
   // originally used with the no-media hi-res version of the rings - 
I'm currently not sure whether I will able to make use of it also with 
media!
   /* cylinder // unlit side!
   {
     <0, -0.15, 0>/sc, <0, -0.1, 0>/sc, 150000/sc
     texture
     {
       cylindrical
       texture_map
       {
         [0                                   Ring_UnlitSide_Map_1_to_255 ]
         [255*(((140390-74510)/140390)/1500)  Ring_UnlitSide_Map_256_to_510]
         [510*(((140390-74510)/140390)/1500) 
Ring_UnlitSide_Map_511_to_765]
         [765*(((140390-74510)/140390)/1500) 
Ring_UnlitSide_Map_766_to_1020]
         [1020*(((140390-74510)/140390)/1500) 
Ring_UnlitSide_Map_1021_to_1275]
         [1275*(((140390-74510)/140390)/1500) 
Ring_UnlitSide_Map_1276_to_1500]
       }
       scale 140390/sc
     }
   } */
   // ultra-cheap no media version of the rings
   #if (lores)
     texture // low resolution texture: 255 entries in ring color map
     {
       pigment
       {
         cylindrical
         color_map
         {
           #declare a=0;
           #while (a<255)
             #declare c=eval_pigment(Saturn_Rings_Colors, 
<509/510-a/255, 0.5, 0>);
             #declare f=eval_pigment(Saturn_Rings_Transparency, 
<509/510-a/255, 0.5, 0>);
             [a*(((140390-74510)/140390)/255) rgb c filter f.gray]
             #declare a=a+1;
           #end
         }
         scale 140390/sc
       }
       finish { F_Saturn_Rings }
     }
   #else // current media problem!
     hollow
     pigment { rgbt 1 }
     interior
     {
       media
       {
         scattering
         {
           1, 1
           // eccentricity -0.4
           extinction 0.1
         }
         // absorption 0.095
         density
         {
           cylindrical
           // hi-res version (1500 color and transparency levels), 
currently not usable with media (but please let's discuss this later on!)
           /* density_map
           {
             [0                                   Ring_Color_Map_1_to_255]
             [255*(((140390-74510)/140390)/1500)  Ring_Color_Map_256_to_510]
             [510*(((140390-74510)/140390)/1500) 
Ring_Color_Map_511_to_765]
             [765*(((140390-74510)/140390)/1500) 
Ring_Color_Map_766_to_1020]
             [1020*(((140390-74510)/140390)/1500) 
Ring_Color_Map_1021_to_1275]
             [1275*(((140390-74510)/140390)/1500) 
Ring_Color_Map_1276_to_1500]
           } */
           // current media version
           color_map // preliminary low-res version
           {
             #declare a=0;
             #while (a<255)
               #declare c=eval_pigment(Saturn_Rings_Colors, 
<509/510-a/255, 0.5, 0>);
               #declare f=eval_pigment(Saturn_Rings_Transparency, 
<509/510-a/255, 0.5, 0>);
               [a*(((140390-74510)/140390)/255) rgb c /* filter f.gray*/]
               #declare a=a+1;
              #end
            }
            scale 11
         }
       }
     }
   #end
   }
   SetAxis(bodies[72][10], bodies[72][11])
   translate Pos_Saturn/sc
}

camera
{
   [...]
   location camPos/sc
   look_at camLook/sc
   angle camAng
}

// end of code

Attached image shows current state!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'povsolar.png' (60 KB)

Preview of image 'povsolar.png'
povsolar.png


 

From: clipka
Subject: Re: Probably I'm just in fact too stupid...
Date: 9 Feb 2010 11:22:37
Message: <4b718bcd$1@news.povray.org>


>  >   Sorry, I did a poor reading, and for the images I assumed too 
> quickly your
>  > problem was just the ultra-bright media... trying with your code on 
> the last
>  > message, I see that using extinction 0 gives the effect you are 
> looking for.
> 
> Yes, that's quite logical... I tried it, and it at least yielded roughly 
> the result I want to achieve in the long run! Thank you for the tip... 
> perhaps I'll up the extinction value to, let's say, 0.1 or 0.15, as the 
> unlit side is of course somewhat darker than the lit side, irrespective 
> of light filtering through...

Just for completeness' sake: From a theoretical point of view, the 
"extinction" parameter is no good for your application, as it only 
accounts for light that fails to be transmitted due to being scattered 
away. As a consequence, only the scattered colors are attenuated 
accordingly.

This is good for modelling media in which the scattering is primarily 
due to diffraction or other interference effects (i.e. very small 
particles, like molecules or very fine dust), but does not properly 
model media containing larger objects in which the scattering is 
primarily due to reflection, as in that case all wavelengths will be 
obstructed, whether they are reflected (and therefore scattered) or not.

I guess in the case of the Saturn rings, reflection will be the primary 
scattering effect, so it should be modeled using...

- an absorbing media to account for the shadowing effect
- a scattering media to account for the reflected light

The scattering media, in this case, should indeed have "extinction 0", 
as the extinction component is already accounted for by the absorbing media.


Christoph


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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