// Neat European-style castle in summer (fast, simple shading) - corrected #version 3.7; global_settings { assumed_gamma 2.4 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.60, 0.82, 1.00> } // summer sky // --- Camera --- camera { location <5, 15.0, -53.0> look_at <0, 5.2, 0.0> angle 38 up <0,9,0> right <16,0,0> // right,up -> 16:9 } // --- Warm soft lights --- light_source { <0, 0, -9> color rgb <1.00, 1.00, 1.00>*0.2 //area_light <6,0,0>, <0,0,6>, 5, 5 adaptive 1 jitter } light_source { <40, 55, -35> color rgb <1.00, 1.00, 1.00>*0.3 //area_light <6,0,0>, <0,0,6>, 5, 5 adaptive 1 jitter } light_source { <-30, 25, -10> color rgb <1.00, 0.93, 0.85>*0.35 //area_light <4,0,0>, <0,0,4>, 4, 4 adaptive 1 jitter } // --- Simple materials (no textures) --- #declare StoneFinish = finish { diffuse 0.75 specular 0.08 roughness 0.08 }; #declare StonePig = pigment { color rgb <0.78, 0.78, 0.74> }; #declare RoofPig = pigment { color rgb <0.38, 0.18, 0.12> }; #declare WoodPig = pigment { color rgb <0.30, 0.18, 0.10> }; #declare DarkPig = pigment { color rgb <0.10, 0.10, 0.11> }; #declare StoneTex = texture { pigment { // blocky stone feel using a crackle pattern, slightly varied color brick color <0.62,0.62,0.59> color rgb <0.74,0.74,0.70> brick_size <0.25,0.25,0.50> mortar 0.03 //scale 1.15 } normal { // subtle chiseled roughness bumps 0.35 scale 0.22 } finish { StoneFinish } } //#declare WoodTex = texture { WoodPig finish { diffuse 0.70 specular 0.05 roughness 0.12 } } #declare WoodTex = texture { pigment { // simple wood grain wood color_map { [0.00 color rgb <0.22,0.13,0.07>] [0.45 color rgb <0.33,0.20,0.10>] [1.00 color rgb <0.18,0.10,0.05>] } turbulence 0.15 scale 0.38 rotate <0,90,0> } normal { bumps 0.25 scale 0.08 } finish { diffuse 0.75 specular 0.06 roughness 0.10 } } #declare DarkTex = texture { DarkPig finish { diffuse 0.6 specular 0.02 roughness 0.20 } } //#declare RoofTex = texture { RoofPig finish { diffuse 0.75 specular 0.06 roughness 0.10 } } #declare RoofTex = texture { pigment { // warm clay tiles with gentle variation granite color_map { [0.00 color rgb <0.26,0.10,0.08>] [0.40 color rgb <0.38,0.16,0.11>] [0.75 color rgb <0.52,0.24,0.16>] [1.00 color rgb <0.34,0.14,0.10>] } scale 0.55 } normal { ripples 0.22 scale 0.15 } finish { diffuse 0.78 specular 0.10 roughness 0.07 } } // --- Ground (summer) --- plane { y, 0 texture { pigment { bozo color_map { [0.0 color rgb <0.10, 0.18, 0.10>] [0.6 color rgb <0.14, 0.14, 0.12>] [1.0 color rgb <0.10, 0.10, 0.16>] } scale 1.9 } finish { diffuse 0.85 specular 0.02 roughness 0.25 } } } // --- Castle dimensions --- #declare BaseY0 = 0.0; #declare WallH = 6.0; // --- Main castle union --- union { // --- Outer curtain wall (hollow box) --- difference { box { <-9, BaseY0, -7>, < 9, BaseY0+WallH, 7> } box { <-8, BaseY0-0.01, -6>, < 8, BaseY0+WallH-0.8, 6> } // front gate opening box { <-1.4, BaseY0, -7.2>, <1.4, BaseY0+3.2, -5.9> } texture { StoneTex } } // --- Wall crenellations (simple blocks along top edges) --- union { #declare Step = 1.6; // front edge #declare X = -8.2; #while (X <= 8.2) box { , } #declare X = X + Step; #end // back edge #declare X2 = -8.2; #while (X2 <= 8.2) box { , } #declare X2 = X2 + Step; #end // left edge #declare Z = -5.6; #while (Z <= 5.6) box { <-9.0, BaseY0+WallH, Z>, <-8.2, BaseY0+WallH+1.0, Z+0.8> } #declare Z = Z + Step; #end // right edge #declare Z2 = -5.6; #while (Z2 <= 5.6) box { <8.2, BaseY0+WallH, Z2>, <9.0, BaseY0+WallH+1.0, Z2+0.8> } #declare Z2 = Z2 + Step; #end texture { StoneTex } } // --- Corner towers (cylinders) --- #declare TowerR = 2.1; #declare TowerH = 9.0; union { cylinder { <-9, BaseY0, -7>, <-9, BaseY0+TowerH, -7>, TowerR } cylinder { < 9, BaseY0, -7>, < 9, BaseY0+TowerH, -7>, TowerR } cylinder { <-9, BaseY0, 7>, <-9, BaseY0+TowerH, 7>, TowerR } cylinder { < 9, BaseY0, 7>, < 9, BaseY0+TowerH, 7>, TowerR } texture { StoneTex } } // --- Tower caps (simple conical roofs) --- union { cone { <-9, BaseY0+TowerH, -7>, TowerR+0.1, <-9, BaseY0+TowerH+2.4, -7>, 0.2 } cone { < 9, BaseY0+TowerH, -7>, TowerR+0.1, < 9, BaseY0+TowerH+2.4, -7>, 0.2 } cone { <-9, BaseY0+TowerH, 7>, TowerR+0.1, <-9, BaseY0+TowerH+2.4, 7>, 0.2 } cone { < 9, BaseY0+TowerH, 7>, TowerR+0.1, < 9, BaseY0+TowerH+2.4, 7>, 0.2 } texture { RoofTex } } // --- Central keep --- #declare KeepW = 7.0; #declare KeepD = 5.0; #declare KeepH = 10.5; difference { box { <-KeepW/2, BaseY0, -KeepD/2>, } // simple slit windows (front and sides) #declare WY0 = BaseY0+3.0; #declare WY1 = BaseY0+4.6; // front slits box { <-2.8, WY0, -KeepD/2-0.2>, <-2.4, WY1, -KeepD/2+0.4> } box { < 2.4, WY0, -KeepD/2-0.2>, < 2.8, WY1, -KeepD/2+0.4> } // side slits (FIXED: must be vectors) box { <-KeepW/2-0.2, WY0, -1.4>, <-KeepW/2+0.4, WY1, -1.0> } box { < KeepW/2-0.4, WY0, 1.0>, < KeepW/2+0.2, WY1, 1.4> } // higher slit #declare WY2 = BaseY0+6.3; #declare WY3 = BaseY0+7.9; box { <-0.2, WY2, -KeepD/2-0.2>, <0.2, WY3, -KeepD/2+0.4> } texture { StoneTex } } // Keep crenellations union { #declare S = 1.2; // front #declare KX = -KeepW/2; #while (KX <= KeepW/2-0.6) box { , } #declare KX = KX + S; #end // back #declare KX2 = -KeepW/2; #while (KX2 <= KeepW/2-0.6) box { , } #declare KX2 = KX2 + S; #end // left #declare KZ = -KeepD/2; #while (KZ <= KeepD/2-0.6) box { <-KeepW/2, BaseY0+KeepH, KZ>, <-KeepW/2+0.6, BaseY0+KeepH+1.0, KZ+0.6> } #declare KZ = KZ + S; #end // right #declare KZ2 = -KeepD/2; #while (KZ2 <= KeepD/2-0.6) box { , } #declare KZ2 = KZ2 + S; #end texture { StoneTex } } // --- Gatehouse block (front) with wooden door inset --- union { difference { box { <-3.2, BaseY0, -8.6>, <3.2, BaseY0+5.0, -6.2> } // door recess box { <-1.2, BaseY0, -8.7>, <1.2, BaseY0+3.0, -7.6> } texture { StoneTex } } // wooden door slab (fits in recess) box { <-1.15, BaseY0, 1.65>, <1.15, BaseY0+2.95, -7.62> texture { WoodTex } } // small gatehouse crenels #declare GX = -3.0; #while (GX <= 2.4) box { , } #declare GX = GX + 1.2; #end texture { StoneTex } } // --- Courtyard dark interior hint (simple slab) --- box { <-7.7, BaseY0+0.02, -5.7>, <7.7, BaseY0+0.04, 5.7> texture { DarkTex } } // Lift the whole castle slightly above ground to avoid z-fighting translate <0, 0.001, 0> } // --- Subtle distant haze/fog for summer softness (kept light for speed) --- fog { distance 120 color rgb <0.60, 0.82, 1.00> fog_type 2 fog_offset 0.0 fog_alt 18 turbulence 0.0 }