|
![](/i/fill.gif) |
To model a foam plastic object (like
http://de.wikipedia.org/wiki/Datei:Haushaltsschwaemme.jpg ) I tried a
appropriate surface texture combined with a dense scattered media.
The results are good, except when some feature is placed in the foam object.
Such a feature should only be visible on a very short distance below the
surface, but it's visible throughout the whole object. I've tracked down this
issue to the scattering media.
In the following sample scene the blue cylinder should disappear quickly, but
it's visible through the whole media filled box. If the box is divided into
parts (just set fogDivisions > 1), the visibility issue get's better. With
subdivisions one get's band artifacts, however, and for more complex objects
this wouldn't be of much help anyhow. I'm using povray Unix 3.6.1.
Are there better alternatives to model this case?
#include "colors.inc"
#declare aR = 0.15;
#declare fogDepth = 10;
#declare fogDivisions = 1; // 1, 2, 4, 8
camera {
location <15, 15, -25>
look_at <0, 5, 0>
angle 45
}
light_source {
<60, 50, -40>, color White
parallel
point_at <0, 5, 0>
}
plane {
y, 0
texture {
pigment {
color White
}
finish {
ambient aR
diffuse 0.6
}
}
}
#declare M_fog =
material {
texture { pigment { color rgbf <1,1,1,1> } }
interior {
media {
scattering { 1,
White*0.8
}
}
}
}
#declare i = 0;
#declare fogStep = fogDepth/fogDivisions;
#while(i < fogDivisions)
box {
<-5, 0.01, -5 + i*fogStep>, <10, 13, -5 + (i+1)*fogStep - 0.01>
hollow
material { M_fog }
}
#declare i = i + 1;
#end
cylinder {
<-4, 5,-8>, <-4, 5, 50>, 1
texture {
pigment { color <0.5, 0.5, 1> }
finish { diffuse 0.6 ambient aR }
}
}
Post a reply to this message
|
![](/i/fill.gif) |