File:Bump map vs isosurface.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

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

The bumpy surface of the sphere to the left is faked by using POV-Ray's internal "agate" pattern as a bump map. This changes the way light reflects from the surface of the sphere without actually changing the size or shape of the sphere. The outline of the sphere and the shadow on the ground therefore remain perfectly circular due to the limitations of the bump mapping technique.

The bumpy surface of the sphere to the right is modelled by using POV-Ray's internal "agate" pattern as an w:isosurface to actually modify the size and shape of the sphere. The outline of the sphere and the shadow on the ground are therefore also changed.

Possible wikipedia image text:

In 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:

#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
  }
Date
Source Own work
Author GDallimore
Other versions
Updated version with improved quality bump map and increased similarity between the surface textures of the two spheres for easier comparison

Licensing[edit]

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.

</syntaxhighlight>

File history

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

Date/TimeThumbnailDimensionsUserComment
current20:47, 10 October 2010Thumbnail for version as of 20:47, 10 October 20101,680 × 1,050 (1.22 MB)GDallimore (talk | contribs)Change aspect ratio, improve lighting (more on front), bring spheres closer together
14:05, 10 October 2010Thumbnail for version as of 14:05, 10 October 20101,680 × 945 (826 KB)GDallimore (talk | contribs)Brightened
13:36, 10 October 2010Thumbnail for version as of 13:36, 10 October 20101,680 × 945 (762 KB)GDallimore (talk | contribs){{Information |Description={{en|1=Raytraced image illustrating the limitations of w:bump mapping}} |Source={{own}} |Author=GDallimore |Date=2010-10-10 |Permission= |other_versions= }} Category:Spheres [[Category:Created with P

File usage on other wikis