#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.03, 0.04, 0.07> } // --- Camera (keeps castle framed well) --- camera { location <20, 12, -22> look_at <0, 5, 0> angle 40 up <0,9,0> right <16,0,0> // right,up -> 16:9 } // --- Twilight sky --- sky_sphere { pigment { gradient y color_map { [0.00 color rgb <0.02, 0.03, 0.06>] // near horizon [0.25 color rgb <0.08, 0.05, 0.12>] // purple band [0.55 color rgb <0.12, 0.10, 0.22>] // deepening [1.00 color rgb <0.02, 0.05, 0.15>] // zenith } } } // Subtle haze for twilight depth (kept light for speed) fog { fog_type 2 distance 95 color rgb <0.07, 0.08, 0.12> fog_offset 0.0 fog_alt 10 turbulence 0.2 } // ----------------- Simple shading (no textures) ----------------- #declare Fin_Stone = finish { diffuse 0.90 specular 0.08 roughness 0.06 }; #declare Fin_Roof = finish { diffuse 0.88 specular 0.12 roughness 0.05 }; #declare Fin_Wood = finish { diffuse 0.88 specular 0.06 roughness 0.10 }; #declare Fin_Iron = finish { diffuse 0.40 specular 0.28 roughness 0.04 }; #declare Col_StoneA = color rgb <0.72, 0.73, 0.75>; #declare Col_StoneB = color rgb <0.62, 0.64, 0.68>; #declare Col_RoofA = color rgb <0.36, 0.18, 0.16>; #declare Col_WoodA = color rgb <0.42, 0.28, 0.18>; #declare Col_Iron = color rgb <0.16, 0.17, 0.20>; #declare Tex_Stone = texture { pigment { color Col_StoneA } finish { Fin_Stone } } #declare Tex_Stone_Dark = texture { pigment { color Col_StoneB } finish { Fin_Stone } } #declare Tex_Crenel = texture { pigment { color (Col_StoneA*0.98) } finish { Fin_Stone } } #declare Tex_Roof = texture { pigment { color Col_RoofA } finish { Fin_Roof } } #declare Tex_Wood = texture { pigment { color Col_WoodA } finish { Fin_Wood } } #declare Tex_Iron = texture { pigment { color Col_Iron } finish { Fin_Iron } } #declare Tex_GrassTwilight = texture { pigment { color rgb <0.11, 0.22, 0.12> } finish { diffuse 0.95 specular 0.02 roughness 0.12 } } #declare Tex_Path = texture { pigment { color rgb <0.20, 0.17, 0.12> } finish { diffuse 0.95 specular 0.01 roughness 0.15 } } #declare Tex_Water = texture { pigment { color rgbt <0.05, 0.10, 0.14, 0.55> } finish { diffuse 0.10 specular 0.35 roughness 0.03 reflection 0.12 } } // ----------------- Conical lights (spotlights) ----------------- // Warm key spotlight (soft shadowing via circular area_light, but still conical via spotlight) light_source { <28, 34, -28> color rgb <1.00, 0.80, 0.60>*1.25 spotlight point_at <0, 6, 0> radius 20 falloff 32 tightness 10 fade_distance 70 fade_power 2 area_light <1.2,0,0>, <0,0,1.2>, 4, 4 adaptive 1 jitter } // Warm rim spotlight from the right/back light_source { <18, 18, 26> color rgb <1.00, 0.78, 0.58>*0.55 spotlight point_at <2, 6, 2> radius 18 falloff 28 tightness 12 fade_distance 75 fade_power 2 area_light <1.0,0,0>, <0,0,1.0>, 3, 3 adaptive 1 jitter } // Cool skylight fill (dim) to keep twilight readable light_source { <-34, 40, 10> color rgb <0.55, 0.70, 1.00>*0.22 spotlight point_at <0, 6, 0> radius 35 falloff 55 tightness 3 fade_distance 140 fade_power 2 area_light <2.0,0,0>, <0,0,2.0>, 3, 3 adaptive 1 jitter } // ----------------- Ground ----------------- plane { y, 0 texture { Tex_GrassTwilight } } // Small garden patch (kept, simplified) difference { box { <-4, -0.001, -18>, <4, 0.03, 18> } box { <-3, -0.01, -16>, <3, 0.05, 16> } texture { pigment { color rgb <0.08, 0.16, 0.09> } 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 } } difference { cylinder { , , TowerR+0.25 } cylinder { , , TowerR-0.05 } texture { Tex_Crenel } } 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 } } // Keep crenellations (aligned precisely around keep perimeter) 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 } } // 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 } } // Gate arch cutout surround (precise 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 } } // Wooden gate slab (inside arch) 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 { , pigment { color rgb <0.02,0.02,0.03> } finish { diffuse 0.15 specular 0 } } #local sx = sx + 1.25; #end } // Courtyard wall (low outer wall) difference { box { <-9, 0, -9>, <9, 4.0, 9> texture { Tex_Stone } } box { <-7.7, -0.1, -7.7>, <7.7, 4.2, 7.7> texture { Tex_Stone } } } // Outer wall crenellations (aligned to wall edges) 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 } } // Dirt path leading to gate box { <-1.7, 0.001, -20>, <1.7, 0.02, -4.85> texture { Tex_Path } } }; object { Castle translate <0,0,0> } // 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 } }