Jump to content

File:Bump map vs isosurface3.png

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (1,680 × 1,050 pixels, file size: 1.14 MB, MIME type: image/png)

Summary

 
This image was created with POV-Ray.
Description
English: Raytraced image illustrating the limitations of w:bump mapping created with w:POV-Ray.

On the left, a sphere is given an apparently bumpy surface by using POV-Ray's internal "agate" function to create a bump map (the agate function defines a value for each point in 3D space). This changes the way light is calculated to reflect from the surface of the sphere without actually changing the sphere's size or shape. The outline of the sphere and the shadow on the ground are therefore those of a perfect, non-bumpy sphere. An unrealistic hard shadow is also visible on the surface of the sphere, about a third of the way from the top.

On the right, a sphere with a bumpy surface is actually modelled by calculating an w:isosurface for a sphere function modified by the agate function (the agate function is subtracted from a function defining a sphere, x2+y2+z2-Radius2, and all points in space where this sum is zero form the surface of the resulting object). This results in an actual modification in the size and shape of the sphere. The outline of the sphere and the shadow on the ground are therefore also changed. The shadowing on the surface of the sphere is also more realistic.

Other raytracing techiniques used in an attempt to increase realism include w:Radiosity (3D computer graphics) and a simulated finite w:Depth of field.

Possible wikipedia image text:

In 3D computer graphics, bumps, wrinkles and dents on the surface of an object can be simulated by using bump mapping. A bump map changes the way the surface appears to reflect or refract light and can increase the realism of computer-generated images without significantly increasing render times. The technique is limited in that it does not actually modify the shape of the underlying object. On the left, a mathematical function defining a bump map simulates a crumbling surface on a sphere, but the object's outline and shadow remain those of a perfect sphere. On the right, the same function is used to modify the surface of a sphere by generating an isosurface. This actually models a sphere with a bumpy surface with the result that both its outline and its shadow are rendered realistically.

POV-Ray code:

#version 3.6;

#declare rad=1;

global_settings {
  assumed_gamma 1.0
  ambient_light 0   
  #if (rad)
  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 .4                  // 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
  }
   #end 
}

 #if (rad) 
  fog{
  fog_type 1 
  distance 9 
  rgb 0 
  turbulence 5}
 #end
// ----------------------------------------

camera {
  location  <0.0, 1.5, -4>
  direction z
  right     x*image_width/image_height
  look_at   <0.0, 0,  -1.4>
   // focal blur camera
#if(rad)
  aperture .2     
  blur_samples 125  
  focal_point <0,0,-.9>  
  confidence 0.99  
  variance 1/20000  
  #end
}

light_source { <6, 2.5, -6>  color rgb <1, 1, 1>*.3 
  area_light  <1,0,0>,<0,0,1>  #if(rad)2,2 #else 2,2 #end  orient  circular 
  }

light_source { <-9, 7.5, -6>  color rgb <1, 1, 1>*.5 
  area_light  <3,0,0>,<0,0,3>  #if(rad)5,5 #else 2,2 #end  orient  circular 
  }

light_source { <0, 100, 80>  color rgb <1, 1, 1> area_light  <1,0,0>,<0,0,1>  #if(rad)2,2 #else 2,2 #end  orient  circular}
       
// ----------------------------------------

box{<-35,-2,-3>,<35,-1,38>
  pigment { color rgb 1 }
  finish {ambient 0}
}

#declare mytex=texture{pigment { bozo 
                          colour_map{
                            [0 colour rgb <.3,.1,.05> ]
                            [0.25 colour rgb <.32,.08,.06> ]
                            [0.5 colour rgb <.3,.1,.05> ]
                            [.75 colour rgb <.28,.12,.04> ]
                            [1 colour rgb <.3,.1,.05> ]
                                    }
                                    scale .15 
                                    turbulence 2.75
                             }
    finish{ specular 0.1 roughness .0075 diffuse .70 ambient 0 reflection 0.0}}

#include "functions.inc"  

#declare function2=function{f_agate(x/.5,y/.5,z/.5)*.1}
#declare function3=function(x,y,z,Radius,xoff,yoff,zoff){pow(x-xoff,2)+pow(y-yoff,2)+pow(z-zoff,2)-pow(Radius,2)} 

#declare ball=  
isosurface {
    function {function3(x,y,z,1,0,0,0)-function2(x,y,z)*1}  //.71
    max_gradient 8 
    contained_by { sphere { 0, 1.5 } }
    texture {mytex}
    translate x*1.5
    }    
    
object{ball translate <0,0,0> }  

sphere {  0, 1
  texture {
    mytex
    //normal{bozo scale .5}
    normal {function {function2(x,y,z)*10*.25} accuracy .0002 bump_size 1.5}
    }
    rotate -y*32 
    translate -x*1.5
  }
Date
Source Own work
Author GDallimore
Other versions

Licensing

Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

4 January 2011

image/png

b36a6727404645294722d7db0a4c319cc5b3f238

1,192,181 byte

1,050 pixel

1,680 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current20:04, 4 January 2011Thumbnail for version as of 20:04, 4 January 20111,680 × 1,050 (1.14 MB)GDallimore{{Information |Description={{en|1={{Created with Persistence of Vision}} Raytraced image illustrating the limitations of w:bump mapping created with w:POV-Ray. On the left, a sphere is given an apparently bumpy surface by using POV-Ray's interna