/********************************************************************************** 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) + Jörg "Yadgar" Bleimann (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 3.7; #local textpath = "/home/Raytracing/Povscn/Fonts/"; 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; #local mapping = 1; //================================================================================= // 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 } } #if (mapping) #local F_SelfShine = finish { ambient 1 diffuse 0 } #local C_10000_to_8000 = color rgb <0, 0, 0.15>; #local C_8000_to_6000 = color rgb <0, 0, 0.3>; #local C_6000_to_4000 = color rgb <0, 0, 0.6>; #local C_4000_to_3000 = color rgb <0, 0, 0.9>; #local C_3000_to_2000 = color rgb <0, 0.05, 1>; #local C_2000_to_1500 = color rgb <0, 0.25, 1>; #local C_1500_to_1000 = color rgb <0, 0.5, 1>; #local C_1000_to_500 = color rgb <0, 0.75, 1>; #local C_500_to_200 = color rgb <0, 1, 1>; #local C_200_to_100 = color rgb <0.2, 1, 1>; #local C_100_to_50 = color rgb <0.4, 1, 1>; #local C_50_to_0 = color rgb <0.6, 1, 1>; #local C_0_to_50 = color rgb <0, 0.7, 0>; #local C_50_to_100 = color rgb <0, 1, 0>; #local C_100_to_200 = color rgb <0.5, 1, 0.75>; #local C_200_to_300 = color rgb <1, 1, 0.75>; #local C_300_to_500 = color rgb <1, 1, 0.4>; #local C_500_to_700 = color rgb <1, 1, 0>; #local C_700_to_1000 = color rgb <1, 0.9, 0>; #local C_1000_to_1500 = color rgb <1, 0.75, 0>; #local C_1500_to_2000 = color rgb <1, 0.6, 0>; #local C_2000_to_2500 = color rgb <1, 0.45, 0>; #local C_2500_to_3000 = color rgb <1, 0.3, 0>; #local C_3000_to_4000 = color rgb <1, 0.2, 0>; #local C_4000_to_5000 = color rgb <1, 0.1, 0>; #local C_5000_to_6000 = color rgb <0.8, 0.08, 0>; #local C_6000_to_8000 = color rgb <0.6, 0.06, 0>; #local C_8000_to_10000 = color rgb <0.4, 0.04, 0>; #local CM_PhysicalMap = color_map { [0 C_10000_to_8000] // -10000 m [0.1 C_10000_to_8000] // -8000 m [0.1 C_8000_to_6000 ] [0.2 C_8000_to_6000 ] // -6000 m [0.2 C_6000_to_4000 ] [0.3 C_6000_to_4000 ] // -4000 m [0.3 C_4000_to_3000 ] [0.35 C_4000_to_3000 ] // -3000 m [0.35 C_3000_to_2000 ] [0.4 C_3000_to_2000 ] // -2000 m [0.4 C_2000_to_1500 ] [0.425 C_2000_to_1500 ] // -1500 m [0.425 C_1500_to_1000 ] [0.45 C_1500_to_1000 ] // -1000 m [0.45 C_1000_to_500 ] [0.475 C_1000_to_500 ] // -500 m [0.475 C_500_to_200 ] [0.49 C_500_to_200 ] // -200 m [0.49 C_200_to_100 ] [0.495 C_200_to_100 ] // -100 m [0.495 C_100_to_50 ] [0.4975 C_100_to_50 ] // -50 m [0.4975 C_50_to_0 ] [0.5 C_50_to_0 ] // 0 m [0.5 C_0_to_50 ] [0.5025 C_0_to_50 ] // 50 m [0.5025 C_50_to_100 ] [0.505 C_50_to_100 ] // 100 m [0.505 C_100_to_200 ] [0.51 C_100_to_200 ] // 200 m [0.51 C_200_to_300 ] [0.515 C_200_to_300 ] // 300 m [0.515 C_300_to_500 ] [0.525 C_300_to_500 ] // 500 m [0.525 C_500_to_700 ] [0.535 C_500_to_700 ] // 700 m [0.535 C_700_to_1000 ] [0.55 C_700_to_1000 ] // 1000 m [0.55 C_1000_to_1500 ] [0.575 C_1000_to_1500 ] // 1500 m [0.575 C_1500_to_2000 ] [0.6 C_1500_to_2000 ] // 2000 m [0.6 C_2000_to_2500 ] [0.625 C_2000_to_2500 ] // 2500 m [0.625 C_2500_to_3000 ] [0.65 C_2500_to_3000 ] // 3000 m [0.65 C_3000_to_4000 ] [0.7 C_3000_to_4000 ] // 4000 m [0.7 C_4000_to_5000 ] [0.75 C_4000_to_5000 ] // 5000 m [0.75 C_5000_to_6000 ] [0.8 C_5000_to_6000 ] // 6000 m [0.8 C_6000_to_8000 ] [0.9 C_6000_to_8000 ] // 8000 m [0.9 C_8000_to_10000] [1 C_8000_to_10000] // 10000 m } #local CM_Legend = color_map { [0 C_10000_to_8000] // -10000 m [1/28 C_10000_to_8000] // -8000 m [1/28 C_8000_to_6000 ] [2/28 C_8000_to_6000 ] // -6000 m [2/28 C_6000_to_4000 ] [3/28 C_6000_to_4000 ] // -4000 m [3/28 C_4000_to_3000 ] [4/28 C_4000_to_3000 ] // -3000 m [4/28 C_3000_to_2000 ] [5/28 C_3000_to_2000 ] // -2000 m [5/28 C_2000_to_1500 ] [6/28 C_2000_to_1500 ] // -1500 m [6/28 C_1500_to_1000 ] [7/28 C_1500_to_1000 ] // -1000 m [7/28 C_1000_to_500 ] [8/28 C_1000_to_500 ] // -500 m [8/28 C_500_to_200 ] [9/28 C_500_to_200 ] // -200 m [9/28 C_200_to_100 ] [10/28 C_200_to_100 ] // -100 m [10/28 C_100_to_50 ] [11/28 C_100_to_50 ] // -50 m [11/28 C_50_to_0 ] [12/28 C_50_to_0 ] // 0 m [12/28 C_0_to_50 ] [13/28 C_0_to_50 ] // 50 m [13/28 C_50_to_100 ] [14/28 C_50_to_100 ] // 100 m [14/28 C_100_to_200 ] [15/28 C_100_to_200 ] // 200 m [15/28 C_200_to_300 ] [16/28 C_200_to_300 ] // 300 m [16/28 C_300_to_500 ] [17/28 C_300_to_500 ] // 500 m [17/28 C_500_to_700 ] [18/28 C_500_to_700 ] // 700 m [18/28 C_700_to_1000 ] [19/28 C_700_to_1000 ] // 1000 m [19/28 C_1000_to_1500 ] [20/28 C_1000_to_1500 ] // 1500 m [20/28 C_1500_to_2000 ] [21/28 C_1500_to_2000 ] // 2000 m [21/28 C_2000_to_2500 ] [22/28 C_2000_to_2500 ] // 2500 m [22/28 C_2500_to_3000 ] [23/28 C_2500_to_3000 ] // 3000 m [23/28 C_3000_to_4000 ] [24/28 C_3000_to_4000 ] // 4000 m [24/28 C_4000_to_5000 ] [25/28 C_4000_to_5000 ] // 5000 m [25/28 C_5000_to_6000 ] [26/28 C_5000_to_6000 ] // 6000 m [26/28 C_6000_to_8000 ] [27/28 C_6000_to_8000 ] // 8000 m [27/28 C_8000_to_10000] [1 C_8000_to_10000] // 10000 m } #local T_PhysicalMap = texture { pigment { gradient y color_map { CM_PhysicalMap } } finish { F_SelfShine } } #local T_Text = texture { pigment { color rgb 1 } finish { F_SelfShine } } #end //================================================================================= // 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> #if (mapping) texture { T_PhysicalMap translate <0, -0.5, 0> scale 10 } #else texture {RockTex} texture {SnowTex scale <1, 1.1, 1> translate -0.1*y} texture {VegTex scale <1, 1.1, 1> translate -0.1*y} #end } HF #if (mapping) #local Legend = union { mesh2 { vertex_vectors { 4, /* <-Lscale.x/3, 0, -Lscale.z/2-1>, <-Lscale.x/3, 0, -Lscale.z/2-1.2>, , */ <-Lscale.x/2, 0, -Lscale.z/2-0.2>, <-Lscale.x/2, 0, -Lscale.z/2-0.4>, , } face_indices { 2, <0, 1, 2>, <0, 2, 3> } texture { pigment { gradient -x color_map { CM_Legend } scale Lscale.x translate <-Lscale.x/2, 0, 0> } finish { F_SelfShine } } } union { text { ttf concat(textpath, "arial.ttf") "10000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "8000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "6000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "4000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "3000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "2000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "1500" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "1000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "500" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "200" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "100" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "50" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "0" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "50" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "100" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "200" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "300" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "500" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "700" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "1000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "1500" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "2000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "2500" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "3000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "4000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "5000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "6000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "8000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } text { ttf concat(textpath, "arial.ttf") "10000" 0.01, 0 rotate <90, 0, 180> scale 0.12 translate } texture { T_Text } } } text { ttf concat(textpath, "arial.ttf"), "Sea depths and land elevations in metres", 0.01, 0 scale 0.16 rotate <90, 0, 180> translate <4, 0, -Lscale.z/2-0.77> texture { T_Text } } box { <-3, 0, -Lscale.z/2-0.77>, <-4, 0.1, -Lscale.z/2-0.75> texture { T_Text } } text { ttf concat(textpath, "arial.ttf"), "1 km", 0.01, 0 scale 0.16 rotate <90, 0, 180> translate <-3.35, 0, -Lscale.z/2-0.93> texture { T_Text } } Legend #end //================================================================================= // 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") #if (!mapping) light_source { <4, 5, -5>*10e3 srgb <0.9, 0.9, 0.9>*2 parallel } #end #local Norm = <0,0,0>; #local Loc = trace(HF, <0, 1000, Min.z+0.20>, -y, Norm); #if (mapping) camera { orthographic up <0, 0, 12> right <12, 0, 0> location <0, 20, 0> look_at 0 } #else 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 } #end //================================================================================= // Switch 'on' if you want to use a typical UperPOV features like no_cache #local Uber = off; #if (!mapping) 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> } #end