#version 3.5; #include "colors.inc" #include "functions.inc" #declare Do_Land = true; #declare Do_Trees = true; #declare Test_Tree = false; #declare Snow_Qual = 1;// 0.01; // 1 for normal global_settings { assumed_gamma 1.0 max_trace_level 10 } camera { location <0.0,2.0, 0.0> look_at <0.0,1.0,20.0> } #declare Stars = pigment{ granite scale 1 turbulence 0.5 pigment_map{[0.0 White][0.15 Black]} } sky_sphere { pigment{ bozo scale 0.05 pigment_map{ [0.4 Black] [0.6 Stars] } } } light_source { <0, 0, 0> color rgb <1, 1, 1>*1 translate <150000, 200000, 50000> media_attenuation on } #declare BaseRockTex = texture{ pigment{granite scale 0.25 pigment_map{[0.0 Black][0.5 Gray10][1.0 Gray50]}} finish{ambient 0 diffuse 0.8} normal{ average normal_map{ [dents 15 scale 1 ] [granite 15 scale 1 turbulence 0.25] [marble 15 scale 1 turbulence 0.5] [crackle 15 scale 1 turbulence 0.5] } } } #declare SnowTex = texture{ pigment{rgb<0.9,0.9,1.3>} finish{ambient 0.10 diffuse 0.85} normal{ average 2 normal_map{ [dents 1 scale 1/25] [bozo 1 scale 2] } } } #declare RockTex = texture{ marble rotate z*90 scale 10 turbulence 0.5 texture_map{ [0.9 BaseRockTex scale 0.01] [0.9 bozo scale 10 texture_map{[0.5 BaseRockTex][0.5 SnowTex]}] } } #declare GBaseTex = texture{ slope y texture_map{ [0.64 RockTex] // BaseRockTex scale 0.01] //[0.64 RockTex] [0.66 SnowTex] } } #declare GroundMFFunc = function(x,y,z){f_ridged_mf(x,y,z, 0.9, 5, 10, 0.75, 1, 0)} #declare GroundFunc = function(x,y,z){y - (GroundMFFunc(x/15,0,z/15) * min(((x/10)^2 + (z/10)^2), 25))} #declare Ground = isosurface{ function{GroundFunc(x,y,z)} contained_by{box{<-50,-1,0>,<50,3000,50>}} // <-5000,-100,-1000>,<5000,5000,5000> // max ht 1611.46 accuracy 0.001 max_gradient 10 scale 100 translate y*-3 translate z*-100 } #if(Do_Land) object{ Ground texture{GBaseTex} } #else plane{y,0 texture{GBaseTex}} #end // Changes from here #if(Do_Trees) #include "tree.inc" #local SnowBlobs = 1500*Snow_Qual; #local TreeVars = 5; #local TreeArray = array[TreeVars][3]; #debug concat("Making trees (", str(TreeVars,0,0), " varients)\n") #declare BarkTex = texture{pigment{rgb<0.1,0.05,0>} normal{wrinkles}} #declare FolTex = texture{pigment{rgb<0.02,0.1,0>} normal{wrinkles}} #local TRand1 = seed(36462); #local TCount1 = 0; #while(TCount1 < TreeVars) MakeTree(10,1,rand(TRand1)*10000,BarkTex,FolTex) #declare Tree = union{ object{Trunk} object{Branches} object{Foliage} } #declare Snow = blob{ MakeTreeSnow(Tree, SnowBlobs, 548) texture{SnowTex} } #declare Tree_A = union{ object{Trunk} object{Branches} object{Foliage} object{Snow} } #declare Tree_B = union{ object{Trunk} object{Foliage} object{Snow} } #declare Tree_C = union{ object{Foliage} object{Snow} } #local TreeArray[TCount1][0] = object{Tree_A} #local TreeArray[TCount1][1] = object{Tree_B} #local TreeArray[TCount1][2] = object{Tree_C} #local TCount1 = TCount1 + 1; #end #debug "Trees made\n" #if(Test_Tree) object{TreeArray[0][0] translate z*25 translate x*-10} object{TreeArray[1][0] translate z*25 translate x*-5} object{TreeArray[2][0] translate z*25 translate x*-0} object{TreeArray[3][0] translate z*25 translate x*5} object{TreeArray[4][0] translate z*25 translate x*10} #else #debug "Positiong trees\n" #declare TRand2 = seed(345); #local TCount1 = 1; union{ #while(TCount1 < 20000) #local XTrans2 = 2000*rand(TRand2) - 1000; #local ZTrans2 = 2000*rand(TRand2) + 10; #if(abs(XTrans2)/ZTrans2 < 0.67) #local TreeSlct = int(rand(TRand2)*TreeVars); #switch(ZTrans2) #range(0,100) #local Qual = 0; #break #range(101,200) #local Qual = 1; #break #else #local Qual = 2; #break #end #local ThisTree = TreeArray[TreeSlct][Qual] object{ ThisTree #local XZScale = rand(TRand2)/2 + 0.5; scale rotate y*(rand(TRand2) * 360) #local Inter2 = trace(Ground, , <0,-1,0>); translate } #local TCount1 = TCount1 + 1; #end #end } #end #end