// Winter Castle - fast iterative render #version 3.7; global_settings { assumed_gamma 1.0 max_trace_level 6 } #include "colors.inc" #include "textures.inc" #include "functions.inc" background { color rgb <0.06, 0.08, 0.11> } // dim winter sky // --- Camera --- camera { location <0, 7.5, -22> look_at <0, 4.0, 0> angle 42 } // --- Lights (dim, winter) --- light_source { <40, 60, -50> color rgb <0.35, 0.40, 0.50> // cold moonlight parallel point_at <0, 0, 0> } light_source { <-20, 25, -10> color rgb <0.12, 0.14, 0.18> } light_source { // warm lantern glow near gate <0.0, 2.6, -5.2> color rgb <1.0, 0.65, 0.25>*0.6 fade_distance 6 fade_power 2 } light_source { // second lantern <2.2, 2.6, -5.0> color rgb <1.0, 0.65, 0.25>*0.45 fade_distance 6 fade_power 2 } // --- Atmosphere: light fog --- fog { fog_type 2 distance 55 color rgb <0.08, 0.10, 0.13> fog_alt 2.0 turbulence 0.2 } // --- Textures --- #declare T_Stone = texture { pigment { granite color_map { [0.0 color rgb <0.22,0.24,0.26>] [0.6 color rgb <0.35,0.37,0.40>] [1.0 color rgb <0.50,0.52,0.55>] } scale 0.6 } normal { bumps 0.35 scale 0.25 } finish { diffuse 0.75 specular 0.10 roughness 0.08 } } #declare T_Snow = texture { pigment { color rgb <0.94, 0.96, 0.99> } normal { bumps 0.25 scale 0.35 } finish { diffuse 0.9 specular 0.08 roughness 0.12 } } #declare T_Wood = texture { pigment { wood color_map { [0.0 color rgb <0.18,0.12,0.08>] [1.0 color rgb <0.30,0.20,0.12>] } scale 0.25 } normal { bumps 0.25 scale 0.05 } finish { diffuse 0.8 specular 0.08 roughness 0.12 } } // --- Ground (snowy) --- plane { y, 0 texture { T_Snow } } // subtle unevenness via a thin heightfield-like layer (fast: a slightly bumpy box) box { <-80, -0.15, -80>, <80, 0, 80> texture { T_Snow normal { bumps 0.55 scale 2.0 } } no_shadow } // --- Castle dimensions --- #declare Wall_Thick = 1.2; #declare Wall_Height = 6.0; #declare CourtyardHalf = 6.5; // Outer walls (rectangular ring) precisely aligned #declare WallZ_Front = -4.0; #declare WallZ_Back = 9.0; #declare WallX_Left = -9.0; #declare WallX_Right = 9.0; #declare Wall_Y0 = 0.0; #declare Wall_Y1 = Wall_Height; // Front wall with centered gate opening (use difference) difference { box { , } // Gate opening box { <-1.8, 0.0, WallZ_Front-0.1>, <1.8, 3.6, WallZ_Front + Wall_Thick+0.1> } texture { T_Stone } } // Back wall box { , texture { T_Stone } } // Left wall box { , texture { T_Stone } } // Right wall box { , texture { T_Stone } } // --- Corner towers (cylinders) aligned with outer corners --- #declare Tower_R = 2.1; #declare Tower_H = 8.0; #macro CornerTower(X,Z) union { cylinder { , , Tower_R texture { T_Stone } } // Snow cap ring on top cylinder { , , Tower_R*1.02 texture { T_Snow } } // Simple crenellations #declare i = 0; #while (i < 10) box { , texture { T_Stone } rotate <0, i*36, 0> translate <0,0,0> } #declare i = i + 1; #end } #end CornerTower(WallX_Left, WallZ_Front) CornerTower(WallX_Right, WallZ_Front) CornerTower(WallX_Left, WallZ_Back) CornerTower(WallX_Right, WallZ_Back) // --- Main keep (central) --- #declare Keep_X0 = -3.2; #declare Keep_X1 = 3.2; #declare Keep_Z0 = 1.0; #declare Keep_Z1 = 7.2; #declare Keep_H = 10.0; union { box { , texture { T_Stone } } // Snow on roof (flat) box { , texture { T_Snow } } // Battlements on keep top #declare bx = Keep_X0+0.4; #while (bx < Keep_X1-0.4) box { , texture { T_Stone } } box { , texture { T_Stone } } #declare bx = bx + 1.1; #end #declare bz = Keep_Z0+0.4; #while (bz < Keep_Z1-0.4) box { , texture { T_Stone } } box { , texture { T_Stone } } #declare bz = bz + 1.1; #end } // --- Snow on wall tops (thin caps) --- box { , texture { T_Snow } } box { , texture { T_Snow } } box { , texture { T_Snow } } box { , texture { T_Snow } } // --- Gate door / portcullis (inside opening) --- union { // wood door slab box { <-1.65, 0.0, WallZ_Front + 0.15>, <1.65, 3.4, WallZ_Front + 0.45> texture { T_Wood } } // braces box { <-1.55, 0.55, WallZ_Front + 0.46>, <1.55, 0.75, WallZ_Front + 0.62> texture { T_Wood } } box { <-1.55, 1.65, WallZ_Front + 0.46>, <1.55, 1.85, WallZ_Front + 0.62> texture { T_Wood } } box { <-1.55, 2.75, WallZ_Front + 0.46>, <1.55, 2.95, WallZ_Front + 0.62> texture { T_Wood } } // slight snow on top edge box { <-1.70, 3.35, WallZ_Front + 0.10>, <1.70, 3.55, WallZ_Front + 0.70> texture { T_Snow } } } // --- Lantern fixtures (simple) --- #macro Lantern(Pos) union { sphere { Pos, 0.10 texture { T_Stone } } // mount cylinder { Pos + <0,0,0>, Pos + <0,-0.35,0>, 0.03 texture { T_Stone } } sphere { Pos + <0,-0.55,0>, 0.14 pigment { color rgb <1.0,0.75,0.35> } finish { emission 0.35 diffuse 0.2 } } } #end Lantern(<-2.1, 3.2, -5.0>) Lantern(< 2.1, 3.2, -5.0>) // --- Trees (simple pines with snow) --- #macro PineTree(Base, H, R) union { // trunk cylinder { Base, Base + <0, H*0.25, 0>, R*0.20 texture { T_Wood } } // foliage cones cone { Base + <0, H*0.18, 0>, R*1.2, Base + <0, H*0.55, 0>, R*0.25 pigment { color rgb <0.06,0.10,0.07> } finish { diffuse 0.75 } } cone { Base + <0, H*0.35, 0>, R*1.0, Base + <0, H*0.78, 0>, R*0.18 pigment { color rgb <0.05,0.09,0.06> } finish { diffuse 0.75 } } cone { Base + <0, H*0.55, 0>, R*0.7, Base + <0, H*1.00, 0>, R*0.05 pigment { color rgb <0.05,0.09,0.06> } finish { diffuse 0.75 } } // snow caps cone { Base + <0, H*0.55, 0>, R*0.30, Base + <0, H*0.78, 0>, R*0.08 texture { T_Snow } } cone { Base + <0, H*0.78, 0>, R*0.18, Base + <0, H*1.00, 0>, R*0.03 texture { T_Snow } } } #end PineTree(<-14,0, 6>, 7.5, 2.2) PineTree(< 13,0, 8>, 8.0, 2.3) PineTree(<-16,0, -6>, 6.8, 2.0) PineTree(< 16,0, -4>, 7.2, 2.1) // --- Falling snow (simple particles, limited count for speed) --- #declare SnowCount = 140; #declare s = 0; #while (s < SnowCount) sphere { < (rand(seed(1234))*50 - 25), (rand(seed(5678))*10 + 2), (rand(seed(91011))*40 - 20) >, 0.03 + rand(seed(1213))*0.03 pigment { color rgb <0.98,0.99,1.0> } finish { diffuse 0.2 specular 0.0 emission 0.05 } no_shadow } #declare s = s + 1; #end