File: s_72.html

package info (click to toggle)
povray 1%3A3.6.1-12
  • links: PTS
  • area: non-free
  • in suites: lenny, squeeze
  • size: 31,084 kB
  • ctags: 20,310
  • sloc: ansic: 110,032; cpp: 86,573; sh: 13,595; pascal: 5,942; asm: 2,994; makefile: 1,753; ada: 1,637
file content (1129 lines) | stat: -rw-r--r-- 31,755 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129

<!--  This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004  -->
<html> 
<head>
  
<!--  NOTE: In order to users to help find information about POV-Ray using  -->
 
<!--  web search engines, we ask you to *not* let them index documentation  -->
 
<!--  mirrors because effectively, when searching, users will get hundreds  -->
 
<!--  of results containing the same information! For this reason, the two  -->
 
<!--  meta tags below disable archiving and indexing of this page by all  -->
 
<!--  search engines that support these meta tags.  -->
 
 <meta content="noarchive" name="robots">
   
 <meta content="noindex" name="robots">
   
 <meta content="no-cache" http-equiv="Pragma">
   
 <meta content="0" http-equiv="expires">
   
<title>2.3.7 Radiosity</title>
 <link href="povray35.css" rel="stylesheet" type="text/css"> 
</head>
 <body> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_71.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_71.html">2.3.6 Simple Media Tutorial</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>2.3.7 
   Radiosity</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_73.html">2.3.8 Making Animations</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_73.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 
<h3><a name="s02_03_07">2.3.7 </a>Radiosity</h3>
<a name="s02_03_07_i1"><a name="Radiosity, tutorial"></a>
<h4><a name="s02_03_07_01">2.3.7.1 </a>Introduction</h4>

<p>
  Radiosity is a lighting technique to simulate the diffuse exchange of radiation between the objects of a scene. 
 With a raytracer like POV-Ray, normally only the direct influence of light sources on the objects can be calculated, 
 all shadowed parts look totally flat. Radiosity can help to overcome this limitation. More details on the technical 
 aspects can be found in the <a href="#l47">reference section</a>. 
</p>

<p>
  To enable radiosity, you have to add a radiosity block to the global_settings in your POV-Ray scene file. Radiosity 
 is more accurate than simplistic ambient light but it takes much longer to compute, so it can be useful to switch off 
 radiosity during scene development. You can use a declared constant or an <a href="s_95.html#s03_01_02_05_01">INI-file 
 constant</a> and an <code>#if</code> statement to do this: 
</p>

<pre>
  #declare RAD = off;

  global_settings {
     #if(RAD)
        radiosity {
           ...
        }
     #end
  }
</pre>

<p>
  Most important for radiosity are the ambient and diffuse finish components of the objects. Their effect differs 
 quite much from a conventionally lit scene. 
</p>

<ul>
 
 <li>
   <code>ambient</code>: specifies the amount of light emitted by the object. This is the basis for <a href="s_72.html#s02_03_07_03">radiosity 
  without conventional lighting</a> but also in scenes with light sources this can be important. Since most materials 
  do not actually emit light, the default value of <code>0.1</code> is too high in most cases. You can also change <a href="s_102.html#s03_03_03_02">ambient_light</a> 
  to influence this. 
 </li>

 <li>
   <code>diffuse</code>: influences the amount of diffuse reflection of incoming light. In a radiosity scene this 
  does not only mean the direct appearance of the surface but also how much other objects are illuminated by indirect 
  light from this surface. 
 </li>

</ul>

<h4><a name="s02_03_07_02">2.3.7.2 </a>Radiosity with conventional lighting</h4>
<a name="s02_03_07_02_i1">
<p>
  The pictures here introduce combined conventional/radiosity lighting. Later on you can also find examples for pure 
 radiosity illumination. 
</p>

<p>
  The following settings are default, the result will be the same with an empty radiosity block: 
</p>

<pre>
  global_settings {
    radiosity {
      pretrace_start 0.08
      pretrace_end   0.04
      count 35

      nearest_count 5
      error_bound 1.8
      recursion_limit 3

      low_error_factor 0.5
      gray_threshold 0.0
      minimum_reuse 0.015
      brightness 1

      adc_bailout 0.01/2
    }
  }
</pre>

<p>
  The following pictures are rendered with default settings and are made to introduce the sample scene. 
</p>

<p>
  All objects except the sky have an ambient finish of 0. 
</p>

<p>
  The <code>ambient 1</code> finish of the blue sky makes it functioning as some kind of diffuse light source. This 
 leads to a bluish touch of the whole scene in the radiosity version. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="no radiosity" border="0" src="images/tutorial/radA_01.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="radiosity (default settings)" border="0" src="images/tutorial/radA_03.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="difference w/o radiosity" border="0" src="images/tutorial/radA_03a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  You can see that radiosity much affects the shadowed parts when applied combined with conventional lighting. 
</p>

<p>
  Changing <code>brightness</code> changes the intensity of radiosity effects. <code>brightness 0</code> would be the 
 same as without radiosity. <code>brightness 1</code> should work correctly in most cases, if effects are too strong 
 you can reduce this. Larger values lead to quite strange results in most cases. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="brightness 0.5" border="0" src="images/tutorial/radA_04.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="brightness 1.0" border="0" src="images/tutorial/radA_03.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="brightness 2.0" border="0" src="images/tutorial/radA_05.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Changing the <code>recursion_limit</code> value leads to the following results, second line are difference to 
 default (<code>recursion_limit 3</code>): 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="recursion_limit 1" border="0" src="images/tutorial/radA_06.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 2" border="0" src="images/tutorial/radA_07.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 5" border="0" src="images/tutorial/radA_08.jpg"></center> 
  </td>

 </tr>

</table>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="recursion_limit 1 (difference)" border="0" src="images/tutorial/radA_06a.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 2 (difference)" border="0" src="images/tutorial/radA_07a.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 5 (difference)" border="0" src="images/tutorial/radA_08a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  You can see that higher values than the default of 3 do not lead to much better results in such a quite simple 
 scene. In most cases values of 1 or 2 are sufficient. 
</p>

<p>
  The <code>error_bound</code> value mainly affects the structures of the shadows. Values larger than the default of 
 1.8 do not have much effects, they make the shadows even flatter. Extremely low values can lead to very good results, 
 but the rendering time can become very long. For the following samples <code>recursion_limit 1</code> is used. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="error_bound 0.01" border="0" src="images/tutorial/radA_09.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 0.5" border="0" src="images/tutorial/radA_10.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 1.0" border="0" src="images/tutorial/radA_11.jpg"></center> 
  </td>

 </tr>

</table>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="error_bound 0.01 (difference)" border="0" src="images/tutorial/radA_09a.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 0.5 (difference)" border="0" src="images/tutorial/radA_10a.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 1.0 (difference)" border="0" src="images/tutorial/radA_11a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  Somewhat related to <code>error_bound</code> is <code>low_error_factor</code>. It reduces error_bound during the 
 last pretrace step. Changing this can be useful to eliminate artefacts. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="low_error_factor 0.01" border="0" src="images/tutorial/radA_12.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 0.5" border="0" src="images/tutorial/radA_13.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 1.0" border="0" src="images/tutorial/radA_14.jpg"></center> 
  </td>

 </tr>

</table>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="low_error_factor 0.01 (difference)" border="0" src="images/tutorial/radA_12a.jpg"></center> 
   
  </td>

  <td width="33%">
    &nbsp; 
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 1.0 (difference)" border="0" src="images/tutorial/radA_14a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  The next samples use <code>recursion_limit 1</code> and <code>error_bound 0.2</code>. These 3 pictures illustrate 
 the effect of <code>count</code>. It is a general quality and accuracy parameter leading to higher quality and slower 
 rendering at higher values. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="count 2" border="0" src="images/tutorial/radA_15.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="count 35 (default)" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="count 300" border="0" src="images/tutorial/radA_16.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Another parameter that affects quality is <code>nearest_count</code>. You can use values from 1 to 20, default is 
 5: 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="nearest_count 1" border="0" src="images/tutorial/radA_17.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="nearest_count 5" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="nearest_count 10" border="0" src="images/tutorial/radA_18.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Again higher values lead to less artefacts and smoother appearance but slower rendering. 
</p>

<p>
  <code>minimum_reuse</code> influences whether previous radiosity samples are reused during calculation. It also 
 affects quality and smoothness. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="minimum_reuse 0.2" border="0" src="images/tutorial/radA_19.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="minimum_reuse 0.015" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="minimum_reuse 0.005" border="0" src="images/tutorial/radA_20.jpg"></center> 
  </td>

 </tr>

</table>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="minimum_reuse 0.2 (difference)" border="0" src="images/tutorial/radA_19a.jpg"></center> 
   
  </td>

  <td width="33%">
    &nbsp; 
  </td>

  <td width="33%">
    <br><center><img alt="minimum_reuse 0.005 (difference)" border="0" src="images/tutorial/radA_20a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  Another important value is <code>pretrace_end</code>. It specifies how many pretrace steps are calculated and 
 thereby strongly influences the speed. Usually lower values lead to better quality, but it is important to keep this 
 in good relation to <code>error_bound</code>. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="pretrace_end 0.2" border="0" src="images/tutorial/radA_21.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="pretrace_end 0.04" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="pretrace_end 0.002" border="0" src="images/tutorial/radA_22.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Strongly related to <code>pretrace_end</code> is <code>always_sample</code>. Normally even in the final trace 
 additional radiosity samples are taken. You can avoid this by adding <code>always_sample off</code>. That is 
 especially useful if you load previously calculated radiosity data with <code>load_file</code>. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="always_sample on" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="always_sample off" border="0" src="images/tutorial/radA_23.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="always_sample off (difference)" border="0" src="images/tutorial/radA_23a.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  The effect of <code>max_sample</code> is similar to <code>brightness</code>. It does not reduce the radiosity 
 effect in general but weakens samples with brightness above the specified value. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="max_sample 0.5" border="0" src="images/tutorial/radA_24.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="max_sample 0.8" border="0" src="images/tutorial/radA_25.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="default" border="0" src="images/tutorial/radA_13a.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  You can strongly affect things with the objects' <a href="#l48">finishes</a>. In fact that is the most important 
 thing about radiosity. Normal objects should have ambient finish 0 which is not default in POV-Ray and therefore needs 
 to be specified. Objects with ambient &gt; 0 actually emit light. 
</p>

<p>
  Default finish values used until now are <code>diffuse 0.65 ambient 0</code>. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="diffuse 0.65 ambient 0.2" border="0" src="images/tutorial/radA_29.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="diffuse 0.4 ambient 0" border="0" src="images/tutorial/radA_30.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="diffuse 1.0 ambient 0" border="0" src="images/tutorial/radA_31.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Finally you can vary the sky in outdoor radiosity scenes. In all these examples it is implemented with a sphere 
 object. <code>finish { ambient 1 diffuse 0 }</code> was used until now. The following pictures show some variations: 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="ambient 0 diffuse 1" border="0" src="images/tutorial/radA_27.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="ambient 0 diffuse 0 (no sky)" border="0" src="images/tutorial/radA_26.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="yellow-blue gradient" border="0" src="images/tutorial/radA_28.jpg"></center> 
  </td>

 </tr>

</table>

<h4><a name="s02_03_07_03">2.3.7.3 </a>Radiosity without conventional lighting</h4>
<a name="s02_03_07_03_i1"><a name="Radiosity, without conventional lighting"></a>
<p>
  You can also leave out all light sources and have pure radiosity lighting. The situation then is similar to a 
 cloudy day outside, when the light comes from no specific direction but from the whole sky. 
</p>

<p>
  The following 2 pictures show what changes with the scene used in part 1, when the light source is removed. 
 (default radiosity, but <code>recursion_limit 1</code> and <code>error_bound 0.2</code>) 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="50%">
    <br><center><img alt="with light source" border="0" src="images/tutorial/radA_10.jpg"></center> 
  </td>

  <td width="50%">
    <br><center><img alt="without light source" border="0" src="images/tutorial/radB_01.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  You can see that when the light source is removed the whole picture becomes very blue, because the scene is 
 illuminated by a blue sky, while on a cloudy day, the color of the sky should be somewhere between grey and white. 
</p>

<p>
  The following pictures show the sample scene used in this part with different settings for <code>recursion_limit</code> 
 (everything else default settings). 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="recursion_limit 1" border="0" src="images/tutorial/radB_02.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 2" border="0" src="images/tutorial/radB_03.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="recursion_limit 3" border="0" src="images/tutorial/radB_04.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  This looks much worse than in the first part, because the default settings are mainly selected for use with 
 conventional light sources. 
</p>

<p>
  The next three pictures show the effect of <code>error_bound</code>. (<code>recursion_limit</code> is 1 here) 
 Without light sources, this is even more important than with, good values much depend on the scenery and the other 
 settings, lower values do not necessarily lead to better results. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="error_bound 1.8" border="0" src="images/tutorial/radB_02.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 0.4" border="0" src="images/tutorial/radB_05.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 0.02" border="0" src="images/tutorial/radB_06.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  If there are artefacts it often helps to increase <code>count</code>, it does affect quality in general and often 
 helps removing them (the following three pictures use <code>error_bound 0.02</code>). 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="count 2" border="0" src="images/tutorial/radB_07.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="count 50" border="0" src="images/tutorial/radB_08.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="count 200" border="0" src="images/tutorial/radB_09.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  The next sequence shows the effect of <code>nearest_count</code>, the difference is not very strong, but larger 
 values always lead to better results (maximum is 20). From now on all the pictures use <code>error_bound 0.2</code> 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="nearest_count 2" border="0" src="images/tutorial/radB_11.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="nearest_count 5 (default)" border="0" src="images/tutorial/radB_10.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="nearest_count 10" border="0" src="images/tutorial/radB_12.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  The <code>minimum_reuse</code> is a geometric value related to the size of the render in pixel and affects whether 
 previous radiosity calculations are reused at a new point. Lower values lead to more often and therefore more accurate 
 calculations. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="minimum_reuse 0.001" border="0" src="images/tutorial/radB_13.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="minimum_reuse 0.015 (default)" border="0" src="images/tutorial/radB_10.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="minimum_reuse 0.1" border="0" src="images/tutorial/radB_14.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  In most cases it is not necessary to change the <code>low_error_factor</code>. This factor reduces the error_bound 
 value during the final pretrace step. <code>pretrace_end</code> was lowered to <code>0.01</code> in these pictures, 
 the second line shows the difference to default. Changing this value can sometimes help to remove persistent 
 artefacts. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="low_error_factor 0.01" border="0" src="images/tutorial/radB_15.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 0.5 (default)" border="0" src="images/tutorial/radB_16.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 1.0" border="0" src="images/tutorial/radB_17.jpg"></center> 
  </td>

 </tr>

</table>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="low_error_factor 0.01" border="0" src="images/tutorial/radB_15a.jpg"></center> 
  </td>

  <td width="33%">
    &nbsp; 
  </td>

  <td width="33%">
    <br><center><img alt="low_error_factor 1.0" border="0" src="images/tutorial/radB_17a.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  <code>gray_threshold</code> reduces the color in the radiosity calculations. as mentioned above the blue sky 
 affects the color of the whole scene when radiosity is calculated. To reduce this coloring effect without affecting 
 radiosity in general you can increase <code>gray_threshold</code>. 1.0 means no color in radiosity at all. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="gray_threshold 0.0 (default)" border="0" src="images/tutorial/radB_10.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="gray_threshold 0.5" border="0" src="images/tutorial/radB_18.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="gray_threshold 1.0" border="0" src="images/tutorial/radB_19.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  Another important parameter is <code>pretrace_end</code>. Together with pretrace_start it specifies the pretrace 
 steps that are done. Lower values lead to more pretrace steps and more accurate results but also to significantly 
 slower rendering. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="pretrace_end 0.2" border="0" src="images/tutorial/radB_26.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="pretrace_end 0.02" border="0" src="images/tutorial/radB_27.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="pretrace_end 0.004" border="0" src="images/tutorial/radB_28.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  It is worth experimenting with the things affecting radiosity to get some feeling for how things work. The next 3 
 images show some more experiments. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="ambient 3 instead of ambient 0 for one object" border="0" src="images/tutorial/radB_23.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="ambient 0.5 instead of ambient 0 for all objects sky: ambient 0" border="0" src="images/tutorial/radB_24.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="error_bound 0.04 recursion_limit 2" border="0" src="images/tutorial/radB_25.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  Finally you can strongly change the appearance of the whole scene with the sky's texture. The following pictures 
 give some example. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="yellow-blue gradient from left to right" border="0" src="images/tutorial/radB_20.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="light-dark gradient from left to right" border="0" src="images/tutorial/radB_21.jpg"></center> 
   
  </td>

  <td width="33%">
    <br><center><img alt="light-dark gradient from bottom to top" border="0" src="images/tutorial/radB_22.jpg"></center> 
   
  </td>

 </tr>

</table>

<p>
  Really good results much depend on the single situation and how the scene is meant to look. Here is some 
 &quot;higher quality&quot; render of this particular scene, but requirements can be much different in other 
 situations. 
</p>

<pre>
  global_settings {
    radiosity {
      pretrace_start 0.08
      pretrace_end   0.01
      count 500

      nearest_count 10
      error_bound 0.02
      recursion_limit 1

      low_error_factor 0.2
      gray_threshold 0.0
      minimum_reuse 0.015
      brightness 1

      adc_bailout 0.01/2
    }
  }
</pre>

<p>
  <img alt="Higher quality radiosity scene" border="0" src="images/tutorial/radB_X.png"> 
</p>

<h4><a name="s02_03_07_04">2.3.7.4 </a>Normals and Radiosity</h4>
<a name="s02_03_07_04_i1">
<p>
  When using a <a href="#l49">normal statement</a> in combination with radiosity lighting, you will see that the 
 shadowed parts of the objects are totally smooth, no matter how strong the normals are made. 
</p>

<p>
  The reason is that POV-Ray by default does not take the normal into account when calculating radiosity. You can 
 change this by adding <code>normal on</code> to the radiosity block. This can slow things down quite a lot, but 
 usually leads to more realistic results if normals are used. 
</p>

<p>
  When using normals you should also remember that they are only faked irregularities and do not generate real 
 geometric disturbances of the surface. A more realistic approach is using an <a href="#l50">isosurface</a> with a 
 pigment function, but this usually leads to very slow renders, especially if radiosity is involved. 
</p>

<table border="0" cellpadding="0" cellspacing="2" class="nofloat" width="100%">
 
 <tr>
  
  <td width="33%">
    <br><center><img alt="normal off (default)" border="0" src="images/tutorial/radC_01.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="normal on" border="0" src="images/tutorial/radC_02.jpg"></center> 
  </td>

  <td width="33%">
    <br><center><img alt="isosurface" border="0" src="images/tutorial/radC_03.jpg"></center> 
  </td>

 </tr>

</table>

<p>
  You can see that the isosurface version does not have a natural smooth circumference and a more realistic 
 shadowline. 
</p>

<h4><a name="s02_03_07_05">2.3.7.5 </a>Performance considerations</h4>
<a name="s02_03_07_05_i1">
<p>
  Radiosity can be very slow. To some extend this is the price to pay for realistic lighting, but there are a lot of 
 things that can be done to improve speed. 
</p>

<p>
  The radiosity settings should be set as fast as possible. In most cases this is a quality vs. speed compromise. 
 Especially <code>recursion_limit</code> should be kept as low as possible. Sometimes <code>1</code> is sufficient, if 
 not <code>2</code> or <code>3</code> should often be enough. 
</p>

<p>
  With high quality settings, radiosity data can take quite a lot of memory. Apart from that the other scene data is 
 also used much more intensive than in a conventional scene. Therefore insufficient memory and swapping can slow down 
 things even more. 
</p>

<p>
  Finally the scene geometry and textures are important too. Objects not visible in the camera usually only increase 
 parsing time and memory use, but in a radiosity scene, also objects behind the camera can slow down the rendering 
 process. 
</p>

<p>
 <a name="l47">
<small><strong>More about &quot;reference section&quot;</strong></small>
</a>
 <ul>
  
  <li><small>
   <a href="s_103.html#s03_03_04">3.3.4 Radiosity</a> in 3.3 Scene Settings
  </small>

  <li><small>
   <a href="s_165.html#s03_08_13_01">3.8.13.1 Radiosity</a> in 3.8.13 Global Settings
  </small>

  <li><small>
   <a href="s_72.html#s02_03_07">2.3.7 Radiosity</a> in 2.3 Advanced Features
  </small>

 </ul>

</p>

<p>
 <a name="l48">
<small><strong>More about &quot;finishes&quot;</strong></small>
</a>
 <ul>
  
  <li><small>
   <a href="s_117.html#s03_05_03">3.5.3 Finish</a> in 3.5 Textures
  </small>

  <li><small>
   <a href="s_162.html#s03_08_10_06">3.8.10.6 Finish</a> in 3.8.10 Texture
  </small>

 </ul>

</p>

<p>
 <a name="l49">
<small><strong>More about &quot;normal statement&quot;</strong></small>
</a>
 <ul>
  
  <li><small>
   <a href="s_116.html#s03_05_02">3.5.2 Normal</a> in 3.5 Textures
  </small>

  <li><small>
   <a href="s_162.html#s03_08_10_05">3.8.10.5 Normal</a> in 3.8.10 Texture
  </small>

  <li><small>
   <a href="s_69.html#s02_03_04_02">2.3.4.2 Normals</a> in 2.3.4 Advanced Texture Options
  </small>

 </ul>

</p>

<p>
 <a name="l50">
<small><strong>More about &quot;isosurface&quot;</strong></small>
</a>
 <ul>
  
  <li><small>
   <a href="s_108.html#s03_04_04">3.4.4 Isosurface Object</a> in 3.4 Objects
  </small>

  <li><small>
   <a href="s_68.html#s02_03_03_03">2.3.3.3 Isosurface Object</a> in 2.3.3 Other Shapes
  </small>

 </ul>

</p>
 <br> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_71.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_71.html">2.3.6 Simple Media Tutorial</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong>2.3.7 Radiosity</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_73.html">2.3.8 Making Animations</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_73.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 </body> </html>