|
![](/i/fill.gif) |
This short bit of code shows how to use a
planetary image as a displacement map on a sphere.
I had set it up as a macro to work with different
planet displacement maps, planet pigment maps, planet sizes,
and percentage displacements.
I know that this is displacement mapping only on a
sphere, but the same concept should work on other shapes.
I hope that this helps.
#macro PlanetMac(Pic1,Pic2,Rad,Prec)
#local Pic= function{pigment {image_map {png Pic1 interpolate 2
map_type 1}}}
#local R0=Rad;
#local FUNC1=function {"sphere",<R0>}
isosurface
{
function{FUNC1(x,y,z)-(Pic(x,y,z)*R0*Prec)}
contained_by {sphere {0,R0*(1+Prec)}}
method 2 max_gradient 10
pigment {image_map{png Pic2 interpolate 2 map_type 1}}
finish { blinn 1 facets .2 reflection 1 reflect_metallic
conserve_energy}
interior{ior 20}
}
#end
Pabs wrote:
>
> "Mr. Art" wrote:
>
> > Yes.
>
> How Mr Art.
>
> Pabs
Post a reply to this message
|
![](/i/fill.gif) |