This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtextures.html
1279 lines (1278 loc) · 50.5 KB
/
textures.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<!-- Creation date: 01/03/02 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>textures.html</title>
<meta name="Author" content="Julian MacDonald">
</head>
<body style="background-color: rgb(248, 232, 158);">
<font face="tahoma" size="2">
</font>
<div align="left"><font face="tahoma" size="2"><a href="textures_and_materials.html"><b><font size="4">Previous:
Textures and Materials</font></b></a></font></div>
<font face="tahoma" size="2"><br>
</font>
<div align="right"><font face="tahoma" size="2"><a href="textures2.html"><b><font size="4">Next:
More Textures</font></b></a></font></div>
<font face="tahoma" size="2"><br>
<a name="textures"></a>
<font face="tahoma" size="6"><strong>4. Textures and Materials</strong></font>
<img src="man_title_small.jpg" align="middle"><br><br>
<br>
<br>
<strong><font color="#3300cc" size="5">4.1
Textures</font></strong><br>
<br>
Textures define the surface properties of 3D objects such as the
colour, reflectivity, transparency, bumpiness etc. There are 4 types of
texture in Art of Illusion: uniform, image-mapped, procedural 2-D
and procedural 3-D. These are all described in detail below. Select <b>Scene->Textures</b>
to define a new texture or to edit one you have already created. This
brings up the following dialogue box:<br>
<br>
<img src="textures/textures_dial.png">
<p>
The folders on the left list the textures and <a href="materials.html">materials</a>
in the current scene, as well as those in the texture library that comes with AOI.
In the middle of the window is a preview of whichever texture or material is
currently selected, and on the right are controls for editing the textures and
materials. Most of these are self explanatory. The controls under "Scene Functions"
are for working with the textures in the current scene. You can create a new
texture, create a duplicate of an existing texture, delete the selected texture,
or edit the selected texture. The controls under "Library Functions" are for
working with the library. You can copy a texture from the library to the current
scene (with <b>Load from Library</b>) or from the current scene to the library
(with <b>Save to Library</b>), delete a texture from the library, or add a new
file to the library. You also can copy textures between the library and the current
scene by dragging them between folders. <b>Show External File</b> is useful for copying textures
and materials between files. When you select this command, it prompts you to
select an AOI scene, which then appears on the left of the window as if it were
part of the built in library.
<p>
Once textures have been defined, they can be assigned to any 3-D object
and can be mapped in a desirable
way by altering their scaling, orientation and position relative to the
object. Textures can also be
layered to simulate complex real-world surfaces.<br>
<br>
<br>
<a name="uniform_tex"></a><strong><font color="#ff6633" size="4">4.1.1 Uniform Textures<br>
</font></strong><br>
Uniform textures are the simplest kind of texture in Art of Illusion.
They apply the various surface properties
uniformly to the whole object. To create a new uniform texture, Click
on <b>Scene -> Textures</b> and select <b>Uniform texture</b>
from the <b>New...</b> menu. This will bring up a dialogue box
similar to the one below:<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/uniform_texture_dial.jpg"></td>
<td> <br>
<table>
<tbody>
<tr>
<td width="350"><font face="tahoma" size="2">A rendered sphere at the top of the dialogue shows
the current texture
mapped to a sphere. Double-clicking over the preview will display a
pop-up menu as shown on the right:<br>
<br>
This allows the view to be changed and the 3D object used for the
preview to altered.<br>
<br>
The preview can also be zoomed via holding CTRL while dragging up and
down with the right mouse button
and panned by dragging the right mouse button.<br>
</font></td>
<td><img src="textures/texture_popup.jpg"></td>
</tr>
<tr>
<td width="350"><font face="tahoma" size="2">Below this are the various properties that can be
changed. There are 4 colours that can be defined. Simply click on the
colour bar to the right of each colour property. This will bring up the
colour chooser dialogue shown on the right.<br>
<br>
<a name="colour_chooser"></a>Colours are
defined through this dialogue using one of 3 <b>Color Models</b>:
Hue, Saturation and Value
(<b>HSV</b>), Red, Green and Blue (<b>RGB</b>) or Hue, Saturation and Lightness
(<b>HSL</b>). Each colour component can be set to a value according to the
selected <b>Component Range</b> (0-1 or 0-255).<br>
<br>
Recent colours are also available for selection via the
palette at the bottom.<br>
<br>
The 4 colour properties are: <br>
</font></td>
<td><img src="textures/colour_chooser.jpg"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<b>Diffuse Colour</b><br>
This is the basic underlying colour of the object. In the absence of
any other properties, the object looks this colour.<br>
<br>
<b>Specular Colour</b><br>
Specularity is the 'shininess' or reflectiveness of the object. The
colour specified here defines which
colour is reflected by the object. Note, however, that this has no
effect unless the specularity value
is greater than zero (see below).<br>
<br>
<b>Transparent Colour</b><br>
If the transparency of the object is greater than zero, then this
colour is that which is transmitted when
light passes through the object (see below).<br>
<br>
<b>Emissive Colour</b><br>
This property is used to simulate glowing objects. This is the colour
that is emitted by the object.
Some examples are shown below. In these examples, the Hue and
Saturation of the diffuse colour were
used for the Emission Colour with varying amounts of Value. Note that
the quantity of emitted light is directly related to the Value in the
HSV colour, and hence the HSV colour model is probably the most useful
for this surface property.<br>
<br>
<img src="textures/emissive.jpg"><br>
<br>
Below the colour properties are 4 numerical quantities with slider bars
to define their values.<br>
<br>
<b>Transparency</b> is the degree to which the object
transmits light. A value of 1 means the object is completely
transparent and 0 is completely opaque. The images below show objects
with a transparency of 0.5. The
effect of varying the <b>Transparent Colour</b> is
illustated. Normally an transparent object will
transmit light of a colour similar to its diffuse colour but in
computer graphic imagery we are not
limited to physical reality.<br>
<img src="textures/trans_colours.jpg">
<br>
<table>
<tbody>
<tr>
<td width="300"><font face="tahoma" size="2"><b>Specularity</b> is the
reflectiveness of the object. A value of 1 means the object is
completely reflective
and thus the diffuse colour will not be visible. A value of 0 is
completely non-reflective.<br>
<br>
The images on the right show objects all with a specularity of 0.3 and
show the effect of varying the <b>
Specular Colour</b>.<br>
<br>
Plastic type objects normally reflect virtually white light whereas
metallic objects
tend to reflect light that is tinged with the object's diffuse colour.
In the examples here, the Hue and
Saturation of the diffuse colour has been used as the specular colour
with varying amounts of Value and
compared with a 'plasticky' white specularity. <br>
<br>
</font></td>
<td><img src="textures/spec_colour.jpg"></td>
</tr>
</tbody>
</table>
<br>
In addition to specularity is <b>Shininess</b> which
controls the intensity of specular highlights. Although 'Shiny'
surfaces in real life are due only to specularity, the shininess
parameter is useful to fake some types of effect such as shiny plastic
surfaces without much obvious reflection. In most cases,
you will want to have both <b>specularity</b> and <b>shininess</b>.
Below are examples of different
shininess values with and without specularity.<br>
<img src="textures/spec&shine.jpg"><br>
<br>
<b>Roughness</b> This parameter can be used to mimic the
real life effect that the roughness of a surface decreases the
sharpness of reflections. Large Roughness values result in more blurred
reflections and more widespread specular highlights as shown below.
Note that Gloss/Translucency needs to be enabled during rendering with
the raytracing engine
(see <a href="rendering.html#raytrace">Rendering</a>)
to see the effect.
<img src="textures/roughness.jpg"><br>
<br>
<b> Cloudiness </b> controls the degree of translucency
for transparent objects. Higher values cause more
blurring of transmitted light as illustrated below. As with the
Roughness parameter, Gloss/Translucency
needs to be enabled during rendering to see the effect.<br>
<br>
<img src="textures/cloudiness.jpg"><br>
<br>
<br>
<a name="image_tex"></a><strong><font color="#ff6633" size="4">4.1.2 Image Mapped Textures<br>
</font></strong><br>
<br>
This type of texture allows you to define the surface properties based
on 2-D images. These images would
usually be created in some 2-D paint program. To create a new
image-mapped texture click on <b>Scene->Textures</b> and choose
<b>Image Mapped texture</b> from the <b>New...</b> menu. The
following dialogue box will be displayed:<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/image_map_dial.jpg"></td>
<td><font face="tahoma" size="2">The
same surface properties as were described in <b>Uniform Textures
</b>are
also here. This time however, both the colours and the values are
determined through the choice of
2-D images. This means that the values of the various parameters vary
over the object's surface according
to the image used, instead of being uniform.<br>
<br>
On the left of the dialogue box are the diffuse, specular, transparent
and emissive colours.
If you click on the square box immediately to the right of the text,
another dialogue box title 'Images'
appears. Click <b>Load</b> to read in a new image. The
image can be in .jpg, .png, .gif, .svg, or .hdr format. Simply
find the image and click on 'Open' to get the image. A thumbnail of
this image is then displayed in the
'images' dialogue box and is automatically selected (shown by being
enclosed by a black square). If other
images have been read in already then you can select any of them by
clicking on them. Once the required
image is selected, click on <b>Done</b>. (If you wish to
have no image selected, click on <b>Select None</b>). <br>
<br>
Note that there is also a uniform colour box next to the image box. The
colour specified here modifies
the colours of the image map uniformly.<br>
<br>
As with the <a href="textures.html#uniform_tex">uniform
texture dialogue</a>, double-clicking on
the preview displays a menu from which the view and preview object can
be changed and the preview
can be zoomed (CRTL and RMB drag up/down) and panned (RMB drag). </font></td>
</tr>
</tbody>
</table>
<br>
<br>
The images below right right show the effect of applying an image map
to
the various property colours. The image map itself is shown below left:<br>
<br>
<img src="textures/image_map_colors.jpg"><br>
<br>
On the right hand side of the image map dialogue are the numerical
properties. The properties <b>Transparency</b>,
<b>Specularity</b>, <b>Roughness</b> and <b>Cloudiness</b>
that were available with Uniform Textures are also here but, in
addition, are two different properties; <b>Bump Height</b>
and <b>Displacement</b>. These control the
'bumpiness' of the surface. Bump mapping varies the surface normals to
simulate bumps in the geometry, whereas
Displacement mapping actually changes the surface geometry.<br>
<br>
For Image Mapped textures, the amount of transparency, specularity etc.
is defined by the image map selected by clicking on the square box next
to the text. If no image is selected, a uniform value can
be specified using the sliders. If an image is selected, the property
varies across the surface
according to the image. You can choose whether the <b>Red</b>,
<b>Green</b> or <b>Blue</b> values are used to
control the various parameters by selecting the appropriate <b>Component</b>
on the right of the dialogue. For images with information in an alpha
channel or which contain transparent regions (of the supported image
types, .png, .svg, and .gif support transparency), an additional component
named <b><a name="mask"></a>Mask</b> is
also
available for selection in the component list. This can be used to
apply effects to particular parts
of the surface only, e.g. only parts of the image within an alpha
selection can be made to be shiny etc.
The Mask output can also be used to apply surface properties depending
on the transparency in the
image. The most obvious example would be to use it in the Transparency
property where transparent parts of the image would then act as
transparent regions in the texture (see example below). However, the
mask can be applied in any of the properties for other effects.<br>
<br>
<img src="textures/mask_example.jpg"><br>
<br>
The slider bars then change to control the 'Scale' of the effect. In
this way, you can make only some parts of
the surface transparent, shiny etc. Some examples are shown below:<br>
<br>
<img src="textures/image_map_values.jpg"><br>
<br>
The image map dialogue also allows you to tile images (on by default)
so that the entire surface of the
object can be covered if the image is smaller than it and to mirror the
image in either axis.<br>
<br>
<a name="images">Images </a> used for textures can
be managed directly through <b>Scene -> Images</b>.
This allows
images to be loaded, saved or deleted.<br>
<br>
<br>
<a name="proc_tex"></a><strong><font color="#ff6633" size="4">4.1.3 Procedural Textures<br>
</font></strong><br>
<br>
Procedural textures are those in which the various properties described
above are defined by mathematical
algorithms. There are two types of procedural texture in Art of
Illusion: procedural 2D and procedural 3D
textures. The 2D textures are essentially thin sheets of texture that
are wrapped around the object in
a way defined by the mapping (see <a href="textures2.html#assign_tex">4.1.4</a>).
Procedural 3D textures on the other hand are 'solid' textures
and objects assigned to them will look as if they have been 'carved'
out of it.<br>
<br>
The graphical interface for defining both types of procedural texture
are however identical so both will be described in this section.<br>
<br>
To define a new procedural texture click on <b> Scene ->
Textures</b> and choose <b>Procedural 2D texture</b> or <b>Procedural 3D texture</b>
from the <b>New...</b> menu. The following window is then
displayed:<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_texture_intfc.png"> </td>
<td><font face="tahoma" size="2">A
preview window is also displayed showing the current texture applied
to a sphere. <p>
<img src="textures/tex_proc_def_prev.png"><p>
This preview
window automatically updates as the texture
is built up. The size of this
preview can be altered by dragging the sides of the preview window
frame and the preview can be zoomed
(CTRL drag with RMB) and panned (drag with RMB).
As with the <a href="textures.html#uniform_tex">uniform
texture dialogue</a>, double-clicking on
the preview displays a menu from which the view and preview object can
be changed.<br>
<br>
The preview can also be used to view the texture at a predefined time -
useful for textures that vary with time (see example <a href="#preview_time">below</a>).<br>
<br>
To start with, the preview shows a uniform white texture as this is the
default. Please note, however, that 2D textures are shown using
projection mapping (link to mapping section), whereas 3D textures are
shown using linear mapping. Thus, the same procedural texture might
look different for the 2D and 3D preview. All the following examples in
this section have been created using 3D procedural textures. As an
exercise, you might want to check if they look different for a 2D
procedural texture, and if it's the case, why.<br>
<br>
The boxes at the right hand side of the procedural texture editor show
the surface texture properties
that were described above for the other type of textures. The idea of
the procedural texture editor is to
pass values (either colours or numbers) into the relevant property
boxes. This is done by inserting values,
functions and transforms and connecting them to the property boxes.
This produces a set of values
which are calculated for each point on the surface thus creating the
texture.
</font></td>
</tr>
</tbody>
</table>
<br>
Along the left side of the window is a menu of 'modules'
that can be added to the procedure. They are organized into categories,
such as Values, Operators, Functions, etc. Click on any category to expand it
and see the modules it contains.
<p>
Let's take a simple example: a uniform diffuse colour. Make sure the <b>Values</b>
category is expanded, then click on <b>Color</b>, or alternatively press the
mouse on <b>Color</b> and drag onto the blank texture 'canvas'. A small
square appears which looks like <img src="textures/proc_tex_color.jpg" align="middle">.
To apply this colour, connect it to the Diffuse colour box by clicking
on the blue solid arrow on the end
of the 'color' box, hold the mouse button down, drag to the blue arrow
on the Diffuse box and let go. A
line should now be displayed connecting the 2 boxes <img src="textures/proc_tex_color_diff.jpg" align="middle">. The preview window
will be unchanged since the colour
in the 'Color' box is white by default. Double-click on it and the
colour chooser dialogue will be displayed. Select the colour of choice
and click on OK. The preview window will now show the new uniform
diffuse colour texture.<br>
<br>
Each of the values, functions etc. modules selected from the menu
has at least one output (shown
as arrows pointing outwards) which is either a colour or a number; blue
arrows indicate colours, black
arrows are numbers. To be precise, the outputs are a set of values
representing the colour or value at each point on the surface. Most
also have at least one input value which are shown as arrows pointing
inwards.<br>
<br>
Let's try something slightly more complicated: a gradient across the
surface. Click on the 'Color' box
and press delete to remove it. This time, click on the
<b>Color Functions</b> category to expand it, then drag a <b>Custom</b> module
onto the canvas. This
produces a colour map <img src="textures/proc_tex_col_map.jpg" align="middle">.
Connect the output of this to the Diffuse property
box. The preview now shows a black sphere. This is because the colour
chosen from this colour map depends
on the input black solid arrow of this box. If you click and hold on
this arrow, you will see that it
says Index (0) meaning that the colour map function requires an index
and the default for this is 0 which
corresponds to black in the colour map. To get a gradient, we need the
colour selected from this map to
vary according to its spatial position. So, if the gradient is going to
run in the X direction, we need
to input X to the colour map box. Expand the <b>Values</b> category and
insert an <b>X</b> module. The output from this box
is the x value of each particular point on the
surface. Connect this output to the input of the colour map and the
preview window will now show a gradient as shown below:<br>
<br>
<img src="textures/pt_gradient.png"><br>
<br>
<table>
<tbody>
<tr>
<td><font face="tahoma" size="2">If we
had connected a <b>Y</b> box to this, we would have
got a gradient in the y-direction. What if we wanted
a gradient diagonally? In this case, we need to feed <b>(X+Y)</b>
to the input of the color map. Select both
X and Y from the <b>Values</b> menu. To
perform an addition, we need to insert an <b>Add</b> module from the
<b>Operators</b> category. Then connect the outputs of the X
and Y boxes to the input arrow of the <b>Add</b> box,
and the output of the <b>Add</b> box to the input of the
color map as shown on the right:<br>
<br>
There is another way we could have achieved this. Under the <b>Functions</b>
category is a powerful
function called <b>Expression</b>. Select this and
double-click on it. This function allows the entry of any
mathematical expression of x,y,z, time and the box inputs. Enter 'x+y'
in the box and click OK. Connect
the output of this box to the gradient and the same effect is achieved.
This is also shown on the right: </font></td>
<td><img src="textures/pt_xy_gradient.png"></td>
</tr>
</tbody>
</table>
<br>
<br>
Let's look now in more detail at the values, functions and transforms
available.<br>
<br>
<a name="Values"></a>
<font color="#800000" size="3"><b><u>Values</u></b></font><br>
<br>
This is the <b>Values</b> menu.<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_tex_values_menu.png"></td>
<td><font face="tahoma" size="2">Most
of the entries here are self-explanatory:<br>
<br>
<b>Number</b> inserts a box with a single constant
number. Double-click to change the value.<br>
<br>
<b>Color</b> inserts a single constant colour box.
Double-click to bring up the colour chooser dialogue
to change the colour.<br>
<br>
<b>X, Y and Z</b> simply bring up boxes with the
x,y,and z values at each point on the surface. For
procedural 2D textures, Z is zero.<br>
<br>
<b>Time</b> This inserts a box, the output of which
is the time value. In animations, this value
will change and thus textures, themselves, can be <a href="animation.html#anim_textures">animated</a>.<br>
</font></td>
</tr>
</tbody>
</table>
<br>
<br>
<b><a name="view_angle">View Angle</a></b>
This module can be used to vary surface properties of an object
depending on the angle between the camera and the point on the surface.
It has uses in simulating
Fresnel effects where the specularity is less at near normal angles of
incidence and increases at glancing angles. The <b>View Angle</b>
module outputs the Cosine of the angle of incidence and the example
below shows how it can be used to generate a Fresnel effect: In this
example, the procedural texture shown below left was used to make the
left vase more 'plasticky' by enhancing reflections at glancing angles.
The metallic vase on the right has a higher specularity which is also
applied uniformly.<br>
<img src="textures/view_angle_proc_ex.jpg"><img src="textures/fresnel.jpg"><br>
<br>
This module has many other uses, one of which is a simple 'toon'
texture as shown below:<br>
<br>
<img src="textures/toon_tex.jpg"><img src="textures/ele_toon.jpg"><br>
<br>
<b>Parameter</b> This allows textures to be dependent on
user-defined parameters which can be specified
when mapping the texture indivually for objects and even for particular
parts of objects. See <a href="textures2.html#tex_param">Texture
Parameters</a> for more details.<br>
<br>
<a name="comment"><b>Comment</b></a>
Thus module is purely a text box allowing comments to be placed in the
procedure, e.g. to describe parts of the procedure as shown in the
example below:<p>
<img src="textures/pt_comment_ex.png">
<p>
<a name="Operators"/>
<font color="#800000" size="3"><b><u>Operators</u></b></font><br>
<br>
This is the <b>Operators</b> menu.<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_tex_operators_menu.png"></td>
<td><font face="tahoma" size="2">These are standard mathematical operators:<br>
<br>
<b>Add, Subtract, Multiply, Divide</b> These boxes
each have 2 inputs which are added, subtracted
(bottom input from top input),multiplied together or divided (top
divided by bottom) depending on the
operation selected.<br>
<br>
<b>Power</b> The output of this is the left input to the
power of the exponent (top input).<br>
<br>
<b>Mod</b> has 2 inputs, the dataset to be operated on and
a Modulus value. It returns the remainder
of dividing the dataset input by the Modulus, e.g if the input was 5
and the Modulus was 4, the output
would be the remainder of dividing 5 by 4 which equals 1.<br>
<br>
<b>Greater Than</b> returns 1 if the top input is
greater than the bottom and 0 otherwise.<br>
<br>
<b>Min, Max</b> Both of these have 2 inputs. They are
compared and the minimum or maximum respectively
is returned as the output.<br>
</font></td>
</tr>
</tbody>
</table>
<a name="Functions"/>
<font color="#800000" size="3"><b><u>Functions</u></b></font><br>
<br>
This is the <b>Functions</b> menu.<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_tex_functions_menu.png"></td>
<td><font face="tahoma" size="2">These
entries are applied to numerical values to modify them in various
ways:<br>
<br>
<b>Expression</b> allows the entry of any
mathematical expression of <i>x, y, z, t</i> (representing
time) and any of 3 inputs to the box. The inputs are identified as <i>input1,
input2</i> and <i>input3</i>.<br>
<br>
Expressions can use the following mathematical operations:
+,-,/(division),*(multiplication),
^(to the power of),%(modulus) and can contain
the following functions: <b>sin(a)</b>: sine of a, <b>cos(a)</b>:
cosine of a, <b>sqrt(a)</b>: square root of a, <b>abs(a)</b>:
absolute value of a, <b>log(a)</b>: natural logarithm of
a, <b>exp(a)</b>: e to the a power (same as e^a), <b>min(a,
b)</b>: minimum of a and b, <b>max(a, b)</b>:
maximum of a and b, <b>pow(a, b)</b>: a to the b power (same
as a^b), <b>angle(a, b)</b>: the angle formed by a right triangle with sides a and b,
<b>bias(a, b)</b>: the Bias function with a bias of b, <b>gain(a, b)</b>:
the Gain function with a gain of b.<br>
The constants, <b>pi</b> and <b>e</b> are
also recognised.<br>
<br>
<b>Custom</b> allows a curve to be drawn relating the
output to the input. New points can be added by <ctrl>
clicking on the graph and existing points can be moved by clicking and
dragging. The curve can be smoothed
by checking the appropriate box. In addition, the function can be made
periodic, i.e. it repeats itself
forever outside the 0-1 range. Otherwise, input values less than 0
produce the same output as an input of 0
and input values greater than 1 give the same outputs are input values
of 1.<br>
<br>
<b>Scale/Shift</b> multiplies the input value by a
constant value and adds an offset value. Double-click on
the box to alter both these values.<br>
<br>
<b>Abs</b> returns the absolute value of the input,
i.e. if the input is greater than 0, there is no
change, if the input is negative, the positive value is returned (e.g.
-5 becomes +5).<br>
<br>
<b>Blur</b> Produces a blurring effect. There are 2
inputs: one is the set of values that you want to apply the operation to,
the other is a value defining the amount of blurring. More accurately,
this second value is the range
over which the smoothing is performed.<br>
<br>
<b>Clip</b> This function limits the input to be
within a range specified by double-clicking the box.
Input values between the limits are unchanged, values less than the
minimum are set equal to the minimum,
and inputs greater than the maximum are set equal to the maximum.
</font></td>
</tr>
</tbody>
</table>
<br>
<br>
<b>Interpolate</b> outputs a value based on 3 inputs. Value
1 and value 2 (top and bottom inputs)
specify the maximum and minimum and the fraction input determines the
value between the min and max.
For example, if the fraction was 0.5, the output would be half-way
between the extremes, if it was
0.25, the output would be a quarter of the way between them etc.<br>
<br>
<b>Sine, Cosine, Square Root, Exponential, Log</b> These
are straightforward mathematical expressions with
a single input and output. The inputs for Sine and Cosine are in
radians. The Log module is a natural
(i.e. to the base e) logarithm.<br>
<br>
<b>Bias</b> This module calculates Ken Perlin's Bias
function. Given an input value between 0 and 1, it calculates an output
value which is also between 0 and 1 according to: y(x) =
x^(log(B)/log(0.5)) where the input value x and bias B correspond to
the two input ports. If B=0.5, then y(x)=x. Values of B less than 0.5
push the output toward smaller values, while values of B greater than
0.5 push the output toward larger values.<br>
<br>
<b>Gain</b> This module calculates Ken Perlin's Gain
function. Given an input value between 0 and 1, it calculates an output
value which is also between 0 and 1 according to: y(x) = Bias(2*x,
1-G)/2 if x<-1.5 1-Bias(2-2*x, 1-G)/2 if x>-1.5 where the
input value x and gain G correspond to the two input ports, and Bias(x,
B) is the Bias function described above. If G=0.5, then y(x)=x. Values
of G less than 0.5 smooth the input by pushing the output toward 0.5,
while values of G greater than 0.5 sharpen the input by pushing the
output toward 0 or 1.<br>
<br>
<b>Random</b> This is a one-dimensional random noise
pattern. It has 2 inputs, one of which is the
dimension over which the random noise is applied and the other is the
amount of noise. The input
dimension is <i>time</i> by default as this function is
most commonly used to vary position/rotation during
an animation. This function could, however, be used to create random
patterns in space or, indeed, to
apply random variations to texture patterns. Also, similarly to some of
the <b>Patterns</b> described
below, double-clicking the Random module allows the Amplitude and
number of Octaves to be specified. See
the description of the <a href="#patterns">Noise</a>
pattern below for more details of these parameters.
<br>
<br>
<a name="Colour_Functions"></a>
<font color="#800000" size="3"><b><u>Color
Functions</u></b></font><br>
<br>
This is the <b>Color Functions</b> menu.<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_tex_colour_func_menu.png"></td>
<td><font face="tahoma" size="2">These
functions are used to create or change colour values in various
ways:<br>
<br>
<table>
<tbody>
<tr>
<td><font face="tahoma" size="2"><b>Custom</b>
As we have already seen, this is used to creat colour maps from which
colours are selected depending on the input numbers. The default colour
map has black at one end and white at the other. Double-click on the
colour bar box to edit it as shown on the right. To change a colour,
click
on the small arrow beneath it on the bar - the arrow will turn red to
show it is selected. Then click on
the colour square which will display the colour chooser dialogue to
enable a new colour to be selected.
Colours can be added to the colour map by clicking on <b>Add</b>.
This creates a new arrow on the bar which
can be coloured as required. The positions of the colour along the bar
can be altered either by dragging
the arrows to the required place or by entering a number between 0 and
1 into the <b>Value</b> box. The
colour map can be made periodic by checking the appropriate box. This
means that the colour map repeats
itself indefinitely for all points on the surface. If not selected,
then parts of the surface outside
the map will be a uniform colour the same as the appropriate end of the
colour bar.<br>
</font></td>
<td><img src="textures/pt_bw_colourmap.jpg"></td>
</tr>
</tbody>
</table>
</font></td>
</tr>
</tbody>
</table>
<br>
<table>
<tbody>
<tr>
<td><font face="tahoma" size="2"> <b>Blend</b>
is another way of defining a colour from
a range. It takes 2 input colours and blends them
according to the numerical input. The important difference between this
and the custom colour function is
that the colours are inputs are can thus be created by other functions.
This is a simple example where one
of the colour inputs is a fixed red colour and the other is a colour
selected from a custom colour map.
The function selecting the colour from the map is simply Y so this
would create a gradient in the Y direction.
The colour selected and fed into the blend function thus varies from
white to black depending on the Y
position. This then gets mixed with red according to the X position
which is the function fed into the
Blend colour function. Obviously much more complicated functions can be
defined. </font></td>
<td><img src="textures/blend_ex.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<b>Add, Subtract, Multiply</b> are simple functions that
take 2 colour inputs and perform the appropriate
mathematical operation on their RGB components.<br>
<br>
<b>Lighter, Darker</b> Both these functions take 2 colour
inputs and output whichever of the 2 colours
is lighter or darker. This is determined by the luminance component of
the CIE XYZ color system.<br>
<br>
<b><a name="colour_scale">Scale</a></b>
allows the input colour to be scaled by a numerical input. Each
component of the input colour
is multipled by the input number. One somewhat hidden feature of the
colour <b>Scale</b> module is that
it can be used to increase properties such as Specularity, Shininess,
Transparency etc beyond their normal
maximum value of 1. This is done
by scaling the appropriate colour (i.e. <b>Specular Color</b>
for Specularity and Shininess, <b>
Transparent Color</b> for Transparency) by numbers greater than
1. The resulting property value is the
product of the scaled colour value and the <b>Number</b>
input to the property. An example is shown
below: In the left hand image, the Specular Color is white (i.e. Hue-0,
Saturation-0 and Value of 1) and
the Shininess is set to 1. The overall Shininess is then the product,
i.e 1 x 1 = 1. The right hand
image uses the <b>Scale</b> module to increase the
Specular Color Value to 20; the product is thus
1 x 20 = 20 and the result is a much (artifically) brigher specular
highlight which could, for example,
be used as a cartoon-like shiny texture.<br>
<br>
<img src="textures/color_scale_ex1.jpg"><br>
<br>
Another use is with emissive textures; the <b>Scale</b>
can be used in a similar way to increase the light produced by an
emissive object when rendered with Global Illumination. The image below
shows
the effect of applying the colour <b>Scale</b> module to
the <b>Emissive Color</b>; the numerical inputs
to the <b>Scale</b> module being 1,2,5 and 10
respectively: The image was rendered with <a href="rendering.html#photon_mapping">Photon Mapping</a>
for Global Illumination.<br>
<br>
<img src="textures/glow_balls_PM.jpg"><br>
<br>
<table>
<tbody>
<tr>
<td width="400"><font face="tahoma" size="2"> <b>RGB</b> This module allows Red,
Green and Blue
components to be determined via numerical inputs.
is a seemingly simple function, its power lies in the fact that the
components are inputs and can therefore
be calculated by other function combinations. In the example on the
right, the Red component is determined
from a <a href="textures.html##patterns">Noise</a>
module, the Green component is obtained from a <a href="textures.html##patterns">Wood</a> pattern and
the Blue component is
dependent on the <a href="textures.html#view_angle">View
Angle</a> to the <a href="textures.html#Functions">Power</a>
of 3.<br>
</font></td>
<td><img src="textures/pt_rgb.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<table>
<tbody>
<tr>
<td width="400"><font face="tahoma" size="2"> <b>HSV</b> As with the RGB module,
this function has
3 numerical inputs; one for each of the colour components. This
time the Hue, Saturation and Value components can be controlled via
numerical inputs as shown in the
simple example on the right in which the Hue is determined by the
x-position. </font></td>
<td><img src="textures/pt_hsv.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<table>
<tbody>
<tr>
<td width="400"><font face="tahoma" size="2"> <a name="HLS"></a><b>HLS</b>
As
with the previous two modules, this function has 3 numerical inputs;
one for each of the colour components. This
time the Hue, Lightness and Saturation components can be controlled as
shown on the example on the right
in which the Lightness varies sinusoidally and the Saturation is
determined from a scaled <a href="textures.html##patterns">Cells
pattern</a>. </font></td>
<td><img src="textures/pt_hls.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<a name="Transforms"></a>
<font color="#800000" size="3"><b><u>Transforms</u></b></font><br>
<br>
The modules in this menu perform transformations on the co-ordinate
system. This is the <b>Transforms</b> menu:<br>
<br>
<img src="textures/proc_tex_transforms_menu.png"><br>
<br>
<b>Linear</b>
<table>
<tbody>
<tr>
<td><font face="tahoma" size="2">This
module allows scaling, rotation and translation of x, y or z.
Double-clicking on the
box brings up a dialogue allowing entry of the relevant transformation
parameters.<br>
<br>
An example is shown on the right. Here is the same basic texture we had
in the HSV example above. The
X output of the linear transform is fed into the Hue component of the
HSV colour function. With the default transformation settings, this
would result in the same texture as before. However, a scaling
factor of 5 has been entered in the x column and a 45 degree rotation
has been applied in the z-axis to
produce the modified texture seen. </font></td>
<td><img src="textures/pt_lin_trans.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<b>Polar</b>
<table>
<tbody>
<tr>
<td><img src="textures/pt_polar_ex.jpg"></td>
<td><font face="tahoma" size="2">The
polar module transforms the linear co-ordinate system of x and y to
the polar co-ordinate system
defined by r (radial distance) and theta (angle). An example is shown
on the left.<br>
<br>
The top example shows the result of feeding the r co-ordinate into the
Hue of the HSV function producing a pattern where the colour is the
same for points at the same distance from the centre, thereby producing
rings of colour.<br>
<br>
Similarly with the theta co-ordinate, points at the same angle have the
same colour as shown in the lower
image. </font></td>
</tr>
</tbody>
</table>
<br>
<br>
<b>Spherical</b>
<table>
<tbody>
<tr>
<td><font face="tahoma" size="2">This
transforms the linear co-ordinate system to a spherical coordinate
system.<br>
<br>
The example on the right shows an example using the Grid pattern (see
below). This is used to select
a colour from the custom colour function giving the result in the upper
image.<br>
<br>
Applying a spherical transfrom to the co-ordinate system before the
Grid pattern produces the image
below. </font></td>
<td><img src="textures/pt_spher_trans.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<b>Jitter</b>
<table>
<tbody>
<tr>
<td><img src="textures/jitter_ex.jpg"></td>
<td><font face="tahoma" size="2">This
transform keeps a linear co-ordinate system but applies a random
jittering effect. Double-clicking
on the box displays a dialogue allowing control of the amplitude of the
jitter and the range over which
the jittering takes place.<br>
<br>
In the example on the left, we have the texture used as an example
above under 'Polar'. This
ordinarily produces a set of rings of different colours. This time,
however, a jitter has been applied
to the x and y co-ordinates of amplitude 0.5. The top image shows the
effect with a scale of 1 and the
lower image shows what happens when this scale is reduced.</font></td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<a name="#patterns"><font color="#800000" size="3"><b><u>Patterns</u></b></font></a><br>
<br>
<br>
<table>
<tbody>
<tr>
<td><img src="textures/proc_tex_patterns_menu.png"></td>
<td><font face="tahoma" size="2">There
are several pre-defined texture patterns in Art of Illusion
accessible through the <b>Patterns</b> menu as shown on the left. Each pattern has 3
inputs for x, y and z coordinates.</font></td>
</tr>
</tbody>
</table>
Below we will look at each colour pattern and its variations. In each
case, the output from the
pattern box has been fed into the default custom colour function and
then into the Diffuse property
box.<br>
<br>
<b>Noise</b><br>
<br>
This module creates a fractal noise pattern using Stefan Gustavson's