Return to index
NAME
phf - get or set the current phase function context
SYNOPSIS
phf
[
id
[
=
[
template
]
]
]
DESCRIPTION
If the phf keyword is given by itself, then it establishes the unnamed phase function context, which is a isotropic phase function (To do: check this!). This context may be modified, but the changes will not be saved.
If the keyword is followed by an identifier id, then it reestablishes a previous context. If the specified context was neverdefined, an error will result.
If the entity is given with an identifier followed by an equals sign ('='), then a new context is established, and cleared to the default phase function. If the equals sign is followed by a second identifier template, then this previously defined phase function will be used as a source of default values instead. This may be used to establish a phase function alias, or to modify an existing phase function and give it a new name.
EXAMPLE
# Establish a new phf context called "cloudyPhF"
phf cloudyPhF =
type Schlick2
k 0.3
l -0.4
r 0.5
# We're done, the current phf context is now "cloudyPhF"
# Create new named material for participating media context
mpm matPsicoCloud =
# Set a certain albedo
c
# Spectrum measured in 10 nm increments from 400 to 700 nm
cspec 400 700 35.29 44.87 47.25 47.03 46.87 47.00 47.09 \
47.15 46.80 46.17 46.26 48.74 51.08 51.31 51.10 \
51.11 50.52 50.36 51.72 53.61 53.95 52.08 49.49 \
48.30 48.75 49.99 51.35 52.75 54.44 56.34 58.00
albedo 0.97
# Set neutral color
c
# Set extinction coefficient
kt .04
# Modulate with a file of our own
ktgridfile myGridFileApart
# The cloud corner vertices:
v corner.xyz =
p 0 0 0
v corner.XYZ =
p 48 24 48
# The cloud:
# Push object name
o cloud
# Get previously defined matPsicoCloud material
m matPsicoCloud
# Get previously defined cloudyPhF phase function
phf cloudyPhF
# Polygonal face using defined vertices
rectprism corner.xyz corner.XYZ
# Pop object name
o
SEE ALSO
type,
k,
l,
r