|
|
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
|
|