/* * topo-drylake.pov - Dry lake surface topography. * * Copyright (c) 07/2004 by Wolfgang Wieser. * * This file and parts of it may be used as long as credit is given where * it is due. * */ #include "functions.inc" global_settings { assumed_gamma 2.1 } light_source { <0,3,0>*10, rgb <2,2,2>/4 shadowless } // 4.5 light_source { <-1,0.6,-0.5>*10, rgb <2,2,2>/1.5 } // [-1..1] -> 0.007..0.993 #local fn_fermi_dirac = function(x) { 1.0/(exp(-5.0*x)+1) }; // [-1..0..1] -> 0.05..1.0..0.05 // p -> peak sharpness power (0.5..2 useful range) // 2 -> peak width 0.5 (approx) // 0.5 -> peak width 0.1 (approx) #local fn_peak = function(x,p) { 1.0-exp(-pow(abs(x),-p)/6) }; #local crack_thresh=0.011; // Be careful! // Large crackles. #declare fn_crack_large=function { pigment { //granite crackle turbulence 0.3 color_map { [ crack_thresh color rgb 0] [2 *crack_thresh color rgb 0.2] [3 *crack_thresh color rgb 0.8] [3.5*crack_thresh color rgb 0.93] [6.5*crack_thresh color rgb 0.98] [10*crack_thresh color rgb 0.98] [20*crack_thresh color rgb 0.95] [.5 color rgb 0.91] [.9 color rgb 0.95] } scale 4 } } // Small crackles: #declare fn_crack_small=function { pigment { //granite crackle turbulence 0.3 color_map { [ crack_thresh color rgb 0.4 -0.4] [2 *crack_thresh color rgb 0.6 -0.4] [3 *crack_thresh color rgb 0.8 -0.4] [3.5*crack_thresh color rgb 0.93 -0.4] [6.5*crack_thresh color rgb 1.2 -0.4] [7.0*crack_thresh color rgb 1.25 -0.4] [8.0*crack_thresh color rgb 1.24 -0.4] [10*crack_thresh color rgb 1.22 -0.4] [20*crack_thresh color rgb 1.15 -0.4] [48*crack_thresh color rgb 0.97 -0.4] [.9 color rgb 0.94 -0.4] } scale .4 } } // Fine structure: #declare fn_finestruct=function { pigment { //agate //granite spotted turbulence 0.9 color_map { [0 color rgb 0] [0.5 color rgb 0.7] [1 color rgb 1] } scale .05 } } #local iso_height=2.0; #declare iso_obj = isosurface { function { y - 0.3 + (f_noise3d(x/8,0,z/8)-0.5)/2 - fn_crack_large(x,0,z).grey - fn_crack_small(x,0,z).grey/10 //+ fn_finestruct(x,y/5,z).grey/30 // (fine structure, unused -> texture) //+ (f_noise3d(0,y*3,0)-0.5)*5 //- fn_peak(4*(y-0.55),4)*(f_noise3d(x/10,y*30,z/10)-0.5)*2 } max_gradient 10 accuracy 0.001 contained_by { box { <-20,0,-7.5>, <20,iso_height,40> } } //no_shadow } #if(0) // These are to check the iso bounding box height. The latter // cylinder has a stripe color with red and green of height 0.5 each. cylinder { 0*y, iso_height*y, 0.3 pigment { rgb x }} cylinder { 0*y, iso_height*y, 0.3 pigment { gradient y color_map { [0.5 rgb x] [0.5 rgb y] } } finish { ambient 1 } translate -5.5*z-3.8*x } #end // This is the isosurface object: union { object { iso_obj } //plane { y,0.001 } texture { // The soil color: // WARNING: PIGMENT SUCKS. (Especially when using AA.) //pigment { color rgb <0,1,0> } pigment { average pigment_map { [1 //granite spotted turbulence 0.9 color_map { [0 rgb <1,1,0>] [0.6 rgb <1,0.7,0.3>] [0.8 rgb <0.1,0.1,0.1>*-1] [1 rgb <0.1,0.1,0.1>*-1] //[1 rgb <1,0.7,0.3>] } scale .05 ] [1.3 granite color_map { [0 rgb <1,1,0>] [1 rgb <1,0.7,0.3>] } scale .8 ] [2 bozo color_map { [0 rgb <1,1,1>*1.3] [1 rgb <1,0.7,0>] } scale 2 ] } } } } // Grey ground plane. plane { y,0 pigment { rgb .9 } } camera { location <0,5,-10> up y look_at <0,0,0> }