POV-Ray : Newsgroups : povray.general : Freeware Displacement Mapping for Pov-Ray for Windows : Re: Freeware Displacement Mapping for Pov-Ray for Windows Server Time
31 Jul 2024 00:23:41 EDT (-0400)
  Re: Freeware Displacement Mapping for Pov-Ray for Windows  
From: Jim Charter
Date: 14 Feb 2008 20:59:52
Message: <47b4f218$1@news.povray.org>
FlaPovFan wrote:

> How is it possible to obtain a similar effect using isosurfaces?
> 
Here is a snippet of the code I used to get the engraved letters along 
with other textures all real displacement

It was necessary to superimpose two objects, one with noshadow to
get rid of some artifacting, one to create shadows in the scene.

I'll post example pictures on p.b.images

This code used the isocsg include files published by Christoff Hormann
This include files make it easy to reproduce POV objects and apply 
textures.

#declare Fn_Sor =
IC_Sor (Point_Array, IC_Open)

#declare Fn_Text =
function {
   pigment {
     image_map {
       jpeg "k13.cup.wk.jpg"
       interpolate 2
       map_type 2
       once
     }
   }
};
#declare Fn_Bump1 =
function {
   pigment {...

#declare cup_lathe_noshadow=
isosurface {
         function {
               Fn_Sor (x, y, z)
               - Fn_Bump1 (x, y, z).gray*.0025
               - Fn_Text (x, y, z).gray*.001
         }
         contained_by {
		box { <-.7,0,-.7>, <.7,P7.y,.7> }
	}
         threshold 0.0
         accuracy 0.001
         max_gradient 6.25
         no_shadow  //<- seems to prevent artifacting
         texture {
                 T_Brass_
         }
}

#declare cup_lathe_shadowdummy =
isosurface {
         function {
               Fn_Sor (x, y, z)
         }
         contained_by {
		box { <-.7,0,-.7>, <.7,1.1,.7> }
	}
         threshold 0.0
         accuracy 0.001
         max_gradient 6.25
         scale .998
         texture {
                 pigment { rgb .8 }
         }
}

#declare k13_cup_lathe_ =
union {
         object { cup_lathe_noshadow }
         object { cup_lathe_shadowdummy}
         translate <0,2.49,0>
};


Post a reply to this message

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