POV-Ray : Newsgroups : povray.general : still trying for good fire Server Time
31 Oct 2024 23:28:11 EDT (-0400)
  still trying for good fire (Message 1 to 6 of 6)  
From: Anthony D  Baye
Subject: still trying for good fire
Date: 25 Nov 2015 03:10:02
Message: <web.56556c097163252f2aaea5cb0@news.povray.org>
going through old posts, I found this

http://news.povray.org/web.4511717a18647bd97758051a0%40news.povray.org

does anybody know how this was done?  It's fantastic.

Regards,
A.D.B.


Post a reply to this message

From: Thomas de Groot
Subject: Re: still trying for good fire
Date: 25 Nov 2015 07:18:36
Message: <5655a71c$1@news.povray.org>
On 25-11-2015 9:06, Anthony D. Baye wrote:
> going through old posts, I found this
>
> http://news.povray.org/web.4511717a18647bd97758051a0%40news.povray.org
>
> does anybody know how this was done?  It's fantastic.
>
> Regards,
> A.D.B.
>
>

As a matter of fact, I do.

Would Florian mind if I posted the code?

-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: still trying for good fire
Date: 25 Nov 2015 07:38:35
Message: <5655abcb$1@news.povray.org>
In fact, it is here:

http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.450d2b797d75fe157758051a0%40news.povray.org%3E/?ttop=401033&toff=300

-- 
Thomas


Post a reply to this message

From: Anthony D  Baye
Subject: Re: still trying for good fire
Date: 25 Nov 2015 13:40:01
Message: <web.5655fffec59206922aaea5cb0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> In fact, it is here:
>
>
http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.450d2b797d75fe157758051a0%40news.povray.org%3E/?ttop
=401033&toff=300
>
> --
> Thomas

Fantastic.  Thanks.

Regards,
A.D.B


Post a reply to this message

From: Anthony D  Baye
Subject: Re: still trying for good fire
Date: 26 Nov 2015 03:40:01
Message: <web.5656c4fac59206922aaea5cb0@news.povray.org>
refactored the actual flame code into a macro (with halo commented out because
it only really makes sense if you use the fog code as well)

/*
sky_sphere {
    pigment {
        granite
        scale 0.0205
        color_map {
            [0    color rgb 0]
            [0.9  color rgb 0]
            [0.9  color rgb stars_brightness]
            [1    color rgb stars_brightness]
        }
    }
}

fog {
    fog_type 2
    distance 100
    fog_alt 0.75
    fog_offset 0.35
    up <0, 1, 0.365>
    color rgb air_color*0.23
}
*/

Most of the functions go right over my head though.
Still testing.

Regards,
A.D.B.

//flame interior macro
// interior { Flame_Int(...) }
#macro Flame_Int(
                FLAME_OBJ_RAD,
                FLAME_RAD,
                FLAME_DIAM,
                FLAME_PWR,
                FLAME_CURL_SIZE,
                FLAME_CURL_STRENGTH,
                FLAME_CURL_RATIO,
                FLAME_CURL_START,
                HALO_RAD,
                HALO_DIAM,
                HALO_BRIGHTNESS
                )
/* #local flame_rad = 1;
#local flame_diam = 0.2;
#local flame_power = 1.07;
#local flame_curl_size = 2.75;
#local flame_curl_strength = 0.15;
#local flame_curl_ratio = 1.85;
#local flame_curl_start = -6.5*flame_diam;
#local halo_rad = 1;
#local halo_diam = 0.15;
#local halo_brightness = 0.475;
#local stars_brightness = 0.375;  // <<-- Not used
 */
#local S1 = seed (66);
#local air_color = color rgb <0.92, 0.96, 1>;

#local flame_func_0 =
    function {
        select (
            sqrt (x*x+y*y+z*z)-FLAME_RAD,
            -exp (1/(sqrt (x*x+y*y+z*z)-FLAME_RAD-0.02)*FLAME_DIAM),
            -exp (-1/(sqrt (x*x+y*y+z*z)-FLAME_RAD+0.02)*FLAME_DIAM)
        )
    }

#local flame_func_1 =
    function {flame_func_0 (x, select (y, y, atan (y*FLAME_PWR)/FLAME_PWR), z)}

#local flame_curl_func = array [3]

#local I = 3;
#while (I > 0)
    #local flame_curl_func [I-1] =
        function {
            pigment {
                agate
                translate <rand (S1), rand (S1), rand (S1)>*216.2
                scale FLAME_CURL_SIZE*<1/FLAME_CURL_RATIO, 1,
1/FLAME_CURL_RATIO>
                color_map {
                    [0  color rgb -FLAME_CURL_STRENGTH]
                    [1  color rgb FLAME_CURL_STRENGTH]
                }
            }
        }
    #local I = I-1;
#end

#local flame_func =
    function {
        flame_func_1 (
            x+flame_curl_func [0] (x, y, z).gray*(y+FLAME_RAD-FLAME_CURL_START),
            y+flame_curl_func [1] (x, y,
z).gray*(y+FLAME_RAD-FLAME_CURL_START*0.25),
            z+flame_curl_func [2] (x, y, z).gray*(y+FLAME_RAD-FLAME_CURL_START)
        )
    }

    media {
        method 2
        samples 120, 120
        intervals 10
        emission 0.1
        density {
            function {flame_func (x, y, z)}
            color_map {
                [0     color rgb 0]
                [0.1   color rgb 0]
                [0.75  color rgb <1, 0.5, 0>*1.35*1.5]
                [1     color rgb <1, 1, 0.2>*11*1.5]
            }
        }
        density {
            function {sqrt (x*x+y*y+z*z)/FLAME_OBJ_RAD}
            color_map {
                [0  color rgb 1]
                [1  color rgb 0]
            }
        }
    }
    media {
        method 2
        samples 80, 80
        intervals 10
        emission 0.1
        density {
            function {flame_func (x, y, z)}
            color_map {
                [0      color rgb 0]
                [0.625  color rgb 0]
                [0.7    color rgb <0, 0.1, 1>*1.53*1.5]
                [0.775  color rgb 0]
                [1      color rgb 0]
            }
        }
        density {
            function {sqrt (x*x+y*y+z*z)/FLAME_OBJ_RAD}
            color_map {
                [0  color rgb 1]
                [1  color rgb 0]
            }
        }
    }/*
    media {
        method 3
        samples 50, 50
//        intervals 3
        emission 0.2
        density {
            function {
                select (
                    z,
                    select (
                        sqrt (x*x+y*y+z*z)-HALO_RAD,
                        -exp (1/(sqrt (x*x+y*y+z*z)-HALO_RAD-0.02)*FLAME_DIAM),
                        -exp (-1/(sqrt (x*x+y*y+z*z)-HALO_RAD+0.02)*FLAME_DIAM)
                    ),
                    0
                )
            }
            color_map {
                [0  color rgb 0]
                [1  color rgb HALO_BRIGHTNESS*air_color]
            }
        }
    }*/

#end


Post a reply to this message

From: Thomas de Groot
Subject: Re: still trying for good fire
Date: 26 Nov 2015 07:13:13
Message: <5656f759$1@news.povray.org>
On 26-11-2015 9:38, Anthony D. Baye wrote:

> Most of the functions go right over my head though.
> Still testing.
>

I remember having tested out the scene, without trying to understand it. 
I left that for another day when I needed a flame :-)


-- 
Thomas


Post a reply to this message

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