// Neat European-style summer castle (fast iteration scene) #version 3.7; global_settings { assumed_gamma 1.0 max_trace_level 8 } background { color rgb <0.60, 0.82, 1.00> } // --- Camera --- camera { location <0, 10.5, -24> look_at <0, 6.0, 0> angle 38 } // --- Lights (warm + soft shadows) --- light_source { <40, 55, -30> color rgb <1.00, 0.92, 0.80>*1.15 area_light <6,0,0>, <0,0,6>, 4, 4 adaptive 1 jitter } light_source { <-25, 25, -10> color rgb <0.95, 0.97, 1.00>*0.35 area_light <4,0,0>, <0,0,4>, 3, 3 adaptive 1 jitter } // --- Sky gradient plane (cheap) --- plane { y, 1 pigment { gradient y color_map { [0.00 color rgb <0.60, 0.82, 1.00>] [0.55 color rgb <0.78, 0.92, 1.00>] [1.00 color rgb <0.98, 0.99, 1.00>] } scale 120 translate -60 } finish { ambient 1 diffuse 0 } hollow } // --- Materials --- #declare StonePig = pigment { granite color_map { [0.00 color rgb <0.82, 0.80, 0.75>] [0.55 color rgb <0.74, 0.72, 0.68>] [1.00 color rgb <0.88, 0.86, 0.82>] } scale 0.55 }; #declare StoneFinish = finish { diffuse 0.85 specular 0.10 roughness 0.06 }; #declare StoneTex = texture { StonePig normal { bumps 0.30 scale 0.20 } finish { StoneFinish } }; #declare RoofTex = texture { pigment { color rgb <0.34, 0.26, 0.22> } normal { bumps 0.25 scale 0.18 } finish { diffuse 0.85 specular 0.12 roughness 0.08 } }; #declare DarkWoodTex = texture { pigment { color rgb <0.25, 0.17, 0.10> } normal { bumps 0.30 scale 0.20 } finish { diffuse 0.85 specular 0.08 roughness 0.10 } }; #declare GrassTex = texture { pigment { bozo color_map { [0.00 color rgb <0.25, 0.55, 0.22>] [0.55 color rgb <0.30, 0.62, 0.24>] [1.00 color rgb <0.18, 0.45, 0.18>] } scale 3.0 } normal { bumps 0.35 scale 0.40 } finish { diffuse 0.95 specular 0.03 roughness 0.20 } }; #declare GroundStoneTex = texture { pigment { granite color_map { [0.00 color rgb <0.70, 0.68, 0.63>] [0.55 color rgb <0.62, 0.60, 0.56>] [1.00 color rgb <0.78, 0.76, 0.72>] } scale 0.85 } normal { bumps 0.25 scale 0.25 } finish { diffuse 0.85 specular 0.08 roughness 0.08 } }; // --- Ground / hill --- plane { y, 0 texture { GrassTex } } // A gentle hill mound under the castle sphere { <0, -2.3, 0>, 10.8 texture { GrassTex } } // Small stone apron near entrance box { <-4.5, 0.001, -9.0>, <4.5, 0.06, -3.0> texture { GroundStoneTex } } // --- Reusable crenellation macro (fast + aligned) --- #macro CrenelsX(X1, X2, Y1, Y2, Z1, Z2, Count, GapFrac) #local L = (X2 - X1); #local Step = L/Count; #local W = Step*(1.0 - GapFrac); #local i = 0; union { #while (i < Count) box { , } #local i = i + 1; #end } #end #macro CrenelsZ(Z1, Z2, Y1, Y2, X1, X2, Count, GapFrac) #local L = (Z2 - Z1); #local Step = L/Count; #local W = Step*(1.0 - GapFrac); #local i = 0; union { #while (i < Count) box { , } #local i = i + 1; #end } #end // --- Castle dimensions (kept consistent for precise fits) --- #declare WallTh = 0.8; #declare KeepX1 = -4.0; #declare KeepX2 = 4.0; #declare KeepZ1 = -2.0; #declare KeepZ2 = 6.0; #declare KeepH = 9.0; #declare TowerR = 2.0; #declare TowerH = 10.0; #declare CourtyardX1 = -10.0; #declare CourtyardX2 = 10.0; #declare CourtyardZ1 = -10.0; #declare CourtyardZ2 = 12.0; #declare WallH = 6.0; // --- Castle union --- union { // Main keep box { , texture { StoneTex } } // Keep roof (simple hip/pyramid style) cone { <0, KeepH, 2.0>, 5.8, <0, KeepH+3.1, 2.0>, 0.0 texture { RoofTex } } // Keep crenellations (top edge) union { // Front/back object { CrenelsX(KeepX1, KeepX2, KeepH, KeepH+0.8, KeepZ1-0.001, KeepZ1+0.65, 10, 0.35) } object { CrenelsX(KeepX1, KeepX2, KeepH, KeepH+0.8, KeepZ2-0.65, KeepZ2+0.001, 10, 0.35) } // Left/right object { CrenelsZ(KeepZ1, KeepZ2, KeepH, KeepH+0.8, KeepX1-0.001, KeepX1+0.65, 10, 0.35) } object { CrenelsZ(KeepZ1, KeepZ2, KeepH, KeepH+0.8, KeepX2-0.65, KeepX2+0.001, 10, 0.35) } texture { StoneTex } } // Corner towers (cylinders) positioned at courtyard corners #declare TX1 = CourtyardX1; #declare TX2 = CourtyardX2; #declare TZ1 = CourtyardZ1; #declare TZ2 = CourtyardZ2; #declare TowerC1 = ; #declare TowerC2 = ; #declare TowerC3 = ; #declare TowerC4 = ; cylinder { TowerC1, TowerC1 + <0, TowerH, 0>, TowerR texture { StoneTex } } cylinder { TowerC2, TowerC2 + <0, TowerH, 0>, TowerR texture { StoneTex } } cylinder { TowerC3, TowerC3 + <0, TowerH, 0>, TowerR texture { StoneTex } } cylinder { TowerC4, TowerC4 + <0, TowerH, 0>, TowerR texture { StoneTex } } // Tower roofs (conical) cone { TowerC1 + <0, TowerH, 0>, TowerR+0.2, TowerC1 + <0, TowerH+3.0, 0>, 0 texture { RoofTex } } cone { TowerC2 + <0, TowerH, 0>, TowerR+0.2, TowerC2 + <0, TowerH+3.0, 0>, 0 texture { RoofTex } } cone { TowerC3 + <0, TowerH, 0>, TowerR+0.2, TowerC3 + <0, TowerH+3.0, 0>, 0 texture { RoofTex } } cone { TowerC4 + <0, TowerH, 0>, TowerR+0.2, TowerC4 + <0, TowerH+3.0, 0>, 0 texture { RoofTex } } // Curtain walls (fit precisely between tower tangency points) // North wall (between C1 and C2) at Z=TZ1, runs X from TX1+R to TX2-R box { , texture { StoneTex } } // South wall at Z=TZ2 box { , texture { StoneTex } } // West wall at X=TX1 box { , texture { StoneTex } } // East wall at X=TX2 box { , texture { StoneTex } } // Wall crenellations (simple blocks along top of each wall) union { // North object { CrenelsX(TX1+TowerR, TX2-TowerR, WallH, WallH+0.7, TZ1-0.001, TZ1+0.60, 16, 0.40) } // South object { CrenelsX(TX1+TowerR, TX2-TowerR, WallH, WallH+0.7, TZ2-0.60, TZ2+0.001, 16, 0.40) } // West object { CrenelsZ(TZ1+TowerR, TZ2-TowerR, WallH, WallH+0.7, TX1-0.001, TX1+0.60, 16, 0.40) } // East object { CrenelsZ(TZ1+TowerR, TZ2-TowerR, WallH, WallH+0.7, TX2-0.60, TX2+0.001, 16, 0.40) } texture { StoneTex } } // Gatehouse opening on north wall (toward camera; camera is at negative Z) // Build a small gatehouse block centered on Z=TZ1, protruding outward (negative Z) #declare GateW = 5.0; #declare GateD = 2.5; #declare GateH = 7.0; difference { // Gatehouse mass box { <-GateW/2, 0, TZ1-GateD>, } // Arch cut union { box { <-1.4, 0, TZ1-GateD-0.01>, <1.4, 3.4, TZ1+WallTh/2+0.02> } cylinder { <0, 3.4, TZ1-GateD-0.01>, <0, 3.4, TZ1+WallTh/2+0.02>, 1.4 rotate <0,0,90> } } texture { StoneTex } } // Wooden gate door (simple) box { <-1.28, 0.0, TZ1-GateD+0.12>, <1.28, 3.25, TZ1-GateD+0.24> texture { DarkWoodTex } } // Small flag on keep roof union { cylinder { <0, KeepH+0.6, 2.0>, <0, KeepH+4.6, 2.0>, 0.06 texture { DarkWoodTex } } triangle { <0, KeepH+4.2, 2.0>, <1.3, KeepH+3.9, 2.0>, <0, KeepH+3.6, 2.0> texture { pigment { color rgb <0.80, 0.15, 0.16> } finish { diffuse 0.9 specular 0.05 } } } } // Slight lift so it sits on hill nicely translate <0, 0.2, 0> } // --- Simple courtyard ground inside walls (stone/gravel feel) --- box { , texture { GroundStoneTex } }