POV-Ray : Newsgroups : povray.newusers : halo to media Server Time
7 Jul 2024 07:49:54 EDT (-0400)
  halo to media (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: tiocfaidh
Subject: halo to media
Date: 26 Aug 2009 14:30:00
Message: <web.4a957e9aeee64636c3fc43200@news.povray.org>
Can someone help me convert the following:

#declare Smoke =
sphere { 0, 1
    hollow
    no_shadow
    pigment { colour Clear }
    halo {
        linear
        max_value 0.15
        cylindrical_mapping
        attenuating
        turbulence 0.75
        octaves 6
        omega (1/1.618)
        lambda 1.618
        colour_map {
             [0.0 color rgbt <1, 1, 1, 1>]
             [0.5 color rgbt <1, 1, 1, 0.65>]
             [1.0 color rgbt <0, 0, 0, 0>]
        }
        scale <0.4, 0.65, 0.4>
        samples 10
        aa_level 0
        aa_threshold 0.3
    }
    scale <10, 30, 10>
    translate <-5, 40, 0>
}

I read halo is replaced by media/interior but I tried that and nothing worked,
just gave an error on linear.


Post a reply to this message

From: Reactor
Subject: Re: halo to media
Date: 26 Aug 2009 16:35:00
Message: <web.4a959b54938269c92a92c2b90@news.povray.org>
"tiocfaidh" <nomail@nomail> wrote:
> Can someone help me convert the following:
>
> #declare Smoke =
> sphere { 0, 1
>     hollow
>     no_shadow
>     pigment { colour Clear }
>     halo {
>         linear
>         max_value 0.15
>         cylindrical_mapping
>         attenuating
>         turbulence 0.75
>         octaves 6
>         omega (1/1.618)
>         lambda 1.618
>         colour_map {
>              [0.0 color rgbt <1, 1, 1, 1>]
>              [0.5 color rgbt <1, 1, 1, 0.65>]
>              [1.0 color rgbt <0, 0, 0, 0>]
>         }
>         scale <0.4, 0.65, 0.4>
>         samples 10
>         aa_level 0
>         aa_threshold 0.3
>     }
>     scale <10, 30, 10>
>     translate <-5, 40, 0>
> }
>
> I read halo is replaced by media/interior but I tried that and nothing worked,
> just gave an error on linear.



Wowsers, totally old code!  I'm having flashbacks to high school!  I'm going to
give it a shot, but I hope you have the image that you'd expect this to
produce.  Here is what I think the code should be, but look below that for why.

interior{
    media{
        absorption color rgb 0.15

        density
        {
            cylindrical
            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.4, 0.65, 0.4>
        }
        samples 10
        method 3
        aa_level 4
        aa_threshold 0.1
     }
}


A LOT of the keywords in the code you supplied have been changed or replaced,
but the functionality in current versions is equal to or greater than the older
ones.

halo { has been replaced with  interior{ media{

>         linear
>         max_value 0.15
>         cylindrical_mapping
>         attenuating
The mapping type and modifier linear belongs in the density statement.  Instead
of cylindrical_mapping, the new pattern is called cylindrical and can be used
anywhere any other pattern can.  Linear is on by default, and the other ones
(cubic, poly, etc) can be accessed by specifying poly_wave and a floating point
exponent (like poly_wave 3 for cubic).  If you want constant media, you can
either not specify a pattern type in the density and let the media fill the
container, or you can make the color_map have a single value.

The media type attenuating is called absorption now.  The max_value is supplied
as a color vector directly after the media type.


>         turbulence 0.75
>         octaves 6
>         omega (1/1.618)
>         lambda 1.618
>         colour_map {
>              [0.0 color rgbt <1, 1, 1, 1>]
>              [0.5 color rgbt <1, 1, 1, 0.65>]
>              [1.0 color rgbt <0, 0, 0, 0>]
>         }
>         scale <0.4, 0.65, 0.4>


All of this now belongs in the density{} block, and is pretty much the same.  I
took out the transmit value from your color vectors as I am pretty sure they
are ignored. Since the amount absorbed by the media is controlled in part by
the size of the color vector, I multiplied the rgb vector by the transmit
value, which should give you the same thing.  For future reference, consider
placing the turbulence and turbulence modifiers in a warp{} statement, since it
gives you more control over the way the turbulence is applied (specifically, it
applies turbulence or a transformation in the order they are specified, as
opposed to the old, order-independant way).

>         samples 10
>         aa_level 0
>         aa_threshold 0.3

This is practically the same, except I boosted the aa_level and aa_threshold to
their defaults.  Sampling method 3 is used by default, but I tend to place it
there anyway when using older versions of povray (or running old scenes).


Anyway, that oughta work or at least be fairly close.  Better smoke would
probably have a scattering media component (which replaced the older dust
halo), but would also see an increase in rendering times.


-Reactor


Post a reply to this message

From: Reactor
Subject: Re: halo to media
Date: 26 Aug 2009 17:45:00
Message: <web.4a95acbd938269c9d60db48b0@news.povray.org>
"Reactor" <rea### [at] hotmailcom> wrote:

....

> Better smoke would probably have a scattering media component
> (which replaced the older dust halo), but would also see an
> increase in rendering times.
>
>
> -Reactor

I forgot to add that if you use scattering, remove the no_shadow keyword from
the sphere, otherwise the scattering media will not shade correctly.  With the
current code that uses no_shadow, the smoke will not cast a shadow (which may
not be a problem, depending on how it is used).  Absorption and scattering
medias are capable of casting shadows, but there is a speed penalty when you
allow them to do so.


-Reactor


Post a reply to this message

From: tiocfaidh
Subject: Re: halo to media
Date: 27 Aug 2009 00:30:00
Message: <web.4a960b53938269c9c3fc43200@news.povray.org>
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/grap
hics/povray31/smoke.html

Trying to create smoke just like that. How would i make it more like that?


Post a reply to this message

From: tiocfaidh
Subject: Re: halo to media
Date: 27 Aug 2009 13:00:00
Message: <web.4a96babb938269c9ff4a12e20@news.povray.org>
How can I create very simple smoke coming out of a chimney?


Post a reply to this message

From: Reactor
Subject: Re: halo to media
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

From: tiocfaidh
Subject: Re: halo to media
Date: 28 Aug 2009 01:00:05
Message: <web.4a976359938269c9ff4a12e20@news.povray.org>
is there any include files for container shape

I get an error when i try run the code about }


Post a reply to this message

From: Reactor
Subject: Re: halo to media
Date: 28 Aug 2009 01:45:02
Message: <web.4a976e2f938269c9a4c94d980@news.povray.org>
"tiocfaidh" <nomail@nomail> wrote:
> is there any include files for container shape
>
> I get an error when i try run the code about }

Sorry about that, the problem eems to be caused by line-wrapping in the news
reader.  Around these lines:
pigment { colour rgb <1,00,0> transmit 1 }  // change to 0.95 to see
container shape

The words container shape should have been part of the comment on the preceding
line.  Delete them or comment them out, and it should work.


-Reactor


Post a reply to this message

From: tiocfaidh
Subject: Re: halo to media
Date: 28 Aug 2009 05:00:00
Message: <web.4a979c65938269c9ff4a12e20@news.povray.org>
is there any way to make it sort of fade out a bit more towards the top pf the
cylinder?


Post a reply to this message

From: clipka
Subject: Re: halo to media
Date: 28 Aug 2009 05:12:38
Message: <4a979f86$1@news.povray.org>
tiocfaidh schrieb:
> is there any way to make it sort of fade out a bit more towards the top pf the
> cylinder?

You can combine multiple "density {...}" statements in a single "media" 
statement, in which case the densities will be multiplied.

Thus, adding a density statement with a "gradient" or "planar" pattern 
scaled accordingly, and possibly with a color_map, should to the job I'd 
guess.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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