Keywords: Bump map vs isosurface.png Created with Persistence of Vision ray traced images bump maps can be used to model extensive peturbations to a surface by changing the way the surface appears to be illuminated The technique is however limited in that it does not actually modify the shape of the underlying object The sphere to the left has had a bump map applied to mimic a crumbling surface but neither the sphere's outline nor its shadow are affected The sphere to the right uses a similar bump map as an isosurface function to actually modify the size and shape of the underlying sphere Both the outline and the shadow are affected POV-Ray code <syntaxhighlight lang povray > version 3 6; global_settings assumed_gamma 1 0 ambient_light 0 radiosity pretrace_start 0 08 // start pretrace at this size pretrace_end 0 04 // end pretrace at this size count 35 // higher -> higher quality 1 1600 35 nearest_count 5 // higher -> higher quality 1 10 5 error_bound 1 8 // higher -> smoother less accurate 1 8 recursion_limit 3 // how much interreflections are calculated 1 5+ 3 low_error_factor 5 // reduce error_bound during last pretrace step gray_threshold 0 0 // increase for weakening colors 0 1 0 minimum_reuse 0 015 // reuse of old radiosity samples 0 015 brightness 1 // brightness of radiosity effects 0 1 1 adc_bailout 0 01/2 normal on // take surface normals into account off media off // take media into account off always_sample on // turn sampling in final trace off on max_sample 1 0 // maximum brightness of samples fog fog_type 1 distance 10 rgb 0 turbulence 5 // ---------------------------------------- camera location <0 0 1 5 -4> direction z right x image_width/image_height look_at <0 0 0 -1 4> light_source <0 6 -4> color rgb <1 1 1> 25 area_light <3 0 0> <0 0 3> 10 10 orient circular light_source <0 100 80> color rgb <1 1 1> // ---------------------------------------- plane y -1 pigment color rgb 1 finish ambient 0 declare mytex texture pigment colour rgb <1 0 0> finish specular 0 1 roughness 01 diffuse 9 ambient 0 reflection 0 include functions inc declare bump_func function f_agate x/ 5 y/ 5 z/ 5 1 //the internal agate pattern scaled to give the desired effect declare sphere_func function x y z Radius pow x 2 +pow y 2 +pow z 2 -pow Radius 2 //a function to create a sphere isosurface function sphere_func x y z 1 -bump_func x y z max_gradient 8 contained_by box -2 2 texture mytex translate x 1 5 sphere 0 1 texture mytex normal agate scale 5 bump_size 1 1 translate -x 1 5 </syntaxhighlight > own GDallimore 2010-10-10 thumb left Updated version with improved quality bump map and increased similarity between the surface textures of the two spheres for easier comparison Spheres Demo effects Bump mapping Ray tracing Widescreen desktop backgrounds Isosurfaces 3D test models Images with Povray source code </syntaxhighlight> |