// Detailed evening old-town cityscape with castle hill (fast iterative) // Inspired by provided videos (castle.mp4, old_town.mp4) // FULL corrected file (fixes reserved identifier 'x' and closes prisms) #version 3.7; global_settings { assumed_gamma 1.0 max_trace_level 8 } #include "colors.inc" // ---------- Helpers ---------- #macro frac(A) ( (A) - floor(A) ) #end // -------------------- Background / atmosphere -------------------- sky_sphere{ pigment{ gradient y color_map{ [0.00 color rgb <0.03,0.04,0.06>] [0.45 color rgb <0.07,0.08,0.11>] [1.00 color rgb <0.13,0.14,0.19>] } scale 1.2 } } fog { distance 95 color rgb <0.09, 0.10, 0.14> fog_type 2 fog_alt 2.2 turbulence 0.10 } // -------------------- Camera -------------------- camera { location <19.5, 11.0, -24.0> look_at <0.0, 4.0, 0.6> angle 40 } // -------------------- Lights (warm, soft shadows) -------------------- light_source { <0, 80, -45> color rgb <0.10, 0.12, 0.16> shadowless } light_source { <55, 68, -55> color rgb <0.30, 0.28, 0.26>*0.75 area_light <12,0,0>, <0,0,12>, 4, 4 adaptive 1 jitter } light_source { <-38, 54, -10> color rgb <0.26, 0.23, 0.20>*0.45 area_light <10,0,0>, <0,0,10>, 3, 3 adaptive 1 jitter } #macro ConeLight(Pos, Target, Col, Radius, Fall, Tight) light_source { Pos color Col spotlight point_at Target radius Radius falloff Fall tightness Tight } #end #declare WarmLamp = rgb <1.00, 0.80, 0.55>*1.25; // -------------------- Finishes (simple, fast) -------------------- #declare F_Wall = finish { diffuse 0.88 specular 0.05 roughness 0.10 ambient 0.01 }; #declare F_Stone = finish { diffuse 0.84 specular 0.07 roughness 0.07 ambient 0.008 }; #declare F_Roof = finish { diffuse 0.76 specular 0.10 roughness 0.06 ambient 0.008 }; #declare F_Ground = finish { diffuse 0.92 specular 0.04 roughness 0.12 ambient 0.005 }; #declare F_Metal = finish { diffuse 0.55 specular 0.20 roughness 0.05 ambient 0.01 }; // -------------------- Textures (procedural, no image maps) -------------------- #declare TX_Brick_Red = texture{ pigment{ average pigment_map{ [1 brick color rgb <0.56,0.22,0.18>, color rgb <0.72,0.72,0.70> brick_size <0.55, 0.25, 0.28> mortar 0.08 scale 0.85 ] [1 bozo color_map{ [0.00 rgb <0.96,0.92,0.90>] [0.55 rgb <1.00,0.98,0.96>] [1.00 rgb <0.92,0.88,0.86>] } scale 1.4 ] } } normal{ average normal_map{ [1 brick 0.55 brick_size <0.55,0.25,0.28> mortar 0.08 scale 0.85] [1 bumps 0.18 scale 0.22] } } finish { F_Wall } } #declare TX_Brick_Warm = texture{ pigment{ average pigment_map{ [1 brick color rgb <0.62,0.30,0.22>, color rgb <0.73,0.72,0.70> brick_size <0.56, 0.26, 0.30> mortar 0.075 scale 0.86 ] [1 bozo color_map{ [0.00 rgb <0.95,0.92,0.90>] [0.55 rgb <1.00,0.98,0.96>] [1.00 rgb <0.90,0.87,0.85>] } scale 1.5 ] } } normal{ average normal_map{ [1 brick 0.58 brick_size <0.56,0.26,0.30> mortar 0.075 scale 0.86] [1 bumps 0.16 scale 0.24] } } finish { F_Wall } } #declare TX_Brick_Dark = texture{ pigment{ average pigment_map{ [1 brick color rgb <0.38,0.20,0.18>, color rgb <0.62,0.62,0.60> brick_size <0.55, 0.25, 0.28> mortar 0.085 scale 0.84 ] [1 bozo color_map{ [0.00 rgb <0.94,0.94,0.94>] [0.55 rgb <1.00,1.00,1.00>] [1.00 rgb <0.90,0.90,0.90>] } scale 1.3 ] } } normal{ average normal_map{ [1 brick 0.60 brick_size <0.55,0.25,0.28> mortar 0.085 scale 0.84] [1 bumps 0.14 scale 0.24] } } finish { F_Wall } } #declare TX_Plaster = texture{ pigment{ bozo color_map{ [0.00 rgb <0.66,0.62,0.58>] [0.55 rgb <0.74,0.70,0.66>] [1.00 rgb <0.60,0.56,0.52>] } scale 0.7 } normal { bumps 0.25 scale 0.22 } finish { diffuse 0.90 specular 0.03 roughness 0.12 ambient 0.01 } } #declare TX_Roof_Red = texture{ pigment{ wrinkles color_map{ [0.00 rgb <0.34,0.12,0.12>] [0.55 rgb <0.43,0.16,0.14>] [1.00 rgb <0.52,0.20,0.18>] } scale <0.25,0.10,0.25> } normal { ripples 0.45 scale <0.25,0.08,0.25> } finish { F_Roof } } #declare TX_Roof_Brown = texture{ pigment{ wrinkles color_map{ [0.00 rgb <0.24,0.15,0.10>] [0.55 rgb <0.32,0.20,0.13>] [1.00 rgb <0.42,0.28,0.20>] } scale <0.28,0.12,0.28> } normal { ripples 0.42 scale <0.28,0.09,0.28> } finish { F_Roof } } #declare TX_AsphaltCobble = texture{ pigment{ bozo color_map{ [0.00 rgb <0.06,0.06,0.08>] [0.55 rgb <0.10,0.10,0.12>] [1.00 rgb <0.15,0.15,0.17>] } scale 0.7 } normal{ average normal_map{ [1 bumps 0.23 scale 0.20] [1 crackle 0.32 scale 0.38] } } finish { F_Ground } } #declare TX_Sidewalk = texture{ pigment{ granite color_map{ [0.00 rgb <0.16,0.16,0.18>] [0.65 rgb <0.20,0.20,0.22>] [1.00 rgb <0.26,0.26,0.28>] } scale 0.9 } normal{ granite 0.45 scale 0.25 } finish { diffuse 0.92 specular 0.04 roughness 0.10 ambient 0.005 } } #declare TX_Curb = texture{ pigment{ color rgb <0.18,0.18,0.20> } normal { bumps 0.20 scale 0.18 } finish { diffuse 0.92 specular 0.04 roughness 0.10 ambient 0.005 } } #declare TX_StoneTrim = texture{ pigment{ color rgb <0.58,0.56,0.54> } normal { bumps 0.18 scale 0.20 } finish { diffuse 0.88 specular 0.06 roughness 0.08 ambient 0.008 } } #declare TX_DoorWood = texture{ pigment{ wood color_map{ [0.0 rgb <0.22,0.14,0.09>] [0.5 rgb <0.30,0.18,0.12>] [1.0 rgb <0.18,0.11,0.07>] } scale <0.35,0.25,0.35> } normal { bumps 0.20 scale 0.10 } finish { diffuse 0.85 specular 0.10 roughness 0.06 ambient 0.01 } } // -------------------- Ground / street / plaza -------------------- plane { y, 0 texture { TX_AsphaltCobble } } #declare StreetW = 2.9; // Street band box { <-24, 0.001, -StreetW>, <24, 0.02, StreetW> texture { TX_AsphaltCobble } } // Sidewalks box { <-24, 0.02, -StreetW-1.25>, <24, 0.08, -StreetW-0.30> texture{TX_Sidewalk} } box { <-24, 0.02, StreetW+0.30>, <24, 0.08, StreetW+1.25> texture{TX_Sidewalk} } // Curbs box { <-24, 0.02, -StreetW-0.30>, <24, 0.10, -StreetW> texture{TX_Curb} } box { <-24, 0.02, StreetW>, <24, 0.10, StreetW+0.30> texture{TX_Curb} } // Small plaza / square (foreground right) box { <6.5, 0.021, -1.8>, <14.8, 0.07, 5.2> texture{TX_Sidewalk} } box { <6.5, 0.019, -1.8>, <14.8, 0.021, 5.2> texture{TX_AsphaltCobble} } // thin border seam // Crosswalk hint #declare TX_Cross = texture{ pigment{ color rgb <0.70,0.70,0.72> } finish { diffuse 0.80 specular 0.02 roughness 0.12 ambient 0.005 } } #declare cx = -2.2; #declare cz0 = -0.35; #declare k=0; #while (k<6) box{ , texture{TX_Cross} } #declare k = k+1; #end // -------------------- Building primitives -------------------- #macro Tower(R, H, CapH, WallTex, CapTex, BaseLift) union { cylinder { <0,BaseLift,0>, <0,BaseLift+H,0>, R texture { WallTex } } cone { <0,BaseLift+H,0>, R*1.05, <0,BaseLift+H+CapH,0>, 0 texture { CapTex } } } #end #macro Dormer(DW, DD, DH, RoofTex, TrimTex, BaseY) union{ box{ <-DW/2, BaseY, -DD/2>, texture{TrimTex} } prism{ linear_sweep linear_spline -DD/2, DD/2, 4, <-DW/2, BaseY+DH>, < 0.0, BaseY+DH+DH*0.65>, < DW/2, BaseY+DH>, <-DW/2, BaseY+DH> // close texture{RoofTex} } } #end #macro Chimney(W,D,H, Tex) union{ box{ <-W/2,0,-D/2>, texture{Tex} } box{ <-W/2-0.06,H,-D/2-0.06>, texture{Tex} } } #end #macro Awning(AW, AD, AY, ColTex) union{ box{ <-AW/2, AY, -AD>, texture{ColTex} } // small lip box{ <-AW/2, AY-0.02, -AD-0.03>, texture{ColTex} } } #end #macro HouseDetailed(W, D, H, RoofH, WallTex, RoofTex, BaseLift, TrimTex, Seed) union { // main body box { <-W/2, BaseLift, -D/2>, texture { WallTex } } // subtle base plinth box { <-W/2-0.06, BaseLift, -D/2-0.06>, texture { TrimTex } } // cornice band box { <-W/2-0.05, BaseLift+H-0.14, -D/2-0.05>, texture { TrimTex } } // pitched roof prism along Z (explicitly closed) prism { linear_sweep linear_spline -D/2, D/2, 4, <-W/2, BaseLift+H>, < 0, BaseLift+H+RoofH>, < W/2, BaseLift+H>, <-W/2, BaseLift+H> // close texture { RoofTex } } // dormers (slightly varied) object{ Dormer(W*0.22, D*0.18, RoofH*0.42, RoofTex, TrimTex, BaseLift+H+RoofH*0.05) translate <-W*0.22, 0, -D*0.15> } object{ Dormer(W*0.18, D*0.16, RoofH*0.38, RoofTex, TrimTex, BaseLift+H+RoofH*0.05) translate < W*0.20, 0, D*0.18> } // chimneys (2, varied by seed) object{ Chimney(0.34,0.34,0.95, TrimTex) translate } #if (frac(sin(Seed*9.13)*431.1) < 0.55) object{ Chimney(0.30,0.30,0.78, TrimTex) translate <-W*0.22, BaseLift+H+RoofH*0.52, D*0.18> } #end } #end // -------------------- Windows & doors -------------------- #declare TX_WindowGlow = texture{ pigment { color rgb <1.0,0.78,0.52>*0.95 } finish { diffuse 0.18 ambient 0.88 specular 0.0 } } #declare TX_WindowDim = texture{ pigment { color rgb <1.0,0.76,0.52>*0.35 } finish { diffuse 0.25 ambient 0.45 specular 0.0 } } #declare TX_WindowOff = texture{ pigment { color rgb <0.10,0.11,0.14> } finish { diffuse 0.70 ambient 0.10 specular 0.05 roughness 0.10 } } #macro FacadeWindows(W, D, H, BaseLift, Seed) #local WY0 = BaseLift + 0.95; #local FloorStep = 1.05; #local WW = 0.30; #local WH = 0.44; union{ // front face at -Z #local fy = 0; #while (WY0 + fy*FloorStep < BaseLift + H - 0.8) #local fx = 0; #while (fx < 4) #local wx = -W*0.40 + fx*(W*0.27); // FIX: do not use reserved identifier x #local y0 = WY0 + fy*FloorStep; #local r = frac(sin((Seed+fx*12+fy*33)*14.3)*43758.5453); #local TTex = TX_WindowOff; #if (r < 0.30) #local TTex = TX_WindowGlow; #end #if (r >= 0.30 & r < 0.48) #local TTex = TX_WindowDim; #end // window recess frame box{ , texture{TX_StoneTrim} } // glass box{ , texture{TTex} } // occasional tiny awning (adds “video” storefront vibe) #if (fy=0) #if (r < 0.18) object{ Awning(WW+0.12, 0.26, y0+WH+0.03, texture{ pigment{color rgb<0.22,0.18,0.18>} finish{diffuse 0.85 specular 0.03 roughness 0.10 ambient 0.01}}) translate } #end #end #local fx = fx+1; #end #local fy = fy+1; #end // door box{ <-0.32, BaseLift, -D/2-0.020>, < 0.32, BaseLift+0.85, -D/2-0.0009> texture{TX_StoneTrim} } box{ <-0.26, BaseLift+0.06, -D/2-0.0016>, < 0.26, BaseLift+0.80, -D/2-0.0010> texture{TX_DoorWood} } } #end // -------------------- Town block layout -------------------- #declare b0 = 0.00; #declare b1 = 0.04; #declare b2 = 0.08; // Front row (staggered, alley gaps) union{ object { HouseDetailed(3.6, 2.9, 3.3, 1.45, TX_Brick_Red, TX_Roof_Red, b0, TX_StoneTrim, 1) } object { FacadeWindows(3.6,2.9,3.3,b0, 1) } translate <-9.0,0,-6.7> } union{ object { HouseDetailed(2.9, 2.8, 3.9, 1.65, TX_Plaster, TX_Roof_Brown, b1, TX_StoneTrim, 2) } object { FacadeWindows(2.9,2.8,3.9,b1, 2) } translate <-5.2,0,-6.8> } union{ object { HouseDetailed(4.2, 3.3, 3.6, 1.55, TX_Brick_Warm, TX_Roof_Red, b0, TX_StoneTrim, 3) } object { FacadeWindows(4.2,3.3,3.6,b0, 3) } translate < 0.2,0,-6.7> } union{ object { HouseDetailed(3.1, 2.9, 4.4, 1.80, TX_Brick_Dark, TX_Roof_Brown, b2, TX_StoneTrim, 4) } object { FacadeWindows(3.1,2.9,4.4,b2, 4) } translate < 4.3,0,-6.9> } union{ object { HouseDetailed(3.9, 3.1, 3.2, 1.35, TX_Plaster, TX_Roof_Red, b1, TX_StoneTrim, 5) } object { FacadeWindows(3.9,3.1,3.2,b1, 5) } translate < 9.0,0,-6.7> } // Second row union{ object { HouseDetailed(3.5, 3.1, 4.2, 1.55, TX_Brick_Dark, TX_Roof_Red, b1, TX_StoneTrim, 6) } object { FacadeWindows(3.5,3.1,4.2,b1, 6) } rotate <0, 8,0> translate <-9.1,0,-2.5> } union{ object { HouseDetailed(4.1, 3.5, 4.9, 1.85, TX_Brick_Red, TX_Roof_Brown, b0, TX_StoneTrim, 7) } object { FacadeWindows(4.1,3.5,4.9,b0, 7) } rotate <0,-6,0> translate <-4.5,0,-2.4> } union{ object { HouseDetailed(4.4, 3.6, 4.5, 1.75, TX_Plaster, TX_Roof_Red, b2, TX_StoneTrim, 8) } object { FacadeWindows(4.4,3.6,4.5,b2, 8) } rotate <0, 4,0> translate < 0.3,0,-2.3> } union{ object { HouseDetailed(3.3, 3.0, 5.0, 1.95, TX_Brick_Warm, TX_Roof_Brown, b1, TX_StoneTrim, 9) } object { FacadeWindows(3.3,3.0,5.0,b1, 9) } rotate <0,-7,0> translate < 4.6,0,-2.5> } union{ object { HouseDetailed(3.7, 3.2, 4.2, 1.65, TX_Brick_Dark, TX_Roof_Red, b0, TX_StoneTrim, 10) } object { FacadeWindows(3.7,3.2,4.2,b0,10) } rotate <0, 6,0> translate < 9.2,0,-2.4> } // Back row union{ object { HouseDetailed(3.2, 3.1, 5.2, 2.05, TX_Plaster, TX_Roof_Red, b2, TX_StoneTrim, 11) } object { FacadeWindows(3.2,3.1,5.2,b2,11) } rotate <0,-8,0> translate <-9.0,0, 1.8> } union{ object { HouseDetailed(3.9, 3.7, 5.6, 2.20, TX_Brick_Dark, TX_Roof_Brown, b1, TX_StoneTrim, 12) } object { FacadeWindows(3.9,3.7,5.6,b1,12) } rotate <0, 5,0> translate <-4.5,0, 1.7> } union{ object { HouseDetailed(4.7, 3.9, 6.0, 2.30, TX_Brick_Red, TX_Roof_Red, b0, TX_StoneTrim, 13) } object { FacadeWindows(4.7,3.9,6.0,b0,13) } rotate <0,-4,0> translate < 0.1,0, 1.9> } union{ object { HouseDetailed(3.5, 3.2, 5.3, 2.05, TX_Brick_Warm, TX_Roof_Brown, b2, TX_StoneTrim, 14) } object { FacadeWindows(3.5,3.2,5.3,b2,14) } rotate <0, 7,0> translate < 4.6,0, 1.8> } union{ object { HouseDetailed(4.0, 3.8, 5.5, 2.15, TX_Plaster, TX_Roof_Red, b1, TX_StoneTrim, 15) } object { FacadeWindows(4.0,3.8,5.5,b1,15) } rotate <0,-6,0> translate < 9.3,0, 1.7> } // Narrow side buildings to frame street (left/right) union{ object{ HouseDetailed(2.0, 3.8, 4.2, 1.65, TX_Brick_Dark, TX_Roof_Brown, 0.00, TX_StoneTrim, 21) } object{ FacadeWindows(2.0,3.8,4.2,0.00,21) } rotate <0, 90,0> translate <-13.6,0,-1.8> } union{ object{ HouseDetailed(2.3, 4.2, 4.6, 1.75, TX_Brick_Warm, TX_Roof_Red, 0.02, TX_StoneTrim, 22) } object{ FacadeWindows(2.3,4.2,4.6,0.02,22) } rotate <0,-90,0> translate < 13.8,0,-0.6> } // Old-town towers (historic brick towers) object { Tower(0.66, 7.9, 2.3, TX_Brick_Dark, TX_Roof_Red, 0.00) translate <-2.8,0,-4.6> } object { Tower(0.56, 6.7, 2.1, TX_Brick_Dark, TX_Roof_Brown, 0.00) translate < 6.9,0,-1.0> } // -------------------- Street props (more detail) -------------------- #declare TX_Iron = texture{ pigment{ color rgb<0.10,0.10,0.12> } finish{ F_Metal } } #macro LampPost(P) union{ cylinder { P, P+<0,1.55,0>, 0.06 texture{TX_Iron} } cylinder { P+<0,1.55,0>, P+<0,1.85,0>, 0.04 texture{TX_Iron} } sphere { P+<0,1.92,0>, 0.11 pigment{color rgb<0.20,0.18,0.16>} finish{ diffuse 0.5 specular 0.12 roughness 0.06 ambient 0.28 } } } #end #macro Bollard(P) union{ cylinder{ P, P+<0,0.55,0>, 0.09 texture{TX_Iron} } sphere{ P+<0,0.60,0>, 0.10 texture{TX_Iron} } } #end #macro Bench(P, Yaw) union{ box{ <-0.55,0.34,-0.16>, <0.55,0.40,0.16> texture{TX_DoorWood} } box{ <-0.55,0.22,-0.16>, <0.55,0.28,0.16> texture{TX_DoorWood} } cylinder{ <-0.48,0,-0.14>, <-0.48,0.34,-0.14>, 0.04 texture{TX_Iron} } cylinder{ < 0.48,0,-0.14>, < 0.48,0.34,-0.14>, 0.04 texture{TX_Iron} } cylinder{ <-0.48,0, 0.14>, <-0.48,0.34, 0.14>, 0.04 texture{TX_Iron} } cylinder{ < 0.48,0, 0.14>, < 0.48,0.34, 0.14>, 0.04 texture{TX_Iron} } rotate <0,Yaw,0> translate P } #end #macro TreeSimple(P, S) union{ cylinder{ <0,0,0>, <0,1.4*S,0>, 0.12*S pigment{color rgb<0.16,0.11,0.08>} finish{diffuse 0.85 specular 0.03 roughness 0.12 ambient 0.01} } sphere{ <0,2.0*S,0>, 0.75*S pigment{color rgb<0.10,0.17,0.12>} finish{diffuse 0.90 specular 0.02 roughness 0.15 ambient 0.01} } sphere{ <0.35*S,1.85*S,0.20*S>, 0.55*S pigment{color rgb<0.10,0.16,0.11>} finish{diffuse 0.90 specular 0.02 roughness 0.15 ambient 0.01} } sphere{ <-0.35*S,2.10*S,-0.18*S>, 0.60*S pigment{color rgb<0.09,0.15,0.10>} finish{diffuse 0.90 specular 0.02 roughness 0.15 ambient 0.01} } translate P } #end // Lamps #declare L1 = <-11.0, 0, 0.0>; #declare L2 = <-5.0, 0, 0.0>; #declare L3 = < 1.2, 0, 0.0>; #declare L4 = < 7.4, 0, 0.0>; #declare L5 = < 12.5, 0, 1.8>; // plaza object { LampPost(L1) } object { LampPost(L2) } object { LampPost(L3) } object { LampPost(L4) } object { LampPost(L5) } ConeLight(L1+<0,2.0,0>, L1+<0,0.0,0>, WarmLamp, 18, 34, 18) ConeLight(L2+<0,2.0,0>, L2+<0,0.0,0>, WarmLamp, 18, 34, 18) ConeLight(L3+<0,2.0,0>, L3+<0,0.0,0>, WarmLamp, 18, 34, 18) ConeLight(L4+<0,2.0,0>, L4+<0,0.0,0>, WarmLamp, 18, 34, 18) ConeLight(L5+<0,2.0,0>, L5+<0,0.0,0>, WarmLamp, 18, 34, 18) // Bollards near plaza edge #declare bi=0; #while (bi<7) object{ Bollard(<6.9 + bi*1.12, 0.08, 0.15>) } #declare bi=bi+1; #end // Benches + trees in plaza (adds lived-in detail) object{ Bench(<10.0,0.08, 4.6>, 180) } object{ Bench(<13.3,0.08, 0.2>, 90) } object{ TreeSimple(<8.0,0.08, 3.6>, 0.95) } object{ TreeSimple(<14.0,0.08, 4.2>, 0.80) } // Small fountain in plaza union{ cylinder{ <11.2,0.08,1.9>, <11.2,0.22,1.9>, 0.85 texture{TX_StoneTrim} } cylinder{ <11.2,0.22,1.9>, <11.2,0.40,1.9>, 0.55 texture{TX_StoneTrim} } sphere{ <11.2,0.48,1.9>, 0.14 pigment{color rgb<0.45,0.46,0.50>} finish{diffuse 0.75 specular 0.15 roughness 0.05 ambient 0.01} } // water hint cylinder{ <11.2,0.225,1.9>, <11.2,0.235,1.9>, 0.53 pigment{color rgb<0.10,0.14,0.18>} finish{diffuse 0.25 specular 0.20 roughness 0.04 ambient 0.10} } } // Warm façade spotlights ConeLight(<-14, 6.7, -12>, <-6.0, 2.8, -6.5>, rgb<1.0,0.82,0.60>*0.85, 16, 26, 20) ConeLight(< 14, 7.3, -12>, < 6.0, 3.0, -6.5>, rgb<1.0,0.82,0.60>*0.80, 16, 26, 20) ConeLight(< 0.0, 7.2, -10>, < 0.2, 3.2, -6.6>, rgb<1.0,0.82,0.60>*0.55, 14, 22, 16) // -------------------- Distant hill + castle (more complex) -------------------- difference { sphere { <0, -31, 29>, 41 } plane { y, 0 inverse } texture{ pigment{ bozo color_map{ [0.00 rgb <0.10,0.15,0.13>] [0.60 rgb <0.16,0.20,0.18>] [1.00 rgb <0.08,0.11,0.10>] } scale 2.3 } normal { bumps 0.38 scale 0.95 } finish { diffuse 0.95 specular 0.01 roughness 0.18 ambient 0.01 } } } // Castle materials #declare TX_CastleStone = texture{ pigment{ granite color_map{ [0.00 rgb <0.19,0.20,0.22>] [0.55 rgb <0.26,0.27,0.30>] [1.00 rgb <0.35,0.36,0.39>] } scale 0.9 } normal { granite 0.75 scale 0.33 } finish { diffuse 0.80 specular 0.07 roughness 0.06 ambient 0.005 } } #declare TX_CastleRoof = texture{ pigment{ wrinkles color_map{ [0.00 rgb <0.10,0.10,0.12>] [0.60 rgb <0.14,0.14,0.16>] [1.00 rgb <0.18,0.18,0.20>] } scale <0.32,0.12,0.32> } normal { ripples 0.30 scale <0.32,0.10,0.32> } finish { diffuse 0.70 specular 0.10 roughness 0.05 ambient 0.005 } } // Retaining wall / terrace around castle base #declare CastleBaseZ = 22.8; #declare CastleRotY = 12; // Battlement macro #macro Battlements(Len, Height, Thick, Count, Tex) union{ box{ <-Len/2,0,-Thick/2>, texture{Tex} } #local i=0; #while (i, <-Len/2 + i*(Len/Count) + (Len/Count)*0.50, Height+0.35, Thick/2> texture{Tex} } #declare i=i+1; #end } #end // Terrace + a small wall segment with arch (more silhouette detail) union{ difference{ cylinder{ <0,0,CastleBaseZ>, <0,1.6,CastleBaseZ>, 7.2 texture{TX_CastleStone} } cylinder{ <0,-0.2,CastleBaseZ>, <0,1.9,CastleBaseZ>, 5.7 texture{TX_CastleStone} } rotate <0, CastleRotY, 0> } // simple wall union{ box{ <-3.2,1.6,CastleBaseZ-7.2>, <3.2,3.2,CastleBaseZ-6.6> texture{TX_CastleStone} } // arch cut difference{ box{ <-1.3,1.6,CastleBaseZ-7.21>, <1.3,3.05,CastleBaseZ-6.59> texture{TX_CastleStone} } cylinder{ <0,2.25,CastleBaseZ-7.30>, <0,2.25,CastleBaseZ-6.50>, 0.72 } } // battlement top object{ Battlements(6.4, 0.50, 0.70, 9, TX_CastleStone) translate <0,3.2,CastleBaseZ-6.9> } } rotate <0, CastleRotY, 0> } // Castle group union { // main keep (tiered) box { <-2.6, 0.0, -1.9>, < 2.6, 5.2, 1.9> texture { TX_CastleStone } } box { <-1.6, 5.2, -1.2>, < 1.6, 7.2, 1.2> texture { TX_CastleStone } } // side wings box { <-5.4, 0.0, -1.3>, <-2.8, 3.4, 1.3> texture { TX_CastleStone } } box { < 2.8, 0.0, -1.3>, < 5.4, 3.4, 1.3> texture { TX_CastleStone } } // battlements on keep top object{ Battlements(5.4, 0.55, 3.9, 10, TX_CastleStone) translate <0, 7.2, 0> } // corner towers object { Tower(0.74, 5.9, 2.05, TX_CastleStone, TX_CastleRoof, 0.0) translate <-5.1,0,-1.2> } object { Tower(0.74, 5.9, 2.05, TX_CastleStone, TX_CastleRoof, 0.0) translate <-5.1,0, 1.2> } object { Tower(0.74, 5.9, 2.05, TX_CastleStone, TX_CastleRoof, 0.0) translate < 5.1,0,-1.2> } object { Tower(0.74, 5.9, 2.05, TX_CastleStone, TX_CastleRoof, 0.0) translate < 5.1,0, 1.2> } // central roof (closed) prism { linear_sweep linear_spline -1.9, 1.9, 4, <-2.6, 5.2>, < 0.0, 6.9>, < 2.6, 5.2>, <-2.6, 5.2> // close texture { TX_CastleRoof } } // windows glow on castle box{ <-0.25, 2.1, -1.92>, <0.05, 2.55, -1.90> texture{TX_WindowDim} } box{ < 0.35, 2.4, -1.92>, <0.65, 2.80, -1.90> texture{TX_WindowGlow} } box{ <-1.55, 1.65, 1.90>, <-1.20, 2.05, 1.92> texture{TX_WindowDim} } scale <1.18,1.18,1.18> rotate <0, CastleRotY, 0> translate <0, 0.0, CastleBaseZ> } // Rim light to separate castle from hill ConeLight(<-6.5, 15.0, 10.5>, <0, 5.0, CastleBaseZ>, rgb<1.0,0.75,0.55>*0.26, 10, 18, 8)