POV-Ray : Newsgroups : povray.binaries.images : Probably I'm just in fact too stupid... : Re: Probably I'm just in fact too stupid... Server Time
31 Jul 2024 16:29:29 EDT (-0400)
  Re: Probably I'm just in fact too stupid...  
From: Reactor
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)

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