(Notes
on glass: A transmission value of 0.96 is typical, for standard
88% transmissivity glass.)
Other
material types, which we will probably not be using, include illum,
spotlight, trans (a good one for light fixtures), dielectric, interface, and anitmatter.
Pattern
and Texture
Patterns and textures are modifiers for the basic Radiance
materials. By listing a modifier Radiance patterns vary "2D" optical characteristics
of an object material across the object surface. Textures vary
the apparent local shape of a surface by pertur
bing the surface normal across
the object surface, which causes
shading variations perceived as bumps, waves, etc. Both patterns and textures
can be either based on bitmap image data, or on mathematical procedures. Procedure
files for both patterns and t
extures are indentified by the extension Ò.cal",
and the bitmaps for image-based patterns are indentified by the extension
".pic". (No bitmap data files for texture definition are actually supplied with
Radiance.) The bitmaps and math functions live
outside your Radiance scene
description file in auxilary
files. You make reference to these external auxilary files in the scene description
to establish complex material definitions. In fact, we will mostly use the
set of auxilary files that come with Radia
nce, which can be found on Darkwing at /usr/local/lib/ray. Use that full path name when referencing
the auxilary files so they don't have to be copied over and over again.
Patterns
and texture come in some
pre-defined types, just like the materials they modify. They are listed below.
Patterns
To
apply a
pattern to an object, the pattern is defined, and then used as a modifier to the
material definition for the object. Procedural patterns which vary material
color have the type "colorfunc", while procedural patterns which vary reflectance
have
the type "brightfunc". The number and purpose of parameters varies among
procedural patterns and textures
(hence the notation "4+" and "nÉAn").
colorfunc
modifier
colorfunc id
4+ red green blue functionFile transform
0
n
A1 A2 A3... An
brightfunc
modifier
brightfunc id
2+ reflectance functionFile transform
0
n
A1 A2 A3... An
colorpict
modifier brightfunc id
7+ redFunction greenFunction blueFunction picFile functionFile u_function
v_function transform
0
n A1 A2 A3... An
To build a bitmap woodgrain pattern into a material,
you first cite the woodgrain pattern. This code chunk is not modified
by anything else, so the first field will say "void".:
void colorpict wood_floor_pattern
9
red green blue /usr/local/lib/ray/oakfloor.pic /usr/local/lib/ray/picture.cal
tile_u tile_v -s 1.1667
0
1 .578313253
(Notes:
"-s" preceeds the size of seven slats in the image file, measured in feet (1.1667=14").
.578313253 is the
proportion of the short side of the image patch to the long side, measured in
pixels. If you just use the right number, you may not need to
know where it comes
from.)
Then, cite the wood_floor material so it is modified by the pattern:
wood_floor_pattern
plastic wood_floor
0
0
5 .2 .2 .2 .02 .05
Then, you can apply the wood_floor material to an object by making
wood_floor the modifier (first field) of the object.
By substituting a different
".pic" file from /usr/local/lib/ray and by adjusting the scale carefully, this setup can be used to apply a wide variety of patterns.
Textures
To apply a pattern to an object, the pattern is defined, and then used as a modifier to the material definition for the object. Procedural patterns which vary material color have the type ÒcolorfuncÓ, while procedural patterns which vary reflectance have the type ÒbrightfuncÓ.
texfunc modifier texfunc id
4+ xpertubation ypertubation zpertubation functionFile transform
0
n A1 A2 A3... An
Some Example Materials
Simple Materials
# plain concrete
void plastic concrete
0
0
5 .3 .3 .3 0 0
# plain wood floor
void plastic wood_floor
0
0
5 .3 .15 .05 .04 0.0
# light wood
void plastic light_wood
0
0
5 .5 .3 .2 0 0
# shingles
void plastic shingles
0
0
5 .3 .2 .1 0 0
# glossy white paint
void plastic white_enamel_paint
0
0
5 .5 .5 .5 .02 .05
# flat gray paint
void plastic gray_paint
0
0
5 .5 .5 .5 0 0
# brass metal
void metal brass
0
0
5 .68 .27 .002 .95 0
# chrome metal
void metal chrome
0
0
5 .8 .8 .8 .9 0
# simple glass
void glass glass
0
0
3 .96 .96 .96
# a basic light
void light light
0
0
3 100 100 100
Compound Materials
# detailed wood flooring
# first, vary the reflectance with a noise function
# "-s 2" is the spacing (2 feet) and ".15" is the degree of dirtyness (15%)
void brightfunc dusty
4 dirt /usr/local/lib/ray/dirt.cal -s 2
0
1 .15
# then, set up tiling with a floor-board bitmap
dusty colorpict wood_floor_pattern
9 red green blue /usr/local/lib/ray/oakfloor.pic /usr/local/lib/ray/picture.cal tile_u tile_v -s 1.1667
0
1 .578313253
# finally, apply this to the plastic itself
wood_floor_pattern plastic wood_floor
0
0
5 .2 .2 .2 .04 0
#then use "wood_floor" as the material to modify your objects
# corrugated roofing compound material definition, rev--950509.kmm
#
# first, vary the reflectance with a noise function
# Ò-s 2Ó is the spacing (2 feet) and Ò.25Ó is the degree of dirtyness (25%)
#
void brightfunc dusty
4 dirt /usr/local/lib/ray/dirt.cal -s 2
0
1 .25
#
# then, set up the sine-wave texture function:
#
# One parameter, A1 = number of cycles per unit distance
# [A1 controls size, yes, but apparently not cycles/unit] Here the size = 0.5.
# Note the non-standard order of xcor, zcor, ycor. This order applies the wave
# to the top and south faces, but not to the west face of a block.
#
dusty texfunc corrugated_south
4 xcor zcor ycor /usr/local/lib/ray/corrug.cal
0
1 0.5
#
# finally, apply this to the metal itself
#
corrugated_south metal corrugated_roof_south
0
0
5 .5 .5 .5 .3 .2
# then use Òcorrugated_roof_southÓ as the material to modify your objects
More Information on Procedural Materials...
More Information on procedural material modifiers can be found on Darkwing, or any other properly set-up Radiance host, in the
materials directory. On Darkwing this directory is:
/usr/local/lib/ray/
To go there while logged in with Telnet, use the "cd" command"
% cd /usr/local/lib/ray/ [return]
To list the files in the directory, use the "ls" command:
% ls [return]
Then to view a ".cal" procedural pattern or texture, use the "more" command:
% more brick.cal [return]
Home for this Course
|
Back to Example Courses
|
D.I.L. Home Page
|
D.I.L. Index