POV-Ray : Newsgroups : povray.unofficial.patches : Displacement mapping using isosurfaces : Re: Displacement mapping using isosurfaces Server Time
2 Sep 2024 08:13:14 EDT (-0400)
  Re: Displacement mapping using isosurfaces  
From: Mr  Art
Date: 11 Apr 2000 10:43:05
Message: <38F32C09.218C8C76@gci.net>
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

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