#version 3.7; global_settings { assumed_gamma 1.3 max_trace_level 16 radiosity { pretrace_start 0.08 pretrace_end 0.01 count 200 nearest_count 10 error_bound 0.5 recursion_limit 2 low_error_factor 0.5 gray_threshold 0.0 } } background { color rgb <0.72, 0.86, 1.00> } // --- Camera (keeps castle framed well) --- camera { location <22, 13, -24> look_at <0, 5.2, 0> angle 40 up <0,9,0> right <16,0,0> // right,up -> 16:9 } // --- Summer sky --- sky_sphere { pigment { gradient y color_map { [0.00 color rgb <0.82, 0.94, 1.00>] // horizon [0.55 color rgb <0.48, 0.74, 1.00>] [1.00 color rgb <0.18, 0.46, 0.92>] // zenith } } } // Light summer haze fog { fog_type 2 distance 220 color rgb <0.84, 0.93, 1.00> fog_offset 0.0 fog_alt 22 turbulence 0.08 } // ----------------- Finishes ----------------- #declare Fin_Stone = finish { diffuse 0.90 specular 0.06 roughness 0.10 }; #declare Fin_Roof = finish { diffuse 0.88 specular 0.10 roughness 0.06 }; #declare Fin_Wood = finish { diffuse 0.90 specular 0.05 roughness 0.12 }; #declare Fin_Iron = finish { diffuse 0.40 specular 0.28 roughness 0.05 }; #declare Col_RoofA = color rgb <0.43, 0.22, 0.18>; #declare Col_WoodA = color rgb <0.42, 0.28, 0.18>; #declare Col_Iron = color rgb <0.16, 0.17, 0.20>; // ----------------- Stone / brick masonry textures ----------------- // IMPORTANT: `pigment_map` entries must contain PATTERN blocks, not `pigment {}` blocks. #declare Pig_StoneBase = pigment { average pigment_map { // Main ashlar blocks [0.78 brick color rgb <0.78, 0.78, 0.76>, color rgb <0.66, 0.67, 0.69> brick_size <0.85, 0.42, 0.85> mortar 0.14 ] // Broad tonal variation [0.14 bozo color_map { [0.00 color rgb <0.92,0.92,0.92>] [0.55 color rgb <0.80,0.80,0.81>] [1.00 color rgb <0.62,0.62,0.64>] } scale 0.60 ] // Small specks [0.08 granite color_map { [0.00 color rgb <0.12,0.12,0.13>] [1.00 color rgb <0.22,0.22,0.24>] } scale 0.35 ] } } #declare Pig_StoneDark = pigment { average pigment_map { [0.80 brick color rgb <0.68, 0.69, 0.70>, color rgb <0.54, 0.55, 0.57> brick_size <0.85, 0.42, 0.85> mortar 0.14 ] [0.12 bozo color_map { [0.00 color rgb <0.88,0.88,0.89>] [0.55 color rgb <0.74,0.74,0.75>] [1.00 color rgb <0.56,0.56,0.58>] } scale 0.70 ] [0.08 granite color_map { [0.00 color rgb <0.10,0.10,0.11>] [1.00 color rgb <0.20,0.20,0.22>] } scale 0.35 ] } } #declare Pig_Crenel = pigment { average pigment_map { [0.84 brick color rgb <0.80, 0.80, 0.78>, color rgb <0.66, 0.67, 0.69> brick_size <0.70, 0.38, 0.70> mortar 0.16 ] [0.16 wrinkles color_map { [0.00 color rgb <0.76,0.76,0.74>] [1.00 color rgb <0.62,0.62,0.64>] } scale 0.45 ] } } #declare Tex_Stone = texture { pigment { Pig_StoneBase } normal { bumps 0.28 scale 0.18 } finish { Fin_Stone } } #declare Tex_Stone_Dark = texture { pigment { Pig_StoneDark } normal { bumps 0.30 scale 0.18 } finish { Fin_Stone } } #declare Tex_Crenel = texture { pigment { Pig_Crenel } normal { bumps 0.24 scale 0.16 } finish { Fin_Stone } } #declare Tex_Roof = texture { pigment { color Col_RoofA } finish { Fin_Roof } } #declare Tex_Wood = texture { pigment { wood color_map { [0.0 color (Col_WoodA*0.82)] [0.5 color Col_WoodA] [1.0 color (Col_WoodA*1.10)] } scale 0.55 } normal { bumps 0.14 scale 0.08 } finish { Fin_Wood } } #declare Tex_Iron = texture { pigment { color Col_Iron } finish { Fin_Iron } } // Summer grass + gravel path #declare Tex_GrassSummer = texture { pigment { bozo color_map { [0.00 color rgb <0.24, 0.52, 0.22>] [0.55 color rgb <0.18, 0.46, 0.18>] [1.00 color rgb <0.30, 0.60, 0.24>] } scale 1.25 } normal { bumps 0.22 scale 0.25 } finish { diffuse 0.95 specular 0.02 roughness 0.14 } } #declare Tex_Path = texture { pigment { bozo color_map { [0.00 color rgb <0.58, 0.54, 0.46>] [0.60 color rgb <0.48, 0.44, 0.38>] [1.00 color rgb <0.64, 0.60, 0.50>] } scale 0.9 } normal { bumps 0.14 scale 0.20 } finish { diffuse 0.96 specular 0.02 roughness 0.16 } } #declare Tex_Water = texture { pigment { color rgbt <0.10, 0.26, 0.20, 0.58> } normal { ripples 0.35 scale 0.65 } finish { diffuse 0.10 specular 0.30 roughness 0.03 reflection 0.10 } } // ----------------- Warm summer lights with soft shadows ----------------- light_source { <120, 160, -110> color rgb <1.00, 0.90, 0.75>*1.20 parallel point_at <0, 0, 0> area_light <18,0,0>, <0,0,18>, 5, 5 adaptive 1 jitter } light_source { <-60, 70, -30> color rgb <1.00, 0.88, 0.72>*0.30 area_light <12,0,0>, <0,0,12>, 4, 4 adaptive 1 jitter } light_source { <0, 120, 80> color rgb <0.65, 0.78, 1.00>*0.16 area_light <16,0,0>, <0,0,16>, 4, 4 adaptive 1 jitter } // ----------------- Ground ----------------- plane { y, 0 texture { Tex_GrassSummer } } // Slightly trimmed rectangular yard patch (darker/mown) difference { box { <-4, -0.001, -18>, <4, 0.03, 18> } box { <-3, -0.01, -16>, <3, 0.05, 16> } texture { pigment { bozo color_map { [0.00 color rgb <0.12, 0.34, 0.12>] [1.00 color rgb <0.10, 0.28, 0.10>] } scale 0.65 } normal { bumps 0.14 scale 0.22 } finish { diffuse 0.95 specular 0.02 roughness 0.12 } } translate <10, 0, 0> } // ----------------- Castle geometry ----------------- #declare TowerR = 1.6; #declare TowerH = 9.5; #macro TowerAt(PX,PZ) union { cylinder { , , TowerR texture { Tex_Stone_Dark scale 0.95 rotate <0, 25, 0> translate } } difference { cylinder { , , TowerR+0.25 } cylinder { , , TowerR-0.05 } texture { Tex_Crenel scale 0.95 rotate <0, 15, 0> translate } } cone { , TowerR+0.15, , 0.1 texture { Tex_Roof } } } #end #declare Castle = union { // Central keep (base) box { <-4, 0, -4>, <4, 8, 4> texture { Tex_Stone scale 0.95 rotate <0, 90, 0> } } // Keep crenellations union { #local i = -3.5; #while (i <= 3.5) box { , } box { , } box { <-4.3, 8, i>, <-3.7, 8.8, i+0.6> } box { < 3.7, 8, i>, < 4.3, 8.8, i+0.6> } #local i = i + 1.0; #end texture { Tex_Crenel scale 0.95 rotate <0, 90, 0> } } // Corner towers TowerAt(-4, -4) TowerAt( 4, -4) TowerAt(-4, 4) TowerAt( 4, 4) // Gatehouse protrusion box { <-2.2, 0, -6.2>, <2.2, 6.0, -4.0> texture { Tex_Stone_Dark scale 0.95 rotate <0, 90, 0> } } // Gate arch surround (boolean) difference { box { <-1.2, 0.0, -6.21>, <1.2, 3.2, -3.95> } cylinder { <0, 3.2, -6.30>, <0, 3.2, -3.80>, 1.2 } texture { Tex_Stone_Dark scale 0.95 rotate <0, 90, 0> } } // Wooden gate slab box { <-1.05, 0.05, -5.05>, <1.05, 2.7, -4.85> texture { Tex_Wood } } // Iron band box { <-1.05, 1.25, -4.86>, <1.05, 1.40, -4.82> texture { Tex_Iron } } // Slit windows (dark) #declare SlitW = 0.25; #declare SlitH = 1.2; #declare SlitD = 0.3; union { #local sx = -2.5; #while (sx <= 2.5) box { , texture { pigment { color rgb <0.02,0.02,0.03> } finish { diffuse 0.15 specular 0 } } } #local sx = sx + 1.25; #end } // Courtyard wall (outer curtain wall) difference { box { <-9, 0, -9>, <9, 4.0, 9> texture { Tex_Stone scale 0.95 } } box { <-7.7, -0.1, -7.7>, <7.7, 4.2, 7.7> texture { Tex_Stone scale 0.95 } } } // Outer wall crenellations union { #local tt = -8.5; #while (tt <= 8.5) box { , } box { , } box { <-9.3, 4.0, tt>, <-8.7, 4.8, tt+0.7> } box { < 8.7, 4.0, tt>, < 9.3, 4.8, tt+0.7> } #local tt = tt + 1.4; #end texture { Tex_Crenel scale 0.95 } } // Gravel path leading to gate box { <-1.8, 0.001, -20>, <1.8, 0.02, -4.85> texture { Tex_Path } } }; object { Castle } // Moat hint (shallow water ring outside wall) difference { cylinder { <0, 0.02, 0>, <0, 0.08, 0>, 13.0 } cylinder { <0, 0.01, 0>, <0, 0.10, 0>, 10.5 } texture { Tex_Water } }