POV-Ray : Newsgroups : povray.newusers : halo to media : Re: halo to media Server Time
5 Oct 2024 15:37:01 EDT (-0400)
  Re: halo to media  
From: Reactor
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

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