// Textured evening old-town cityscape with castle hill #version 3.7; global_settings { assumed_gamma 1.0 max_trace_level 8 } #include "colors.inc" // -------------------- Background / atmosphere -------------------- background { color rgb <0.10, 0.12, 0.18> } fog { distance 85 color rgb <0.10, 0.12, 0.18> fog_type 2 fog_alt 2.2 turbulence 0.15 } // -------------------- Camera -------------------- camera { location <18, 11.2, -22> look_at <0, 4.2, 0> angle 42 } // -------------------- Lights (warm, soft shadows) -------------------- // Cool sky fill (shadowless) light_source { <0, 70, -30> color rgb <0.10, 0.14, 0.20> shadowless } // Soft sky key light_source { <55, 65, -40> color rgb <0.22, 0.26, 0.34>*0.75 area_light <10,0,0>, <0,0,10>, 4, 4 adaptive 1 jitter } // Warm conical street/spot lights #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.2; // -------------------- Fast materials (procedural textures) -------------------- #declare F_Wall = finish { diffuse 0.85 specular 0.06 roughness 0.08 ambient 0.01 }; #declare F_Stone = finish { diffuse 0.82 specular 0.08 roughness 0.06 ambient 0.01 }; #declare F_Roof = finish { diffuse 0.75 specular 0.10 roughness 0.05 ambient 0.01 }; #declare F_Ground= finish { diffuse 0.90 specular 0.05 roughness 0.10 ambient 0.005 }; #declare F_Metal = finish { diffuse 0.55 specular 0.20 roughness 0.05 ambient 0.01 }; #declare TX_Plaster = texture{ pigment{ average pigment_map{ [1 color rgb <0.62,0.60,0.56>] [1 bozo color_map{ [0.00 rgb <0.58,0.56,0.52>] [0.55 rgb <0.64,0.62,0.58>] [1.00 rgb <0.68,0.66,0.62>] } scale 0.7 ] } } normal { bumps 0.35 scale 0.25 } finish { F_Wall } } #declare TX_Plaster_Green = texture{ pigment{ average pigment_map{ [1 color rgb <0.56,0.58,0.55>] [1 bozo color_map{ [0.00 rgb <0.50,0.54,0.50>] [0.55 rgb <0.58,0.61,0.57>] [1.00 rgb <0.64,0.66,0.62>] } scale 0.8 ] } } normal { bumps 0.32 scale 0.25 } finish { F_Wall } } #declare TX_Plaster_Warm = texture{ pigment{ average pigment_map{ [1 color rgb <0.60,0.54,0.48>] [1 bozo color_map{ [0.00 rgb <0.54,0.48,0.43>] [0.55 rgb <0.62,0.56,0.50>] [1.00 rgb <0.68,0.61,0.55>] } scale 0.85 ] } } normal { bumps 0.33 scale 0.25 } finish { F_Wall } } #declare TX_Stone = texture{ pigment{ granite color_map{ [0.00 rgb <0.33,0.34,0.36>] [0.45 rgb <0.28,0.29,0.31>] [1.00 rgb <0.40,0.41,0.44>] } scale 0.9 } normal { granite 0.65 scale 0.35 } finish { F_Stone } } #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.07,0.07,0.09>] [0.55 rgb <0.10,0.10,0.12>] [1.00 rgb <0.14,0.14,0.16>] } scale 0.65 } normal{ average normal_map{ [1 bumps 0.25 scale 0.20] [1 crackle 0.35 scale 0.35] } } finish { F_Ground } } // -------------------- Ground + street -------------------- plane { y, 0 texture { TX_AsphaltCobble } } #declare StreetW = 2.8; box { <-20, 0.001, -StreetW>, <20, 0.02, StreetW> texture { TX_AsphaltCobble } } // -------------------- Modular buildings (textured) -------------------- #macro House(W, D, H, RoofH, WallTex, RoofTex) union { box { <-W/2, 0, -D/2>, texture { WallTex } } // pitched roof prism along Z prism { linear_sweep linear_spline -D/2, D/2, 3, <-W/2, H>, < 0, H+RoofH>, < W/2, H> texture { RoofTex } } } #end #macro Tower(R, H, CapH, WallTex, CapTex) union { cylinder { <0,0,0>, <0,H,0>, R texture { WallTex } } cone { <0,H,0>, R*1.05, <0,H+CapH,0>, 0 texture { CapTex } } } #end // -------------------- Window hints (simple emissive rectangles) -------------------- #macro WindowsOnBox(W, D, H, Seed) #local WY = 1.2; #local WW = 0.28; #local WH = 0.38; #local Glow = texture { pigment { color rgb <1.0,0.78,0.52>*0.9 } finish { diffuse 0.2 ambient 0.85 specular 0.0 } }; union{ // front ( -Z ) #local i=0; #while (i<3) box{ <-W*0.30 + i*(W*0.30), WY, -D/2-0.001>, <-W*0.30 + i*(W*0.30) + WW, WY+WH, -D/2-0.0005> texture{Glow} } #local i=i+1; #end // back ( +Z ) dimmer box{ < -W*0.18, WY+0.2, D/2+0.0005>, < -W*0.18+WW, WY+0.2+WH, D/2+0.001> texture{ pigment{color rgb <1.0,0.75,0.50>*0.35} finish { diffuse 0.2 ambient 0.45 } } } } #end // -------------------- Town block layout -------------------- // Row 1 (front) union{ object { House(3.6, 2.8, 3.2, 1.4, TX_Plaster, TX_Roof_Red) } WindowsOnBox(3.6,2.8,3.2, 1) translate <-8.4,0,-6.5> } union{ object { House(3.0, 3.0, 3.8, 1.6, TX_Plaster_Green, TX_Roof_Brown) } WindowsOnBox(3.0,3.0,3.8, 2) translate <-4.2,0,-6.7> } union{ object { House(4.0, 3.2, 3.5, 1.5, TX_Plaster_Warm, TX_Roof_Red) } WindowsOnBox(4.0,3.2,3.5, 3) translate < 0.0,0,-6.6> } union{ object { House(3.2, 2.9, 4.2, 1.7, TX_Plaster_Green, TX_Roof_Brown) } WindowsOnBox(3.2,2.9,4.2, 4) translate < 4.3,0,-6.7> } union{ object { House(3.8, 3.1, 3.1, 1.3, TX_Plaster, TX_Roof_Red) } WindowsOnBox(3.8,3.1,3.1, 5) translate < 8.5,0,-6.6> } // Row 2 union{ object { House(3.4, 3.0, 4.0, 1.5, TX_Plaster_Green, TX_Roof_Red) } WindowsOnBox(3.4,3.0,4.0, 6) rotate <0, 8,0> translate <-8.5,0,-2.5> } union{ object { House(3.9, 3.3, 4.6, 1.8, TX_Plaster, TX_Roof_Brown) } WindowsOnBox(3.9,3.3,4.6, 7) rotate <0,-6,0> translate <-4.3,0,-2.4> } union{ object { House(4.2, 3.5, 4.3, 1.7, TX_Plaster_Warm, TX_Roof_Red) } WindowsOnBox(4.2,3.5,4.3, 8) rotate <0, 4,0> translate < 0.2,0,-2.3> } union{ object { House(3.2, 3.0, 4.8, 1.9, TX_Plaster_Green, TX_Roof_Brown) } WindowsOnBox(3.2,3.0,4.8, 9) rotate <0,-7,0> translate < 4.4,0,-2.5> } union{ object { House(3.6, 3.2, 4.1, 1.6, TX_Plaster_Green, TX_Roof_Red) } WindowsOnBox(3.6,3.2,4.1,10) rotate <0, 6,0> translate < 8.6,0,-2.4> } // Row 3 (back) union{ object { House(3.2, 3.1, 5.0, 2.0, TX_Plaster_Green, TX_Roof_Red) } WindowsOnBox(3.2,3.1,5.0,11) rotate <0,-8,0> translate <-8.6,0, 1.6> } union{ object { House(3.8, 3.6, 5.3, 2.1, TX_Plaster, TX_Roof_Brown) } WindowsOnBox(3.8,3.6,5.3,12) rotate <0, 5,0> translate <-4.4,0, 1.5> } union{ object { House(4.5, 3.8, 5.6, 2.2, TX_Plaster_Warm, TX_Roof_Red) } WindowsOnBox(4.5,3.8,5.6,13) rotate <0,-4,0> translate < 0.1,0, 1.7> } union{ object { House(3.4, 3.2, 5.1, 2.0, TX_Plaster_Green, TX_Roof_Brown) } WindowsOnBox(3.4,3.2,5.1,14) rotate <0, 7,0> translate < 4.4,0, 1.6> } union{ object { House(3.9, 3.7, 5.2, 2.1, TX_Plaster, TX_Roof_Red) } WindowsOnBox(3.9,3.7,5.2,15) rotate <0,-6,0> translate < 8.7,0, 1.5> } // Old-town towers object { Tower(0.65, 7.6, 2.2, TX_Stone, TX_Roof_Red) translate <-2.6,0,-4.5> } object { Tower(0.55, 6.4, 2.0, TX_Stone, TX_Roof_Brown) translate < 6.7,0,-1.0> } // -------------------- Lamp posts -------------------- #macro LampPost(P) union{ cylinder { P, P+<0,1.55,0>, 0.06 pigment{color rgb<0.10,0.10,0.12>} finish{F_Metal} } cylinder { P+<0,1.55,0>, P+<0,1.80,0>, 0.04 pigment{color rgb<0.10,0.10,0.12>} finish{F_Metal} } sphere { P+<0,1.86,0>, 0.10 pigment{color rgb<0.18,0.16,0.14>} finish{ diffuse 0.5 specular 0.12 roughness 0.06 ambient 0.25 } } } #end #declare L1 = <-10.5, 0, 0.0>; #declare L2 = <-4.5, 0, 0.0>; #declare L3 = < 1.5, 0, 0.0>; #declare L4 = < 7.5, 0, 0.0>; object { LampPost(L1) } object { LampPost(L2) } object { LampPost(L3) } object { LampPost(L4) } ConeLight(L1+<0,1.9,0>, L1+<0,0.0,0>, WarmLamp, 18, 32, 18) ConeLight(L2+<0,1.9,0>, L2+<0,0.0,0>, WarmLamp, 18, 32, 18) ConeLight(L3+<0,1.9,0>, L3+<0,0.0,0>, WarmLamp, 18, 32, 18) ConeLight(L4+<0,1.9,0>, L4+<0,0.0,0>, WarmLamp, 18, 32, 18) // Façade spotlights ConeLight(<-14, 6.5, -12>, <-6.0, 2.8, -6.5>, rgb<1.0,0.82,0.60>*0.9, 16, 26, 20) ConeLight(< 14, 7.0, -12>, < 6.0, 3.0, -6.5>, rgb<1.0,0.82,0.60>*0.85, 16, 26, 20) // -------------------- Distant hill + castle -------------------- difference { sphere { <0, -30, 28>, 40 } plane { y, 0 inverse } texture{ pigment{ bozo color_map{ [0.00 rgb <0.13,0.18,0.16>] [0.60 rgb <0.18,0.22,0.20>] [1.00 rgb <0.10,0.14,0.12>] } scale 2.2 } normal { bumps 0.35 scale 0.9 } finish { diffuse 0.95 specular 0.01 roughness 0.18 ambient 0.01 } } } // Castle (textured stone + darker roofs) #declare TX_CastleStone = texture{ pigment{ granite color_map{ [0.00 rgb <0.20,0.21,0.23>] [0.55 rgb <0.26,0.27,0.30>] [1.00 rgb <0.34,0.35,0.38>] } scale 0.85 } normal { granite 0.75 scale 0.32 } 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.30,0.12,0.30> } normal { ripples 0.30 scale <0.30,0.10,0.30> } finish { diffuse 0.70 specular 0.10 roughness 0.05 ambient 0.005 } } union { box { <-2.4, 0, -1.8>, < 2.4, 4.8, 1.8> texture { TX_CastleStone } } box { <-5.0, 0, -1.2>, <-2.6, 3.2, 1.2> texture { TX_CastleStone } } box { < 2.6, 0, -1.2>, < 5.0, 3.2, 1.2> texture { TX_CastleStone } } object { Tower(0.7, 5.6, 2.0, TX_CastleStone, TX_CastleRoof) translate <-4.7,0,-1.1> } object { Tower(0.7, 5.6, 2.0, TX_CastleStone, TX_CastleRoof) translate <-4.7,0, 1.1> } object { Tower(0.7, 5.6, 2.0, TX_CastleStone, TX_CastleRoof) translate < 4.7,0,-1.1> } object { Tower(0.7, 5.6, 2.0, TX_CastleStone, TX_CastleRoof) translate < 4.7,0, 1.1> } prism { linear_sweep linear_spline -1.8, 1.8, 3, <-2.4, 4.8>, < 0.0, 6.3>, < 2.4, 4.8> texture { TX_CastleRoof } } scale <1.2,1.2,1.2> rotate <0, 12, 0> translate <0, 0.0, 22.5> } // Rim light to separate castle from hill ConeLight(<-6, 14, 10>, <0, 4.5, 22.5>, rgb<1.0,0.75,0.55>*0.25, 10, 18, 8)