POV-Ray : Newsgroups : povray.newusers : halo to media : Re: halo to media Server Time
5 Oct 2024 15:23:49 EDT (-0400)
  Re: halo to media  
From: Reactor
Date: 27 Aug 2009 15:50:00
Message: <web.4a96e2eb938269c99bda1ef30@news.povray.org>
"tiocfaidh" <nomail@nomail> wrote:
> Cheers for that, it got it working, except now it doesnt really look like smoke
> coming from a small fire, kind of like fog.
>
> This is where I got that code:
>
http://csi.chemie.tu-darmstadt.de/ak/immel/script/redirect.cgi?filename=http://csi.chemie.tu-darmstadt.de/ak/immel/gr
ap
> hics/povray31/smoke.html
>
> Trying to create smoke just like that. How would i make it more like that?

That image is pretty small, but assuming it is simple cigarette smoke, I'd
change
absorption color rgb 0.15
to
emission color rgb 0.05 or 0.10 or so.

Absorption media will appear dark because, as the name implies, it absorbs
light.  Emission media is bright because it appears as though it were emitting
light (this effect is constrained to the media and does not affect surrounding
objects).  Those two forms can be used alone or together for fast rendering,
simple smoke, but neither is particularly realistic.

Realistic smoke requires scattering media, which has an appearance dependent on
light sources.  Scattering media is bright where light shines on it, but is
dark in the shadows.  It also absorbs light, shadowing itself or other objects,
but renders much more slowly.  To use scattering media, make sure the shape
modifier no_shadow is removed, and replace
absorption color rgb 0.15
with
scattering{
  1, color rgb 0.375 // thicker than before, probably between 0.25 - 0.50
  extinction 1.0 // default, but may need adjustment
}


I think you'll immediately notice how much more slowly scattering media renders.
 The code you provided can be improved by making the container shape more
closely fit the media.  If you change the pigment statement from
pigment { colour Clear }
to
pigment{ color rgb <1,0,0> transmit 0.95 }

This will make the container shape a faint red, allowing you to see just how
little of the container shape is being used.  For vertically rising smoke, I
would probably use a cylinder instead of a sphere.

If I were to slightly modify the previous code, I'd make the container object
fit more closely.  Here is an example:

#version 3.6;


#declare Smoke =
cylinder { <0,0,0>, <0,6,0>, 1.0
    hollow
    pigment { colour rgb <1,00,0> transmit 1 } // change to 0.95 to see
container shape
interior{
    media{
        scattering
        {
         1, color rgb 2.00
         extinction 1.0
        }

        density
        {
            cylindrical
            warp{
             turbulence 0.75
             octaves 6
             omega (1/1.618)
             lambda 1.618
            }

            colour_map {
                 [0.0 color rgb <0.0, 0.0, 0.0> * 0.00 ]
                 [0.5 color rgb <1.0, 1.0, 1.0> * 0.65 ]
                 [1.0 color rgb <1.0, 1.0, 1.0> * 1.00 ]
            }
            scale 0.65
        }
        samples 10
        method 3
        aa_level 4
        aa_threshold 0.1
     } // media
} // interior
    scale 1.5
    translate <0, 0, 0>
}











plane // ground
{
    y, 0
    pigment{ color rgb 1 }
}


difference // simple chimney
{
 box
 {
  <-1.5,0,-1.5>, <1.5,2,1.5>
 }

 box
 {
  <-1.0,0,-1.0>, <1.0,2.1,1.0>
 }

    pigment{ color rgb <1,0,0> }
}





object{
    Smoke
    translate <0,1,0>
}



sky_sphere
{
    pigment
    {
    planar
    color_map{
    [0.00 color rgb < 50,100,200>/255 ]
    [1.00 color rgb <200,225,255>/255 ]
        }
    }
}



light_source
{
 <1000,1000,-100>
 color rgb 1
}


camera
{
    location <0, 4,-10>
    look_at  <0, 4, 0>

}


Note that the smoke is considerably thicker in this example -  when scaling
smoke objects, the thickness must be adjusted.

-Reactor


Post a reply to this message

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