1// Persistence Of Vision Ray Tracer Scene Description File
2// -------------------------------------------------------
3// File: @(#)hdr_environment.pov
4// Description: HDR writing sample scene
5// Features demonstrated: HDR image output
6// Creation Date: $ 14 Apr 2003, 16:51:52 $
7// Last modified: $ 18 Aug 2004, 09:53:08 $
8// Author: Christoph Hormann <chris_hormann@gmx.de>
9//
10// @@ Scene that generates the environment map for 'hdr_mapping.pov'
11//
12// -w640 -h320 +a0.3 DECLARE=View=3
13//
14// to render an environment map use:
15//
16// -w1024 -h512 +fh -ohdr_env.hdr DECLARE=View=3
17
18#version unofficial megapov 1.1;
19
20// ----------------------------------------
21
22#declare Sun=on;
23#declare Light=off;
24
25//#declare Sun=off;
26//#declare Light=on;
27
28#declare Doors=false;
29//#declare Doors=true;
30
31#ifndef (View)
32  #declare View=1;
33#end
34
35// ----------------------------------------
36
37global_settings {
38  max_trace_level 10
39  assumed_gamma 1
40  adc_bailout 1/1e6
41
42  radiosity {
43
44    pretrace_start 0.08
45    pretrace_end 0.01
46    count 50
47    //count 250
48    nearest_count 8
49    error_bound 0.8
50    //error_bound 0.2
51    recursion_limit 2
52    //recursion_limit 1
53
54    low_error_factor .5
55    gray_threshold 0.0
56    minimum_reuse 0.0015
57    brightness 1.0
58
59    randomize on
60    normal on
61    media on
62  }
63
64}
65
66
67#switch (View)
68
69  #case (1)
70    camera {
71      location    <4.8, -3, 2.0>
72      direction   y
73      sky         z
74      up          z
75      right       (4/3)*x
76      look_at     <0, 0, 0.9>
77      angle       70
78      rotate 170*z
79    }
80  #break
81
82  #case (2)
83    camera {
84      location    <-5.4, -4.1, 1.0>*2
85      direction   y
86      sky         z
87      up          z
88      right       (4/3)*x
89      look_at     <0, 0, 0.9>
90      angle       42
91    }
92  #break
93
94  #case (3)
95    camera {
96      spherical
97      location <0,0,1>
98      right     -x
99      angle 360, 180
100      look_at <0,-1,1>
101    }
102
103#end
104
105#if (Sun)
106  #declare Light_Pos=vnormalize(<-3, -3.3, 1.8>);
107
108  light_source {
109    Light_Pos*100000
110    color rgb <2.0, 1.5, 1.0>*16
111    area_light 1000*x 1000*y  3,3
112    adaptive 1
113    jitter orient circular
114  }
115#end
116
117
118#if (Light)
119  light_source {
120    <4.8, -3, 2.8>
121    #if (Sun)
122      color rgb <2.0, 1.5, 1.0>*8
123    #else
124      color rgb <2.0, 1.5, 1.0>*32
125    #end
126    fade_power 2
127    fade_distance 1
128    rotate 170*z
129  }
130#end
131
132
133#if (Sun)
134  sky_sphere {
135    pigment {
136      pigment_pattern {
137        spherical
138        poly_wave 6
139        color_map { [0 rgb 0][1 rgb 1] }
140        scale 3
141        translate Light_Pos
142      }
143      pigment_map {
144        [0 gradient z
145          color_map {
146            [0.00 rgb <0.8,0.9,1.0>*2.5]
147            [0.10 rgb <0.6,0.7,1.0>*2.5]
148            [0.25 rgb <0.2,0.3,0.8>*2.5]
149          }
150        ]
151        [0.9 color rgb <2.0, 1.5, 1.0>*8*4]
152        [0.91 color rgb <2.0, 1.5, 1.0>*15*9]
153      }
154    }
155  }
156#else
157  sky_sphere {
158    pigment {
159      gradient z
160      color_map {
161        [0.00 rgb <0.8,0.7,0.5>]
162        [0.10 rgb <0.5,0.6,0.7>]
163        [0.25 rgb <0.1,0.2,0.6>]
164      }
165    }
166  }
167#end
168
169#declare Tex_Ground=
170  texture {
171    pigment { color rgb 1 }
172    finish { ambient 0.0 diffuse 0.35 }
173  }
174
175#include "colors.inc"
176#include "stones.inc"
177
178#declare Tex_Stone =
179  texture {
180    T_Stone5
181    finish {
182      ambient 0
183      diffuse 0.4
184      specular 0
185      reflection 0
186    }
187    normal {
188      granite 0.2
189      scale 0.5
190    }
191    scale 0.4
192  }
193
194#declare Tex_Stone_Floor =
195  texture {
196    T_Stone10
197    finish {
198      ambient 0
199      diffuse 0.3
200      specular 0.2
201      reflection 0.1
202    }
203    normal {
204      granite 0.02
205      scale 0.4
206    }
207    scale 0.4
208  }
209
210
211
212union {
213  difference {
214    merge {
215      plane {
216        z, -0.1
217        texture { Tex_Ground }
218      }
219      cylinder {
220        0, -z*3, 5
221        texture { Tex_Stone_Floor }
222      }
223    }
224    cylinder {
225      z, -z*0.8, 1.8
226      texture { Tex_Stone }
227    }
228  }
229
230  difference {
231    cylinder { 3*z, 3.2*z, 2.2 }
232    cylinder { 2*z, 4*z, 1.6 }
233  }
234  difference {
235    sphere { 3.2*z, 1.7 }
236    sphere { 3.2*z, 1.6 }
237    plane { z, 3.19 }
238    #local Cnt=0;
239    #while (Cnt<360)
240      cylinder {
241        3.25*z, <3.0,0,3.2>, 0.25
242        rotate Cnt*z
243      }
244      #local Cnt=Cnt+30;
245    #end
246  }
247  difference {
248    cylinder { 0, 0.12*z, 2.2 }
249    cylinder { -z, z, 1.6 }
250  }
251  difference {
252    box { <-2.2,0,3>, <5.2,-5,3.2> }
253    cylinder { 2*z, 4*z, 1.7 }
254  }
255  #if (Doors)
256    difference {
257      box { <-2.2,0,3>, <-2.0,-5,-0.2> }
258      box { <-3,-2.4,2.2>, <-1.0,-3.6,-0.5> }
259    }
260  #else
261    box { <-2.2,0,3>, <-2.0,-5,-0.2> }
262  #end
263  box { < 5.2,0,3>, < 5.0,-5,-0.2> }
264  #if (Doors)
265    difference {
266      box { < 5.2,0,3>, < 2.0,-0.2,-0.2> }
267      box { < 4,1,2.2>, < 3.0,-1,-0.5> }
268    }
269  #else
270    box { < 5.2,0,3>, < 2.0,-0.2,-0.2> }
271  #end
272  box { <-2.2,-5,3>, < 5.2,-5,-0.2> }
273
274  #local Cnt=0;
275
276  #while (Cnt<181)
277
278    cylinder {
279      -z, 3.1*z, 0.12
280      translate 2*x
281      rotate Cnt*z
282    }
283    #local Cnt=Cnt+30;
284  #end
285
286  rotate 170*z
287  texture { Tex_Stone }
288}
289
290
291