// PoVRay 3.5 Scene File "waves_abstract1.pov"
// created by:   Ian Gilmour (ian@igilmour.freeserve.co.uk)  
// Date:   29-July-04
//--------------------------------------------------------------------------
#declare SHOW_RADIOSITY = on;

#version 3.5;
global_settings {
  max_trace_level 20
  #if (SHOW_RADIOSITY)
    radiosity {
      pretrace_start 0.08           // start pretrace at this size
      pretrace_end   0.005          // end pretrace at this size
      count 100                     // 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 1             // 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 on                    // take media into account [off]
    }
  #end
}
//--------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
//#include "glass.inc"         //
#include "metals.inc"
#include "golds.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "transforms.inc"
//--------------------------------------------------------------------------
// camera ------------------------------------------------------------------
#declare Camera_0 = camera {ultra_wide_angle angle 35          // front view
  location  <0.0 , .5 ,-3>
  right     x*image_width/image_height
  look_at   <0.0 , .5 , 0.0>
  aperture 0.2
  focal_point <0.0 , .5 , 20.0>
  blur_samples 250
  confidence 0.999999999
  variance 0}
camera{Camera_0}


// sun ---------------------------------------------------------------------
light_source{< 1500,2500,-2500> color White}

// sky ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
  color_map { [0.00 rgb <1.0,1.0,1.0>]
    [0.30 rgb <0.0,0.1,1.0>]
    [0.70 rgb <0.0,0.1,1.0>]
    [1.00 rgb <1.0,1.0,1.0>] 
  } 
  scale 2         
} // end of pigment
} //end of skysphere
// fog ---------------------------------------------------------------------
fog{fog_type   2
  distance   50
  color      White
  fog_offset 0.1
  fog_alt    2.0
  turbulence 0.8}


//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------

// water
#if (1)
  #declare Scale_Z = 0.02;

  #declare M_Watx =
  material {
      texture{ Polished_Chrome
	normal {crackle 0.15 scale <0.35,0.25,0.25> turbulence 0.5 } 
	finish {ambient 0.1 diffuse 0.7 reflection 0.60}
      }
  }

  #include "waves.inc" // from Christoph Hormann's http://www-public.tu-bs.de:8080/~y0013390/pov/water/water_inc.html

  #declare MAX_WAVES = 40;


  #declare fn_Water=
  function {
    Waves(pi/2, 5.2, clock*7, 700) * 0.024 + 0.5
  }


  #declare Siz=100;
  #declare Height=-1;

  height_field {

    function 300, 300 { fn_Water(x, y, 0) }

    smooth

    rotate <-90,0,0>
    translate <-0.5,-0.5,0.5>
    scale <Siz,Siz,Height>
    rotate <-90,90,0>
    translate <0,0,0>

    material {
      M_Watx
    }

    hollow on
  }
#end