POV-Ray : Newsgroups : povray.text.tutorials : Interior Fog? : Re: Interior Fog? Server Time
2 May 2024 14:46:03 EDT (-0400)
  Re: Interior Fog?  
From: Jerry Stratton
Date: 2 May 1999 17:29:31
Message: <newsw-0205991329300001@cx38767-a.dt1.sdca.home.com>
In article <372BFF14.9874C00E@tiac.net>, Phil Clute <pcl### [at] tiacnet> wrote:

>If someone knows how to contain fog inside say
>a sphere(or any object for that matter), I would
>love it if they would show me an example. I've tried
>to do it a few times and I can't figure out what I'm
>doing wrong...
>
>It don't werk fer me.

What do you mean by that? You mean you see nothing, or you see fog but the
wrong kind?

The following should render fog inside of a sphere:

If you want turbulence, uncomment the turbulence statement; if you want
multiple clumps of fog inside your sphere, combine it with, for example, a
bozo pattern (in this example, uncomment the bozo density).


#include "colors.inc"
#declare render_quality = 0; //0 to 1

//the fog
#declare minsamples = 1;
#declare maxsamples = int(4+render_quality*5);
#declare fogvariance = (100-render_quality*50)/1000;
#declare fogconfidence = .7+render_quality*.27;
#declare fogintervals=int(4+render_quality*20);
#declare sphere_size = 8;

sphere {
   <0,0, 0>,2
   pigment {
      color rgbf <1,1,1,1>
   }
   interior {
      media {
         scattering {  1, .5/sphere_size}
         intervals fogintervals
         samples minsamples, maxsamples
         confidence fogconfidence
         variance fogvariance
         density {  
            spherical
            //turbulence .5
            color_map {
               [0 color rgb <0,0,0>]
               [0.15 color rgb <.3,.3,.3>]
               [0.4 color rgb <1,1,1>]
               [1 color rgb <1,1,1>] 
            }
         }

/*       density {
            bozo
            //turbulence .3
            color_map {
               [0.0  color rgb <1,1,1>]
               [0.3  color rgb <1,1,1>]
               [0.6  color rgb <0,0,0>]
               [1.0  color rgb <0,0,0>]
            }
            scale .3
         }
*/
      }
   }
   scale 2*sphere_size
   hollow
}


background {
   color Blue
}

light_source {
   <250,250,35>
   color White
}

camera {
   location <0,0,-5*sphere_size>
   look_at <0,0,0>
}

Jerry
http://www.hoboes.com/jerry/


Post a reply to this message

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