1// This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. 2// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a 3// letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. 4 5// Persistence of Vision Raytracer Scene Description File 6// File: diffuse_back.pov 7// Author: Christoph Lipka 8// Description: Demonstrates diffuse backside illumination 9// 10// -w640 -h480 11// -w800 -h600 +a0.3 12// 13// Warning: this will take time! 14 15#version 3.7; 16 17#declare Photons=on; 18#declare Radiosity=on; 19 20global_settings { 21 max_trace_level 25 22 assumed_gamma 2.2 23 #if (Photons) 24 photons { 25 count 100000 26 } 27 #end 28 #if (Radiosity) 29 radiosity { 30 pretrace_start 0.04 31 pretrace_end 0.005 32 count 1000 33 nearest_count 10 34 error_bound 0.5 35 recursion_limit 2 36 low_error_factor .25 37 gray_threshold 0.0 38 minimum_reuse 0.002 39 brightness 1 40 adc_bailout 0.01/2 41 always_sample off 42 } 43 #end 44} 45 46#if (Radiosity) 47 default { 48 finish { ambient 0 } 49 } 50#else 51 default { 52 finish { ambient 0.2 } 53 } 54#end 55 56// ---------------------------------------- 57 58#declare OverallBrightness = 8; 59#declare OverallScale = 100; 60 61camera { 62 right x*image_width/image_height // keep proportions with any aspect ratio 63 location < 1,1.6,-2.5>*OverallScale 64 look_at <-2.0,1.2,0>*OverallScale 65} 66 67light_source { 68 vnormalize(<-500,200,-250>)*1000*OverallScale 69 color rgb 1.3 * OverallBrightness 70 area_light x*10*OverallScale,y*10*OverallScale, 9,9 adaptive 1 jitter circular orient 71 photons { 72 refraction on 73 reflection on 74 } 75} 76 77sky_sphere { 78 pigment { 79 gradient y 80 color_map { 81 [0.0 rgb <0.6,0.7,1.0>*OverallBrightness*0.5] 82 [0.7 rgb <0.0,0.1,0.8>*OverallBrightness*0.5] 83 } 84 } 85} 86 87 88// ---------------------------------------- 89 90plane { y, -10 91 texture { 92 pigment { color rgb <1.0, 0.8, 0.6> } 93 finish { diffuse 0.5 } 94 } 95} 96 97#declare M_SolidWhite= material { 98 texture { 99 pigment { rgb 1 } 100 finish { ambient 0 diffuse 0.8 specular 0.2 reflection { 0.2 } } 101 } 102} 103 104// Room 105 106difference { 107 box { <-3.1,-1,-4>, <3.1,3.5,4> } // solid block 108 box { <-3,-0.2,-3>, <3,2.5,3> } // main room cutout 109 box { <-3.2,0.3,-2>, <2.9,2,2> } // window cutout 110 texture { 111 pigment { color rgb <0.9, 0.9, 0.9> } 112 finish { diffuse 1.0 } 113 } 114 scale OverallScale 115} 116 117// Window Bars 118 119union { 120 cylinder { <-3.05,0, 1>, <-3.05,2, 1>, 0.05 } 121 cylinder { <-3.05,0,-1>, <-3.05,2,-1>, 0.05 } 122 material { M_SolidWhite } 123 scale OverallScale 124} 125 126// Baseboards 127 128#declare Baseboard = union { 129 cylinder { <-3,0.1,0>, <3,0.1,0>, 0.025 } 130 box { <-3,0,0>, <3,0.1,-0.025> } 131 material { M_SolidWhite } 132 translate z*3 133} 134 135union { 136 object { Baseboard } 137 object { Baseboard rotate y*90 } 138 object { Baseboard rotate y*180 } 139 object { Baseboard rotate y*270 } 140 scale OverallScale 141} 142 143 144box { <-3,0,-3>, <3,-0.1,3> 145 pigment { color rgb <1.0, 0.8, 0.6> } 146 scale OverallScale 147} 148 149 150// Curtains 151 152#declare M_Curtains= material { 153 texture { 154 pigment { rgb <1.0,0.8,0.6> } 155 finish { 156 ambient 0 157 diffuse 0.7,0.2 158 } 159 } 160} 161 162#declare Curtain= union { 163 polygon{ 5, <0,0.1,2.0>, <0,0.1,0.1>, <0,2.45,0.1>, <0,2.45,2.0>, <0,0.1,2.0> material { M_Curtains } } 164 cylinder { <0,0.1,2.025>, <0,0.1,0.075>, 0.025 material { M_SolidWhite } } 165 cylinder { <0,2.45,2.025>, <0,2.45,0.075>, 0.025 material { M_SolidWhite } } 166 translate <-2.8,0,0> 167 material { M_Curtains } 168} 169 170union { 171 object { Curtain } 172 object { Curtain scale <1,1,-1> } 173 scale OverallScale 174} 175 176// Screen 177 178#declare M_Screen= material { 179 texture { 180 pigment { rgbt <1,1,1, 0.01> } 181 finish { 182 ambient 0 183 diffuse 0.55,0.45 184 specular 0.2 185 reflection { 0.2 } 186 } 187 } 188} 189 190#declare Screen = cylinder { <0,0,0>, <0,1.0,0>, 0.5 191 open 192 clipped_by { plane { x, 0.1 } } 193 material { M_Screen } 194} 195 196union { 197 object { Screen rotate y*45 translate <-2.25,0,2> } 198 object { Screen rotate y*0 translate <-2.25,0,-1.0> } 199 scale OverallScale 200} 201 202// Glass Objects 203 204#declare M_Glass= material { 205 texture { 206 pigment {rgbt 1} 207 finish { 208 ambient 0.0 209 diffuse 0.05 210 specular 0.6 211 roughness 0.005 212 reflection { 213 0.1, 1.0 214 fresnel on 215 } 216 conserve_energy 217 } 218 } 219 interior { 220 ior 1.5 221 fade_power 1001 222 fade_distance 0.9 * 10 223 fade_color <0.5,0.8,0.6> 224 } 225} 226 227sphere { 228 <0,1,0>, 1 229 scale 0.2 230 translate <-1.8,0,0.5> 231 material { M_Glass } 232 photons { // photon block for an object 233 target 1.0 234 refraction on 235 reflection on 236 } 237 scale OverallScale 238} 239 240cylinder { 241 <0,0.01,0>, <0,2.5,0>, 1 242 scale 0.2 243 translate <-3.05,0.3,0.4> 244 material { M_Glass } 245 photons { // photon block for an object 246 target 1.0 247 refraction on 248 reflection on 249 } 250 scale OverallScale 251} 252