/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : Cedeaq_Semi-random landscape.pov Version : 3.71 Description : Cedeaq wrote: "Some times ago, I wrote an endless pseudo random landscape scroller. It is based on a heightfield with a "Dents"-pattern as a function to the heightfield. IMO a very easy way, to generate pseudo random landscapes." Date : 10 October 2010 (original scene code) Author : Cedeaq (2010) + Thomas de Groot (2018) E-mail : povray.general; in answer to Patrick Elliott's message: Need a way to make a semi random "landscape": http://news.povray.org/povray.general/thread/%3C4ca93948%40news.povray.org%3E/?ttop=371487&toff=200&mtop=351355 Copyright (C) 2010-2018. All rights reserved. Use and/or modification of this scene is free, except for commercial purposes. Commercial distribution is not allowed without written permission from the authors. **********************************************************************************/ // Render settings 3.7 (right-click on a line below): // +w1280 +h640 +a0.3 +am2 +bm2 +bs8 +wt6 //================================================================================= // VERSION, DEFAULTS, AND INCLUDES //================================================================================= // Choose your prefered version: //#version 3.71; #version unofficial patch 3.71; //UberPOV global_settings {assumed_gamma 1.0} #default {pigment {rgb <1,0,0>}} #default {finish {ambient 0}} #include "colors.inc" //#include "rand.inc" //#include "functions.inc" //#include "transforms.inc" //================================================================================= // LANDSCAPE SWITCHES //================================================================================= #local Relief = 0.12; //accentuates or flatten the relief #local Turb1 = <1.5, 0.3, 1.8>; #local Turb2 = <0.8, 0.5, 0.5>; #local Pscale = <0.3, 0.15, 0.2>; //scale of the pattern #local Lscale = <10, 6, 10>; //scale of the height_field #local SnowLine = 0.00; #local TopVeg = -0.02; //================================================================================= // Textures: #local RockTex = texture { pigment { cells turbulence <1, 1, 1> omega 1 lambda 6 color_map { [ 0.00+0.2 color srgb <0.68627, 0.52157, 0.32157>] [ 0.95-0.1 color srgb <0.21176, 0.23922, 0.26275>] [ 0.98-0.1 color srgb <0.81569, 0.69412, 0.45098>] } matrix < 5, 0, 0, -1, 1, 0, 0, 0, 1, 0, 0, 0 > warp {turbulence <0.8, 0.5, 0.8>} } normal { cells 1 turbulence <1, 1, 1> omega 1 lambda 6 matrix < 5, 0, 0, -1, 1, 0, 0, 0, 1, 0, 0, 0 > accuracy 0.01 warp {turbulence <0.8, 0.5, 0.8>} scale 0.001 } } #local SnowTex = texture { pigment { slope { <0, -0.1, 0>, 0.0, 0.5 altitude <0, 0.9, 0>, 0.0, 1.0 } pigment_map { [0.30+SnowLine srgbf <0.8, 0.8, 0.9, 1.0>] [0.31+SnowLine srgbf <0.8, 0.8, 0.9, 0.0>] } warp {turbulence <0.05, 0.10, 0.05>} } normal { granite 1.0 scale 0.0001 } finish { diffuse 0.7 specular 0.5 roughness 0.0001 } } #local VegPig = pigment { cells pigment_map { [0.4 srgbf <0.1, 0.3, 0.1, 0.0>] [0.4 srgbf <0.9, 0.7, 0.0, 0.0>] [0.6 srgbf <0.9, 0.7, 0.0, 0.0>] [0.6 srgbf <0.3, 0.5, 0.1, 0.0>] [0.9 srgbf <0.3, 0.5, 0.1, 0.0>] [0.9 srgbf <0.2, 0.3, 0.1, 0.0>] } warp {turbulence 0.3} scale 0.05 warp {turbulence 0.4} } #local VegTex = texture { pigment { slope { <0, -0.1, 0>, 0.0, 0.5 altitude <0, 0.9, 0>, 0.0, 1.0 } pigment_map { [0.18+TopVeg VegPig] [0.20+TopVeg srgbt <0.2, 0.5, 0.1, 1.0>] } warp {turbulence <0.05, 0.10, 0.05>} } normal { granite 1.0 scale 0.0001 } finish { diffuse 0.7 specular 0.5 roughness 0.0001 } } //================================================================================= // Pattern: #declare fn_pattern = function { pattern { dents warp {turbulence Turb1} scale Pscale warp {turbulence Turb2} //translate y*5*clock } } #local HF = height_field { // Play with the function. change y to -y for instance function 2000, 2000 {fn_pattern (x, y, z)*Relief + fn_pattern (x*2, y*2, z*2)*Relief/2} scale Lscale rotate <0, 0, 0> translate <-Lscale.x/2, 0, -Lscale.z/2> texture {RockTex} texture {SnowTex scale <1, 1.1, 1> translate -0.1*y} texture {VegTex scale <1, 1.1, 1> translate -0.1*y} } HF //================================================================================= // Camera and light controls: #local Min = min_extent(HF); #local Max = max_extent(HF); #debug concat("\nminextent HF: <",vstr(3, Min, ", ", 0,3),">\n") #debug concat("maxextent HF: <",vstr(3, Max, ", ", 0,3),">\n\n") light_source { <4, 5, -5>*10e3 srgb <0.9, 0.9, 0.9>*2 parallel } #local Norm = <0,0,0>; #local Loc = trace(HF, <0, 1000, Min.z+0.20>, -y, Norm); camera { perspective location sky <0, 1, 0> direction <0, 0, 1> right x*image_width/image_height up <0, 1, 0> look_at <0, Min.y, Max.z> angle 56 } //================================================================================= // Switch 'on' if you want to use a typical UperPOV features like no_cache #local Uber = off; global_settings { adc_bailout 0.00392157 noise_generator 2 radiosity { #if (Uber) no_cache brilliance on #end pretrace_start 0.08 // start pretrace at this size pretrace_end 0.004 // end pretrace at this size count 100, 1000 // higher -> higher quality (1..1600) [35] nearest_count 10, 5 // higher -> higher quality (1..10) [5] error_bound 1 // higher -> smoother, less accurate [1.8] recursion_limit 2 // how much interreflections are calculated (1..5+) [3] low_error_factor .3 // 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] maximum_reuse 0.1 // new parameter 3.7 [0.2] 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 off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } //================================================================================= sky_sphere { pigment { gradient y color_map { [0.0 srgb <0.6, 0.7, 1.0>] [0.7 srgb <0.0, 0.1, 0.8>] } } } #declare NearFogColor = <0.799, 0.799, 0.80>*1.2; //Blueish color #declare FarFogColor = <0.900, 0.900, 0.90>; //Light gray horizon color //Near fog fog { fog_type 2 distance 1.000 fog_offset -0.5 fog_alt 0.3 color srgb NearFogColor up <0, 1, 0> } //Distant fog fog { fog_type 2 distance 10.000 fog_offset -0.5 fog_alt 0.3 color srgb FarFogColor-NearFogColor up <0, 1, 0> }