All
lights in Maya (area light excluded) emanate light
from a finite point in space. This is completely
unnatural as all lights in nature have a measurable
size. The effect that light size has in nature
is found in the shadow and specular qualities present.
Simulating this issue in a render is for a separate
discussion, as we are now going to focus on a particular
situation where the finite origin of a spotlight
becomes problematic... not in how objects receive
light, but how one controls the origin of light.
In
the above image we have a typical location flood
light which has a broad area of illumination within
a metal enclosure. The best way to simulate the illumination
from this lightsource is the focus of our discussion.
The
first step is to create a spotlight. While you
may be inclined to use an area light, I prefer
spotlights for reasons of efficiency and simplicity
of designing how the light will illuminate the
surrounding air. So first, a spotlight is created
and positioned so that the cone of light coming
from the flood is spreading the way I want.
The
above image shows the main problem we are going
to encounter. In order to get the proper light
emission, the spotlight needs to be placed way
behind the actual light housing. This cause three
problems: 1) the light will illuminate the back
of the housing. 2) if shadows are on, the light
will not illuminate past the housing. 3) if fog
is used, which we want, the fog will appear behind
the housing.
The
above image shows the results of enabling light
fog. Remember to scale the spotlight so that
the edge of the fog cone shape is out of view,
and to enable light decay for this type of
work... light fog is discussed more in another
tutorial.
So
what we now want to do is take advantage of
a nice spotlight feature which is in the light
effects folder: Decay Regions. This is an often
misunderstood feature as it is poorly documented
and has nothing to do with light decay. Decay
regions, when enabled, control where light
exists, not where it decays; they are 'intensity'
regions. IPR supports these, so it is best
to experiment with an IPR render active, in
order to best understand them. Maya allows
for three distinct regions of light, although
the way that the light decays is still based
on the standard decay rate attribute. The benefit
of having three regions is dubious, as all
I have ever found useful is controlling the
start point of a spotlight's illumination.
The
above image shows what decay regions can
do, but what we will now do is set all
the regions to butt up against each other.
I set regions two and three to be far away
so that we have something like this: Region
One: 0-100 units. Region Two: 100-200 units.
Region Three: 200-300 units. This way there
is no gap between them. The numbers are
arbitrary, however... enter whatever you
wish as long as the light is moving as
far into the scene as required. The only
thing we are concerned with is the starting
value for region one. We want the light
illumination to begin within the floodlight
housing, so I use IPR to interactively
find the right value. You can also enable
the visual display of decay regions by
selecting a spotlight and going to Display/
Cameras&Lights/ Light Manipulators.
At
this point we've accomplished the
main point of this tutorial. The
back of the housing is no longer
illuminated by the spotlight and
the fog is beginning where it should.
What is left to deal with is the
shadows cast by this light. Decay
regions are not considered in Depth
Map calculations, so once we turn
shadows on, our illumination will
vanish, as the light housing will
block the light. To deal with this,
we can simply turn off the 'casts
shadows' attribute for the geometry
which represents the back of the
flood light. If there are other
lights which should create a shadow
from this object, create a copy
of the geometry which casts shadows,
but is not linked to our main spotlight.
Light linking and working with
the 'casts shadows' & 'primary
visibility' attributes are the
way around these types of situations.
Also remember that the light fog
should itself become a lightsource,
so I always create fill lights
to represent the light coming from
fog.
As
a last step, I
added a second
spotlight with
light fog so that
I could get the
fog to bleed a
little over the
edges of the main
fog cone. This
spotlight is unlinked
from all scene
geometry and is
therefore only
used to create
a fog effect. I
also wanted the
appearance of dust
particles floating
in the air, so
I mapped the second
spotlight fog's
density attribute
with a 3D granite
texture. By animating
the granite's placement
node moving through
the scene, I can
get the dust to
travel.
Hope
this all made sense... :) It is
extremely handy in various situations.