|
|
/************************************************************
The following scene results in notable artifacts between
the transparent layers. Separating these butted boxes
by a small gap makes things worse. Overlapping the boxes
doesn't help.
In each case those interfaces viewed from the top are
visible.
I don't get it.... is this a bug?
Note: the details of the "media" are not important --
it is an attempt to approximate an exponential density
function with gradient y piecewise-linear segments.
**********************************************************/
#declare Camera_Location = <1.5, 0.7, -2>;
camera {
location Camera_Location
look_at <0, 0.5, 0>
}
light_source {
Camera_Location
color rgb 0.5
}
light_source {
<-100, 100, -100>
color rgb 0.5
}
merge {
#declare Ny = 8;
#declare Alpha = 0.5;
#declare Factor = 1;
#declare dY = 1 / Ny;
#declare Y = 0;
#while (Y < 1 + dY/2)
box {
<-0.5, 0, -0.5>,
<0.5, dY, 0.5>
hollow
pigment { rgbf 1 }
interior {
media {
absorption color rgb <1, 1, 0>
scattering { 3, color rgb <0, 0, 1> }
density {
gradient y
translate <0, Factor, 0> // d(y=0)=Factor, d/dy = -1
scale dY / ( Factor * (1 - Alpha) ) // d(y=0)=Factor,
// d(y=dY) = Factor - Factor (
1 - alpha ) = Factor * alpha
}
}
}
translate Y * y
}
#declare Y = Y + dY;
#declare Factor = Factor * Alpha;
#end
}
plane {
y,
0
pigment {
checker
color rgb <1, 1, 1>
color rgb <1, 0.9, 0.8>
}
}
sky_sphere {
pigment { color rgb 1 }
}
/***********************************************
http://www.flash.net/~djconnel/
*/
Post a reply to this message
|
|