File: textures.inc

package info (click to toggle)
povray 1%3A3.7.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 147,232 kB
  • sloc: cpp: 845,011; ansic: 122,118; sh: 34,204; pascal: 6,420; asm: 3,355; ada: 1,681; makefile: 1,389; cs: 879; awk: 590; perl: 245; xml: 95
file content (1475 lines) | stat: -rw-r--r-- 35,694 bytes parent folder | download | duplicates (7)
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
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
// This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a
// letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

//    Persistence of Vision Ray Tracer version 3.5 Include File
//    File: textures.inc
//    Last updated: 2001.7.25
//    Description:

#ifndef(Textures_Inc_Temp)
#declare Textures_Inc_Temp = version;
#version 3.5;

/*                     Standard textures include file

    Contents:
    ===========================
    DMFWood6
    NBglass            (Norm Bowler)
    NBoldglass         (Norm Bowler)
    NBwinebottle       (Norm Bowler)
    NBbeerbottle       (Norm Bowler)
    Ruby_Glass         (after Norm Bowler)
    Dark_Green_Glass   (after Norm Bowler)
    Yellow_Glass       (after Norm Bowler)
    Orange_Glass       (after Norm Bowler)
    Vicks_Bottle_Glass (after Norm Bowler)
    Soft_Silver        (Dan Farmer)
    New_Penny          (Dan Farmer)
    Tinny_Brass        (Dan Farmer)
    Gold_Nugget        (Dan Farmer)
    Aluminum           (Dan Farmer)
    Bright_Bronze      (Dan Farmer)
    Lightening1        (Dan Farmer)
    Lightening2        (Dan Farmer)
    Brushed_Aluminum   (Dan Farmer)
    Starfield          (Jeff Burton )
    Shadow_Clouds      (Bill Pulver)
*/

#include "finish.inc"

#ifdef(View_POV_Include_Stack)
    #debug "including textures.inc\n"
#end


//*****************************************************************************
//                      STONE PIGMENTS
//*****************************************************************************

#declare Jade_Map =
color_map {
    [0.0 rgb <0.1, 0.6, 0.1>]
    [0.8 rgb <0.0, 0.3, 0.0>]
    [0.8 rgb <0.1, 0.6, 0.1>]
    [1.0 rgb <0.0, 0.2, 0.0>]
}

// Drew Wells' superb Jade.  Color map works nicely with other textures, too.
#declare Jade = 
pigment {
    marble
    turbulence 1.8
    color_map { Jade_Map }
}

#declare Red_Marble_Map = 
color_map {
    [0.0 rgb <0.8, 0.8, 0.6>]
    [0.8 rgb <0.8, 0.4, 0.4>]
    [1.0 rgb <0.8, 0.2, 0.2>]
}
// Classic white marble with red veins.  Over-worked, like checkers.
#declare Red_Marble = 
pigment {
    marble
    color_map { Red_Marble_Map }
    turbulence 1
}

#declare White_Marble_Map =
color_map {
    [0.0 rgb <0.9, 0.9, 0.9>]
    [0.8 rgb <0.5, 0.5, 0.5>]
    [1.0 rgb <0.2, 0.2, 0.2>]
}

// White marble with black veins.
#declare White_Marble = 
pigment {
    marble
    turbulence 1
    color_map { White_Marble_Map }
}

// Light blue and black marble with a thin red vein 
// Try changing LBlue and Vein below to modify the marble.
//#declare LBlue = rgb <0.0, 0.6, 0.6>;
//#declare Vein  = rgb <0.6, 0.0, 0.0>;
//These variables commented out to avoid possibility of name clashes

#declare Blood_Marble_Map =
color_map {
    [0.0 color 0]
    [0.8 color rgb <0.0, 0.6, 0.6>]
    [0.9 color rgb <0.6, 0.0, 0.0>]
//    [0.8 color LBlue]
//    [0.9 color Vein]
    [1.0 color 0]
}
#declare Blood_Marble = 
pigment {
    marble
    color_map { Blood_Marble_Map }
    turbulence 2.3
}

#declare Blue_Agate_Map =
color_map {
    [0.5  rgb <0.30, 0.30, 0.50>]
    [0.55 rgb <0.20, 0.20, 0.30>]
    [0.6  rgb <0.25, 0.25, 0.35>]
    [0.7  rgb <0.15, 0.15, 0.26>]
    [0.8  rgb <0.10, 0.10, 0.20>]
    [0.9  rgb <0.30, 0.30, 0.50>]
    [1.0  rgb <0.10, 0.10, 0.20>]
}

// a grey blue agate -- kind of purplish.
#declare Blue_Agate = 
pigment {
    agate
    color_map { Blue_Agate_Map }
}

#declare Sapphire_Agate_Map = 
color_map {
    [0.0  rgb <0.0, 0.0, 0.9>]
    [0.3  rgb <0.0, 0.0, 0.8>]
    [1.0  rgb <0.0, 0.0, 0.4>]
}


// Deep blue agate -- almost glows.
#declare Sapphire_Agate = 
pigment { 
    agate
    color_map { Sapphire_Agate_Map }
}

#declare Brown_Agate_Map =
color_map {
    [0.0 rgb 0]
    [0.5 rgb <0.9, 0.7, 0.6>]
    [0.6 rgb <0.9, 0.7, 0.4>]
    [1.0 rgb <0.7, 0.4, 0.2>]
}

// Brown and white agate -- very pretty.
#declare Brown_Agate = 
pigment {
    agate
    color_map { Brown_Agate_Map }
}

#declare Pink_Granite_Map =
color_map {
    [0.4  rgb 0]
    [0.4  rgb <0.85, 0.85, 0.95>]
    [0.45 rgb <0.85, 0.85, 0.95>]
    [0.5  rgb <0.75, 0.75, 0.75>]
    [0.55 rgb <0.82, 0.57, 0.46>]
    [0.8  rgb <0.82, 0.57, 0.46>]
    [1.0  rgb <1.00, 0.50, 0.00>]
}

#declare Pink_Granite =  
pigment {
    granite
    color_map { Pink_Granite_Map }
}

//*****************************************************************************
//                      STONE TEXTURES
//*****************************************************************************

// Gray-pink alabaster or marble.  Layers are scaled for a unit object
// and relative to each other.
// NOTE: This texture has very tiny dark blue specks that are often
//       mistaken for rendering errors.  They are not errors.  Just a
//       strange texture design.
#declare PinkAlabaster =
// Underlying surface is very subtly mottled with bozo
texture {
    pigment {
        bozo
        turbulence 0.25
        color_map {
            [0 rgb <0.9, 0.75, 0.75>]
            [1 rgb <0.6, 0.6,  0.6 >]
        }
    scale 0.4
    }
    finish{ ambient 0.25 }
}

// Second layer texture has some transmit values, yet a fair amount of color
// Viening is kept quite thin in color map and by the largish scale.
texture {
    pigment {
        granite
        color_map {
            [0.0 rgbt <0.52, 0.39, 0.39, 1.0>]
            [0.9 rgbt <0.52, 0.39, 0.39, 0.5>]
            [0.9 rgbt <0.42, 0.14, 0.55, 0.0>]
        }
    scale 2  
    }
    finish {
        specular 1   
        roughness 0.0001
        phong 0.25
        phong_size 75
        brilliance 4
    }
}


//*****************************************************************************
//                           SKY PIGMENTS
//*****************************************************************************
#declare Blue_Sky_Map =
color_map {
    [0.5 rgb <0.25, 0.25, 0.5>]
    [0.6 rgb 0.7]
    [1.0 rgb 0.3]
}

// Basic Blue Sky w/ clouds.
#declare Blue_Sky = 
pigment {
    bozo
    color_map { Blue_Sky_Map }
    turbulence 0.3
}

// Bright Blue Sky w/ very white clouds.
#declare Bright_Blue_Sky = 
pigment {
    bozo
    turbulence 0.56
    color_map {
        [0.5 rgb <0.5, 0.5, 1.0>]
        [0.6 rgb 1.0]
        [1.0 rgb 0.5]
    }
}

// Another sky
#declare Blue_Sky2 =
pigment {
    agate
    color_map {
        [0.3 rgb <0, 0, 1>]
        [1.0 rgb 1]
    }
    scale .75
}

// Small puffs of white clouds
#declare Blue_Sky3 = 
pigment {
    granite
    turbulence 0.1
    color_map {
        [0.3 rgb <0, 0, 1>]
        [1.0 rgb 1]
    }
    scale .75
}

// Red sky w/ yellow clouds -- very surreal.
#declare Blood_Sky = 
pigment {
    bozo
    turbulence 0.5
    color_map {
        [0.0 rgb <0.9, 0.700, 0.0>]
        [0.5 rgb <0.3, 0.200, 0.0>]
        [0.5 rgb <0.6, 0.025, 0.0>]
        [0.6 rgb <0.9, 0.700, 0.0>]
        [0.6 rgb <0.6, 0.025, 0.0>]
    }
}

// Black sky with red and purple clouds 
// Try adding turbulence values from 0.1 - 5.0 -- CdW
#declare Apocalypse = 
pigment {
    bozo
    color_map {
        [0.0 rgb <0.8, 0.0, 0.0>]
        [0.4 rgb <0.4, 0.0, 0.4>]
        [0.6 rgb <0.0, 0.0, 0.2>]
        [1.0 rgb 0.0]
    }
}

// White clouds w/ transparent sky.
#declare Clouds = 
pigment {
    bozo
    color_map {
        [0.1 rgbt <0.8, 0.8, 0.8, 0.0>]
        [0.5 rgbt <1.0, 1.0, 1.0, 1.0>] 
    }
}

#declare FBM_Clouds =
pigment {
    bozo
    turbulence 0.65
    octaves 6
    omega 0.7
    lambda 2
    color_map {
        [0.0 rgb 0.85]
        [0.1 rgb 0.75]
        [0.5 rgbt 1]
    }
    scale <6, 1, 6>
}

#declare Shadow_Clouds =
texture {                          // The blue sky background for the clouds 
    pigment { rgb <0.196078, 0.6, 0.8> }
    finish { ambient 0.7 diffuse 0 }
}
texture {                          // The upper part of the clouds
    pigment { FBM_Clouds }
    finish { ambient 1.0 diffuse 0 }
}
texture {                          // The darker underside of the clouds
    pigment { FBM_Clouds  translate -0.15*y }
    finish { ambient 0.6 diffuse 0 }
}



//*****************************************************************************
//                           WOODEN PIGMENTS
//*****************************************************************************

// Several wooden pigments by Tom Price:
// A light reddish wood.
#declare Cherry_Wood =
pigment {
    wood
    turbulence 0.3
    color_map {
        [0.8 rgb <0.66, 0.31, 0.20>]
        [0.8 rgb <0.40, 0.13, 0.06>]
        [1.0 rgb <0.20, 0.06, 0.03>]
    }
}

// A light tan wood with,ish rings.
#declare Pine_Wood = 
pigment {
    wood
    turbulence 0.2
    color_map {
        [0.8 rgb <1.0, 0.72, 0.25>]
        [0.8 rgb <0.5, 0.50, 0.06>]
        [1.0 rgb <0.4, 0.40, 0.03>]
    }
}

// Dark wood with a,ish hue to it.
#declare Dark_Wood = 
pigment {
    wood
    turbulence 0.2
    color_map {
        [0.8 rgb <0.43, 0.24, 0.05>]
        [0.8 rgb <0.40, 0.33, 0.06>]
        [1.0 rgb <0.20, 0.03, 0.03>]
    }
}

// Light tan wood with brown rings.
#declare Tan_Wood = 
pigment {
    wood
    turbulence 0.1
    color_map {
        [0.8 rgb <0.88, 0.60, 0.30>]
        [0.8 rgb <0.60, 0.40, 0.20>]
        [1.0 rgb <0.40, 0.30, 0.20>]
    }
}

// A very pale wood with tan rings -- kind of balsa-ish.
#declare White_Wood = 
pigment {
    wood
    turbulence 0.6
    color_map {
        [0.0 rgb <0.93, 0.71, 0.53>]
        [0.8 rgb <0.98, 0.81, 0.60>]
        [0.8 rgb <0.60, 0.33, 0.27>]
        [1.0 rgb <0.70, 0.60, 0.23>]
    }
}

// Brown wood - looks stained.
#declare Tom_Wood = 
pigment {
    wood
    turbulence 0.31
    color_map {
        [0.8 rgb < 0.7, 0.3, 0.0>]
        [0.8 rgb < 0.5, 0.2, 0.0>]
        [1.0 rgb < 0.4, 0.1, 0.0>]
    }
}

// The scaling in these definitions is relative to a unit-sized object
// (radius 1).  Note that woods are functionally equivilent to a log lying
// along the z axis.  For best results, think like a woodcutter trying to
// extract the nicest board out of that log.  A little tilt along the x axis
// will give elliptical rings of grain like you'd expect to find on most
// boards.  Experiment.
// (The first five came from DODEC2.POV in the POV Scenefile Library.)
#declare DMFWood1 = 
pigment {
    wood
    turbulence 0.04
    octaves 3
    scale <0.05, .05, 1>
    color_map {
        [0.1 rgb <0.60, 0.30, 0.18>]
        [0.9 rgb <0.30, 0.15, 0.09>]
    }
}

#declare DMFWood2 = 
pigment {
    wood
    turbulence 0.03
    octaves 4
    scale <0.05, .05, 1>
    color_map {
        [0.1 rgb <0.52, 0.37, 0.26>]
        [0.9 rgb <0.42, 0.26, 0.15>]
    }
}

#declare DMFWood3 = 
pigment {
    wood
    turbulence 0.05
    octaves 2
    scale <0.05, .05, 1>
    color_map {
        [0.1 rgb <0.4, 0.133, 0.066>]
        [0.9 rgb <0.2, 0.065, 0.033>]
    }
}

#declare DMFWood4 =
pigment {
    wood
    turbulence 0.04
    octaves 3
    scale <0.05, .05, 1>
    color_map {
        [0.1 rgb <0.888, 0.600, 0.3>]
        [0.9 rgb <0.600, 0.400, 0.2>]
    }
}

#declare DMFWood5 = 
pigment {
    wood
    turbulence 0.05
    octaves 6
    scale <0.075, .075, 1>
    color_map {
        [0.1 rgb <0.30, 0.10, 0.050>]
        [0.9 rgb <0.25, 0.07, 0.038>]
    }
}

// This is a three-layer wood texture.  Renders rather slowly because of
// the transparent layers and the two layers of turbulence, but it looks
// great.  Try other colors of "varnish" for simple variations.  
#declare DMFWood6 = 
texture {
    pigment {
        wood  turbulence 0.04
        octaves 3
        scale <0.05, .05, 1>
        color_map { 
            [0.1 rgb <0.88, 0.60, 0.4>]
            [0.9 rgb <0.60, 0.40, 0.3>]
        }
    }
    finish { 
        specular 0.25
        roughness 0.05
        ambient 0.45 
        diffuse 0.33
        reflection 0.15
    }
}
texture {
    pigment {
        wood  turbulence <0.1, 0.5, 1> 
        octaves 5
        lambda 3.25
        scale <0.15, .5, 1>
        color_map { 
            [0.0 rgbt <0.7, 0.6, 0.4, 0.100>]
            [0.1 rgbt <0.8, 0.6, 0.3, 0.500>]
            [0.1 rgbt <0.8, 0.6, 0.3, 0.650>]
            [0.9 rgbt <0.6, 0.4, 0.2, 0.975>]
            [1.0 rgbt <0.6, 0.4, 0.2, 1.000>]
        }
    rotate <5, 10, 5>
    translate -x*2
    }
    finish { 
        specular 0.25 
        roughness 0.0005
        ambient .1 
        diffuse 0.33
    } 
}
// A "coat of varnish" to modify the overall color of the wood
texture {
    pigment { rgbt <0.75, 0.15, 0.0, 0.95> }
    finish { 
        specular 0.25
        roughness 0.01
        ambient 0
        diffuse 0.33
    }
}




// Is this really oak?  I dunno.  Quite light, maybe more like spruce.
#declare DMFLightOak =  
pigment {
    wood
    turbulence 0.05            // For best results,  keep this low!
    scale <0.2, 0.2, 1>        // Scaled for a unit object
    color_map {
        [0.1 rgb <0.42, 0.26, 0.15>]
        [0.9 rgb <0.52, 0.37, 0.26>]
    }
}

// Looks like old desk oak if used correctly.
#declare DMFDarkOak = 
pigment {
    wood
    turbulence 0.04            // For best results,  keep this low!
    octaves 3
    scale <0.2, 0.2, 1>        // Scaled for a unit object
    color_map {
        [0.1 rgb <0.60, 0.30, 0.18>]
        [0.9 rgb <0.30, 0.15, 0.09>]
    }
}

// Wood by Eric Barish
#declare EMBWood1 = 
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


//   Doug Otwell woods
//   Yellow pine, close grained
//
#declare Yellow_Pine = 
texture {
    pigment {
        wood
        turbulence 0.02
        color_map {
            [0.222 rgb <0.808, 0.671, 0.251>]
            [0.342 rgb <0.600, 0.349, 0.043>]
            [0.393 rgb <0.808, 0.671, 0.251>]
            [0.709 rgb <0.808, 0.671, 0.251>]
            [0.821 rgb <0.533, 0.298, 0.027>]
            [1.000 rgb <0.808, 0.671, 0.251>]
        }
    scale 0.1
    translate <10, 0, 0>
    }
}
// Yellow_Pine layer 2
texture {
    pigment {
        wood
        turbulence 0.01
        color_map {
            [0.000 rgbt <1.000, 1.000, 1.000, 1.000>]
            [0.120 rgbt <0.702, 0.467, 0.118, 0.608>]
            [0.496 rgbt <1.000, 1.000, 1.000, 1.000>]
            [0.701 rgbt <1.000, 1.000, 1.000, 1.000>]
            [0.829 rgbt <0.702, 0.467, 0.118, 0.608>]
            [1.000 rgbt <1.000, 1.000, 1.000, 1.000>]
        }
    scale 0.5 
    translate <10, 0, 0>
    }
}

//
//   Rosewood
//
#declare Rosewood = 
texture {
    pigment {
        bozo
        turbulence 0.04
        color_map {
            [0.000 rgb <0.204, 0.110, 0.078>]
            [0.256 rgb <0.231, 0.125, 0.090>]
            [0.393 rgb <0.247, 0.133, 0.090>]
            [0.581 rgb <0.204, 0.110, 0.075>]
            [0.726 rgb <0.259, 0.122, 0.102>]
            [0.983 rgb <0.231, 0.125, 0.086>]
            [1.000 rgb <0.204, 0.110, 0.078>]
        }
    scale <0.5, 0.5, 1>
    translate <10, 0, 0>
    }
    finish {
        ambient 0.5
        diffuse 0.8
    }
}
// Rosewood layer 2
texture {
    pigment {
        wood
        turbulence 0.04
        color_map {
            [0.000 rgbt <0.545, 0.349, 0.247, 1.000>]
            [0.139 rgbt <0.000, 0.000, 0.000, 0.004>]
            [0.148 rgbt <0.000, 0.000, 0.000, 0.004>]
            [0.287 rgbt <0.545, 0.349, 0.247, 1.000>]
            [0.443 rgbt <0.545, 0.349, 0.247, 1.000>]
            [0.626 rgbt <0.000, 0.000, 0.000, 0.004>]
            [0.635 rgbt <0.000, 0.000, 0.000, 0.004>]
            [0.843 rgbt <0.545, 0.349, 0.247, 1.000>]
        }
    scale <0.5, 0.5, 1>
    translate <10, 0, 0>
    }
    finish {
        ambient 0.5
        diffuse 0.8
    }
}

//
//   Sandalwood ( makes a great burled maple, too)
//
#declare Sandalwood = 
texture {
    pigment {
        bozo
        turbulence 0.2
        color_map {
            [0.000 rgb <0.725, 0.659, 0.455>]
            [0.171 rgb <0.682, 0.549, 0.420>]
            [0.274 rgb <0.557, 0.451, 0.322>]
            [0.393 rgb <0.725, 0.659, 0.455>]
            [0.564 rgb <0.682, 0.549, 0.420>]
            [0.701 rgb <0.482, 0.392, 0.278>]
            [1.000 rgb <0.725, 0.659, 0.455>]
        }
    scale <0.2, 0.2, 1>
    scale 2
    }
}
// Sandalwood layer 2
texture {
    pigment {
        bozo
        turbulence 0.8
        color_map {
            [0.000 rgbt <0.682, 0.604, 0.380, 1.000>]
            [0.087 rgbt <0.761, 0.694, 0.600, 0.020>]
            [0.226 rgbt <0.635, 0.553, 0.325, 1.000>]
            [0.348 rgbt <0.761, 0.694, 0.600, 0.020>]
            [0.496 rgbt <0.682, 0.604, 0.380, 1.000>]
            [0.565 rgbt <0.761, 0.694, 0.600, 0.020>]
            [0.661 rgbt <0.682, 0.604, 0.380, 1.000>]
            [0.835 rgbt <0.761, 0.694, 0.600, 0.020>]
            [1.000 rgbt <0.682, 0.604, 0.380, 1.000>]
        }
    scale 0.4
    }
}


//*****************************************************************************
//                           GLASS TEXTURES
//*****************************************************************************

/* Note: New in POV-Ray 3.1, the "ior" keyword is supposed to be 
         specified in the new "interior{...}" statement.  
  
         Under POV-Ray 3.0x and prior, the "refraction" keyword served
         two puropses.  
           1) Turn on refraction: this is no longer necessary.  Any use
              of the "ior" keyword with a value other than 1.0 will
              turn on refraction.
           2) Attenuate transparency: Values of "refraction" that are
              between 0.0 and 1.0 would attenuate or darken the amount
              of light passing through.  The same effect can be obtained
              by adjusting the filter value.  A more realistic effect
              can be obtained using the new "fade_power" and "fade_distance"
              keywords in the "interior" statement.
         These textures and finishes should still work under POV-Ray 3.1
         but any new textures you create should make use of the new syntax.
 */
/*Modified for POV 3.5, added glass materials
More realistic results can be obtained if a perfectly clear pigment is used,
and either absorbing media or fade_color are used to color the glass.*/

#declare Glass_Finish=
finish {
    specular 1
    roughness 0.001
    ambient 0
    diffuse 0
    reflection 0.1
 #if (version<3.1)
    ior 1.5
 #end
}

#declare Glass_Interior = interior {ior 1.5}

#declare Glass = 
texture {
    pigment { rgbf<1.0, 1.0, 1.0, 0.7> }
    finish  { Glass_Finish }
}
#declare M_Glass = material {texture {Glass} interior {Glass_Interior}}

// Probably more of a "Plexiglas" than glass
#declare Glass2 = 
texture {
    pigment { rgbf <1,1,1,1> }
    finish {
        ambient 0
        diffuse 0
        reflection 0.5
        phong 0.3
        phong_size 60
    }
}
#declare M_Glass2 = material {texture {Glass2} interior {Glass_Interior}}

// An excellent lead crystal glass!
#declare Glass3 = 
texture {
    pigment { rgbf <0.98, 0.98, 0.98, 0.9> }
    finish  {
        ambient 0.1
        diffuse 0.1
        reflection 0.1
        specular 0.8
        roughness 0.0003
        phong 1 
        phong_size 400
     }
}
#declare M_Glass3 = material {texture {Glass3} interior {Glass_Interior}}

#declare Green_Glass = 
texture {
    Glass3
    pigment { rgbf <0.8, 1, 0.95, 0.9> }
}
#declare M_Green_Glass = material {texture {Green_Glass} interior {Glass_Interior}}

// Glass textures contributed by Norm Bowler, of Richland WA 
#declare NBglass =
texture {
    pigment { rgbf <0.98, 1.0, 0.99, 0.75> }
    finish {
        ambient 0.1
        diffuse 0.1
        reflection .25
        specular 1
        roughness .001
 #if (version<3.1)
    ior 1.5
 #end
    }
}
#declare M_NB_Glass = material {texture {NBglass} interior {Glass_Interior}}


#declare NBoldglass=
texture { 
    NBglass
    pigment { rgbf <0.8, 0.9, 0.85, 0.85> }
}
#declare M_NB_Old_Glass = material {texture {NBoldglass} interior {Glass_Interior}}

#declare NBwinebottle=
texture { 
    NBglass
    pigment { rgbf <0.4, 0.72, 0.4, 0.6> }
}
#declare M_NB_Winebottle_Glass = material {texture {NBwinebottle} interior {Glass_Interior}}

#declare NBbeerbottle=
texture { 
    NBglass
    pigment { rgbf <0.7, 0.5, 0.1, 0.6> }
}
#declare M_NB_Beerbottle_Glass = material {texture {NBbeerbottle} interior {Glass_Interior}}

// A few color variations on Norm's glass
// Ruby glass
#declare Ruby_Glass =
texture { 
    NBglass
    pigment { rgbf <0.9, 0.1, 0.2, 0.8> }
}
#declare M_Ruby_Glass = material {texture {Ruby_Glass} interior {Glass_Interior}}

// Dark, green glass
#declare Dark_Green_Glass=
texture { 
    NBglass
    pigment { rgbf <0.1, 0.7, 0.8, 0.8> }
}
#declare M_Dark_Green_Glass = material {texture {Dark_Green_Glass} interior {Glass_Interior}}

// Yellow glass
#declare Yellow_Glass=
texture { 
    NBglass
    pigment { rgbf <0.8, 0.8, 0.2, 0.8> }
}
#declare M_Yellow_Glass = material {texture {Yellow_Glass} interior {Glass_Interior}}

// Orange/Amber glass
#declare Orange_Glass=
texture { 
    NBglass
    pigment { rgbf <1.0, 0.5, 0.0, 0.8> }
}
#declare M_Orange_Glass = material {texture {Orange_Glass} interior {Glass_Interior}}

// Vicks bottle, glass
#declare Vicks_Bottle_Glass=
texture { 
    NBglass
    pigment { rgbf <0.1, 0.15, 0.5, 0.9> }
}
#declare M_Vicks_Bottle_Glass = material {texture {Vicks_Bottle_Glass} interior {Glass_Interior}}

//*****************************************************************************
//                           METAL FINISHES
//*****************************************************************************

#declare Metal =
finish {
    metallic
    ambient 0.2
    diffuse 0.7
    brilliance 6
    reflection 0.25
    phong 0.75
    phong_size 80
}

//*****************************************************************************
//                           METAL TEXTURES
//*****************************************************************************


// Good looking "metal" textures
#declare Chrome_Texture = 
texture {
    pigment { rgb <0.658824, 0.658824, 0.658824> }
    finish {
        ambient 0.3
        diffuse 0.7
        reflection 0.15
        brilliance 8
        specular 0.8
        roughness 0.1
    }
}

// A series of metallic textures using the Metal finish:
#declare Brass_Texture  = texture { pigment{ rgb <0.71, 0.65, 0.26>} finish{ Metal }}
#declare Gold_Texture   = texture { pigment{ rgb <0.85, 0.85, 0.10>} finish{ Metal }}
#declare Bronze_Texture = texture { pigment{ rgb <0.55, 0.47, 0.14>} finish{ Metal }}
#declare Copper_Texture = texture { pigment{ rgb <0.72, 0.45, 0.20>} finish{ Metal }}
#declare Silver_Texture = texture { pigment{ rgb <0.90, 0.91, 0.98>} finish{ Metal }}

// In the future, please refer to Chrome_Texture by this name.  I'd like
// to scrap the old name someday. Ditto with other "_Texture" names!
#declare Chrome_Metal = texture { Chrome_Texture }
#declare Brass_Metal  = texture { Brass_Texture  }
#declare Bronze_Metal = texture { Bronze_Texture }
#declare Gold_Metal   = texture { Gold_Texture   }
#declare Silver_Metal = texture { Silver_Texture }
#declare Copper_Metal = texture { Copper_Texture }

// A couple highly reflective metal textures.
#declare Polished_Chrome = 
texture {
    pigment { rgb <0.2, 0.2, 0.2> }
    finish {
        ambient 0.1
        diffuse 0.7
        brilliance 6.0
        reflection 0.6
        phong 0.8
        phong_size 120
    }
}

#declare Polished_Brass = 
texture {
    pigment { rgb <0.578, 0.422, 0.195> }
    finish {
        metallic
        ambient 0.1
        diffuse 0.8
        brilliance 6.0
        reflection 0.4
        phong 0.8
        phong_size 120
   }
}


// Beautiful military brass texture!
#declare New_Brass = 
texture {
    pigment { rgb <0.70, 0.56, 0.37> }
    finish {
        ambient 0.35
        diffuse 1.0
        brilliance 15
        phong 0.41
        phong_size 5
    }
}


// Spun Brass texture for cymbals & such
#declare Spun_Brass = 
texture { 
    New_Brass
    normal { waves 0.35 frequency 2 scale 0.01 }
}

// Brushed aluminum (brushed along X axis)
#declare Brushed_Aluminum = 
texture {
    Chrome_Metal
    normal {
        bumps -0.5
        scale <1, 0.001, 0.001>
    }
}


#declare SilverFinish =
finish {
    metallic
    ambient 0.25
    diffuse 0.65
    reflection 0.45
    brilliance 6
    phong 1
    phong_size 100
}


// Each of these looks good.  Slightly,r as you go down
#declare Silver1_Colour = color  rgb <0.94, 0.93, 0.83>;
#declare Silver2_Colour = color  rgb <0.94, 0.93, 0.86>;
#declare Silver3_Colour = color  rgb <0.94, 0.93, 0.90>;

#declare Silver1 = 
texture {
    pigment { Silver1_Colour }
    finish { SilverFinish }
}

#declare Silver2 = 
texture {
    pigment { Silver2_Colour }
    finish { SilverFinish }
}

#declare Silver3 = 
texture {
    pigment { Silver3_Colour }
    finish { SilverFinish }
}


// Interesting texture -- Give it a try.
// Sort of a "rgb <0.0, 0.0, 0.0> Hills Gold", black, white, and orange specks or splotches.
#declare Brass_Valley = 
texture {
    pigment {
        granite
        color_map {
            [0.3 rgb <0.82, 0.57, 0.46>]
            [0.3 rgb <0.00, 0.00, 0.00>]
            [0.6 rgb <0.85, 0.85, 0.95>]
            [0.6 rgb <0.82, 0.57, 0.46>]
            [1.0 rgb <0.85, 0.85, 0.95>]
        }
    }
    finish {
        metallic
        brilliance 6.0
        reflection 0.75
        phong 0.75
    }
}

#declare Rust =
texture { 
    pigment {
        granite
        color_map {
            [0.0 rgb <0.89, 0.51, 0.28>]
            [0.4 rgb <0.70, 0.13, 0.00>]
            [0.5 rgb <0.69, 0.41, 0.08>]
            [0.6 rgb <0.49, 0.31, 0.28>]
            [1.0 rgb <0.89, 0.51, 0.28>]
        }
    }
    finish { ambient 0.2 diffuse 0.4 }
}

#declare Rusty_Iron = 
texture {
    pigment {
        granite
        color_map {
            [0.0 rgb <0.42, 0.20, 0.20>]
            [0.5 rgb <0.50, 0.50, 0.02>]
            [0.6 rgb <0.60, 0.20, 0.20>]
            [0.6 rgb <0.30, 0.20, 0.20>]
        }
    }
    finish { ambient 0.2 diffuse 0.6 }
    normal { wrinkles 1 scale 0.1 }
}


#declare Soft_Silver = 
texture {
    pigment { Silver1_Colour }
    finish {
        metallic
        ambient 0.2
        diffuse 0.35
        specular 0.85
        roughness 0.01
        reflection 0.45
        brilliance 1.5
    }
}

#declare Metallic_Finish =
    finish {
        metallic
        ambient 0.1
        diffuse 0.65
        specular 0.85
        roughness 0.01
        reflection 0.45
        brilliance 1.5
    }

#declare New_Penny = 
texture {
    pigment { rgb <0.6, 0.45, 0.4> }
    finish { Metallic_Finish }
}

#declare Tinny_Brass = 
texture {
    pigment { rgb <0.70, 0.56, 0.37> }
    finish { Metallic_Finish }
}

#declare Gold_Nugget = 
texture {
    pigment { rgb <0.5, 0.35, 0.25> }
    finish { Metallic_Finish }
}

#declare Aluminum  = 
texture {
    pigment { rgb <0.55, 0.5, 0.45> }
    finish { Metallic_Finish }
}

#declare Bright_Bronze  = 
texture {
    pigment { rgb <0.36, 0.28, 0.20> }
    finish { Metallic_Finish }
}


//*****************************************************************************
//                    SPECIAL EFFECTS
//*****************************************************************************

// Red & white stripes - Looks best on a y axis Cylinder
// It "spirals" because it's gradient on two axis
#declare Candy_Cane = 
pigment {
    gradient x+y
    color_map {
        [0.25 rgb <1,0,0>]
        [0.25 rgb <1,1,1>]
        [0.75 rgb <1,1,1>]
        [0.75 rgb <1,0,0>]
    }
}

// Orange and Clear stripes spiral around the texture
// to make an object look like it was "Peeled"
// Now, you too can be M.C. Escher 
#declare Peel = 
pigment {
    gradient x+y
    color_map {
        [0.25 rgbf <1.0, 0.5, 0.0, 0.0>]
        [0.25 rgbf <1.0, 1.0, 1.0, 1.0>]
        [0.75 rgbf <1.0, 1.0, 1.0, 1.0>]
        [0.75 rgbf <1.0, 0.5, 0.0, 0.0>]
    }
}

#declare Y_Gradient = 
pigment {
    gradient y
    color_map {
        [0.00  rgb <1,0,0>]
        [0.33  rgb <0,0,1>]
        [0.66  rgb <0,1,0>]
        [1.00  rgb <1,0,0>]
    }
}

#declare X_Gradient = 
pigment {
    gradient x
    color_map {
        [0.00 rgb <1,0,0>]
        [0.33 rgb <0,0,1>]
        [0.66 rgb <1,1,1>]
    }
}

// Wavy water 
// Requires a sub-plane, and may require scaling to fit your scene.
//A far better water texture can be done using a perfectly clear pigment
//and fade_color or absorbing media in the interior.

#declare Water =
texture {
    pigment{ rgbf <0.0, 0.0, 1.0, 0.9> }
    normal {
        ripples 0.75
        frequency 10
    }
    finish {
        reflection {0.3, 1 fresnel}
        conserve_energy
    }
}
#declare Water_Int =
interior {
    ior 1.33
}

#declare M_Water =
material {
    texture {Water}
    interior {Water_Int}
}

#declare Cork =
texture {
    pigment {
        granite
        color_map {
            [0.00 rgb <0.93, 0.71, 0.532>]
            [0.60 rgb <0.98, 0.81, 0.60>]
            [0.60 rgb <0.50, 0.30, 0.20>]
            [0.65 rgb <0.50, 0.30, 0.20>]
            [0.65 rgb <0.80, 0.53, 0.46>]
            [1.00 rgb <0.85, 0.75, 0.35>]
        }
    }
    finish{ 
        specular 0.1 
        roughness 0.5 
    }
    scale 0.25     // Generally looks best scaled longer on one axis
}

//The correct spelling is "Lightning", not "Lightening"

#declare Lightning_CMap1 =  
color_map {
    [0.00 rgbf <1,1,1,0>]
    [0.15 rgbf <0.94, 0.81, 0.99, 0.65>]
    [0.25 rgbf <0.94, 0.81, 0.99, 0.65>]
    [0.30 rgbf <0.87, 0.58, 0.98, 0.85>]
    [0.40 rgbf <0.87, 0.58, 0.98, 0.85>]
    [0.45 rgbf <0.73, 0.16, 0.96, 0.95>]
}

#declare Lightning1 = 
texture {
    pigment {
        marble
        color_map { Lightning_CMap1 }
        turbulence 0.5
    }
    finish { ambient 1 }
}


#declare Lightning_CMap2 =  
color_map {
    [0.00 rgbf <1,1,1,0>]
    [0.10 rgbf <0.94, 0.81, 0.99, 0.65>]
    [0.20 rgbf <0.94, 0.81, 0.99, 0.65>]
    [0.30 rgbf <0.87, 0.58, 0.98, 0.85>]
    [0.45 rgbf <0.87, 0.58, 0.98, 0.85>]
    [0.65 rgbf <0.73, 0.16, 0.96, 0.95>]
}

#declare Lightning2 = 
texture {
    pigment {
        granite
        color_map { Lightning_CMap2 }
        turbulence 0.5
    }
    finish { ambient 1 }
}

// Starfield, by Jeff Burton
#declare Starfield = 
texture {
    pigment {
        granite  
        color_map {
            [0.72 rgb 0.00 ] // No Stars in this area
            [0.72 rgb 0.20 ] // Very Very Faint Stars
            [0.75 rgb 0.40 ] // Very Very Faint Stars
            [0.78 rgb 0.60 ] // Very Faint Stars
            [0.81 rgb 0.80 ] // Faint Stars
            [0.85 rgb 0.95 ] // Medium White Stars
            [0.91 rgb 1.00 ] // White Stars 
            [0.91 rgb 0.00 ] // No Stars in this area
        }
    scale .015
    }
    finish { ambient 1 }
}

// Irregular_Bricks_Ptrn() authors: Ron Parker and Rune S. Johansen
/* Irregular_Bricks_Ptrn( Mortar Thickness, X-scaling, Variation, Roundness )
This function pattern creates a pattern of bricks of varying lengths on the x-y plane.
This can be useful in building walls that don't look like they were built by a computer.
Note that mortar thickness between bricks can vary somewhat, too.

Mortar Thickness: How thick the mortar should be (0-1)
       X-scaling: The scaling of the bricks (but not the mortar) in the x direction
       Variation: The amount by which brick lengths will vary (0=none, 1=100%)
       Roundness: The roundness of the bricks (0.01=almost rectangular, 1.0=very round)

Sample code:
plane {-z, 0
   texture {
      pigment {
         Irregular_Bricks_Ptrn (0.1, 1, 0.5, 0.5)
         color_map {
            [0.01, rgb 0.9]
            [0.01, rgb 0.6]
         }
      }
      normal {
         Irregular_Bricks_Ptrn (0.1, 1, 0.5, 0.5) 2
      }
   }
}*/
#macro Irregular_Bricks_Ptrn (T, S, V, R)
   #local FunctionXGrad =
   function {
      pattern {
         gradient x triangle_wave
         warp {turbulence V*x octaves 1}
         warp {planar z 0}
         warp {repeat z offset< 0.5, 5, 0>}
         rotate -90*x
      }
   }
   #local FunctionYGrad =
   function {
      pattern {
         gradient y triangle_wave
         translate 0.5*y
      }
   }
   function {
      pow
      (1-min(1,
         (
            +pow(FunctionXGrad(x/S,y,z)*(1+T/S),1/R*2)
            +pow(FunctionYGrad(x/S,y,z)*(1+T  ),1/R*2)
         )
      ),R/2)
   }
#end


// Hex_Tiles_Ptrn() authors: Ron Parker and Juha Nieminen
#macro Hex_Tiles_Ptrn()
    #local G =
    pigment {gradient x
        color_map {[0 rgb 1][1 rgb 0]}
        scale sqrt(3)/2+.001
    }
    #local B =
    pigment {radial
        pigment_map {
            #local I = 0;
            #while(I<6)
                [I/6 G rotate(30+60*I)*y]
                [(I+1)/6 G rotate(30+60*I)*y]
                #local I = I + 1;
            #end
        }
    }
    pigment_pattern {
        #local T2 = sqrt(3)/2;
        radial
        pigment_map {
            [0   B translate < 0.5,0,-T2>]
            [1/3 B translate < 0.5,0,-T2>]
            [1/3 B translate <-1.0,0,  0>]
            [2/3 B translate <-1.0,0,  0>]
            [2/3 B translate < 0.5,0, T2>]
            [1   B translate < 0.5,0, T2>]
        }
        translate x
        warp {repeat 1.5*x flip x}
        warp {repeat.5*sqrt(3)*z flip z}
    }
#end

// Tiles_Ptrn() author: Rune S. Johansen
#macro Tiles_Ptrn()
   boxed scale 0.5 translate <0.5,0.5,0>
   warp {repeat x} warp {repeat y} warp {planar z, 0}
#end


// Star_Ptrn() author: Ron Parker
/* Star pattern 
This macro creates a pattern that resembles a star. It can be used together with
color_maps, pigment_maps, texture_maps etc. The pattern is in the X-Z plane,
centered around the origin.
           
 Star_Ptrn( Radius, Points, Skip )
           
     Radius: the radius of a circle drawn through the points
             of the star
     Points: the number of points on the star.
       Skip: the number of points to skip when drawing lines between
             points to form the star.  A normal 5-pointed star skips 
             2 points.  A Star of David also skips 2 points.  
             Skip must be less than <Points>/2 and greater than 0.  
             Integers are preferred but not required.  Skipping 1 
             point makes a regular polygon with <Points> sides.
      
 Example usage: (This creates a five-pointed star as on a US flag)
      pigment {
         Star_Ptrn(1,5,2)
         color_map {[0,rgb 1][1,blue 0.5]}
      }*/

#macro Star_Ptrn(SR, NP, SP)
    #local P =
    pigment {radial
        #local PA = 0.5-(SP/NP);
        pigment_map {
            [.5-PA/2 rgb 0]
            [.5-PA/2 rgb 1]
            [.5+PA/2 rgb 1]
            [.5+PA/2 rgb 0]
        }
        translate SR*x
    }
    pigment_pattern {radial
        pigment_map {
            #local I=0;
            #while(I<NP)
                [(I+.5)/NP P rotate I*360/NP*y]
                [(I+.5)/NP P rotate(I+1)*360/NP*y]
                #local I = I + 1;
            #end
        }
        rotate -90*x +90*z
    }
#end

#version Textures_Inc_Temp;
#end