Setting the Size or Luminosity of Particles


Setting the Size or Luminosity of Particles

When we talk about the luminosity of a particle, we are really referring to its size, or more specifically, how large or small the graphics engine draws the point. You may have particles that you want large when they are nearby, but disappear when they reach a certain distance. You may want your polygons to disappear at some distance but your points to remain visible far away from the viewing location. The size of the points and often the polygons are subject to a combination of settings that determine its overall luminosity. We will begin by describing each of these commands and then wrap up at the end with a discussion on our approach to luminosity in Partiview.

The lum const Command

The lum const command sets all particles in the active data group to a constant luminosity specified by the optional argument L. Here the size is directly proportional to the value of L.

The lum datavar Command

Rather than set all particles to a single luminosity value, it is often useful to set the size of the points relative to some attribute of the data. This is achieved using the lum datavar min max command. Provided you have a column of data that represents the luminosity, you may set the size of your particles to be proportional to the value of these data. If you have defined a data variable in the data file, such as

datavar 0 lumin
then you can use that to set the size using the command
lum lumin 0 1
which reads the data in the column pointed to by lumin and renormalizes it over the range 0-1. The default for min max are the minimum and maximum values of the data variable, however, if the range 0-1 is specified, then the column data are renormalized over those values.

To explore these two types of lum commands, let's bring up the Complex Data. If you type

lum
Partiview will report that the luminosity is being read from data variable 0, called lumin, and ranges over 0 to 1, with the mean of the data values equal to 25.1. Now, set the particles to a constant luminosity of 1
lum const 1

Now all the particles have the same size, disregarding perspective effects. You may toggle back and forth between a constant luminosity and one set by the data variable lumin by issuing the commands

lum lumin
lum const
lum lumin

Luminosity Scale Factors

Given the luminosity from either of the two lum commands, a scaling factor is multiplied to brighten all or a portion of particles in the data group. These scaling factors are:

psize
This command is a global scale factor on the luminosity. If you type psize in the Command Line it will report the current value of this scale factor. A small value will draw the points smaller, reducing the range over which the points can be seen. If you'd like to be able to fly far away from your data while continuing to see the points, then you'll want a high value for psize. When you are setting the luminosity with the lum const command, psize is essentially equal to the lum const value. For example, the particle size will be equal if lum const is 1 and psize is 10 and if lum const is 10 and psize is 1. Note that psize has no effect on the size of the polygons.

slum
This is a scaling factor that is relative to a particular data variable. For example, in the Complex Data, we have defined the lumin and coloridx data variables. We can set a slum scaling for each of these data variables in the following commands:
lum lumin 0 1
lum coloridx 0 1

Now, each of these can have separate scalings via the slum command. Let's set these scalings first by selecting the lum we want to scale, then setting the scaling factor using slum:

poly on
lum lumin
slum 0.1
lum coloridx
slum 0.5

You may notice that the size of the points vary depending on the value of the data variable. In the lum lumin case, all the points appear to be the same size since their slum value has saturated our ptsize settings. However, with the smaller slum value in the lum coloridx case, we see that points of higher color indices have higher luminosity. The polygons show the effects of these slum values clearly.

Particle Sampling
If you are sampling your data using every, the remaining particles will be brightened to keep the total brightness the same. Also, if you're using the emph command to brighten a subset of particles, this factor will be multiplied as well.

Distance of the Particles

Partiview determines the distance from the viewer to the particle then computes the light fall off. This fall off in the brightness can be computed in several ways. Using the fade command, you can set this fall off to the following options:

planar is a 1/r2 light fall off with the distance measured from the view plane.
spherical is also a 1/r2 light fall off but with r measured as the true distance from the viewpoint (center of your screen). This is the default.

linear refdist provides a 1/r light fall off that, while not physically relevant, can be useful for sense of depth and entertaining questions like: What would the world be like if the light fall off law was 1/r instead of 1/r2?

const refdist sets a constant distance for all particles that is independent of the actual distance.

To see the difference between these, the fade command can be issued as

fade planar
fade const 10
fade linear 2.5
fade spherical

Typically, this command is not needed since the default gives the correct inverse square law for light.

The “Final” Luminosity

Each of these commands discussed above are considered in the final luminosity calculation to determine the size of the particle. The formula can be expressed:

$\displaystyle \mathsf {Apparent\:Brightness}$ = $\displaystyle {rac{{\mbox{	extsf{	extbf{psize}}}	imes \mbox{	extsf{	extb...
 ...es \mbox{	extsf{	extbf{lum}}}}}{{(\mathsf{Particle-to-Camera\:Distance})^2}}}$

where the slum value is that of the current lum variable, the lum value is that of the data variable linearly mapped, and the particle-to-camera distance is affected by the fade command.

How do you set these values for your data?

Consider everything we've discussed in these past few sections that directly or indirectly affect the particle size and brightness: ptsize, polysize, polyminpixels, alpha, polylumvar, fade, lum const, lum datavar, psize, slum, every, emph--am I missing any? With all of these settings and options, what is the best way to set the brightness of your data?

Let's eliminate a few of these options right away. If we're not using the every or emph commands, then the Sampling Factor will be 1 and our overall luminosity will not be determined by these factors.

The ptsize range is an intrinsic property of the points and should be set to your preferences. Typically one wants point sizes that fade to small sizes as the distance increases and have a maximum size that's not too large. Typical values are 0.05 to 5.

The fade is correct to 1/r2 by default, so we need not worry about the denominator.

Considering points, not polygons, we only need to adjust the lum, psize, and slum values. These three values balance one another to produce the final particle size. Let's assume that the lum value is either set to a constant 1 or set to the data-specific luminosity value. Then, the final two parameters to set are the psize and slum values.

Given the difference between psize and slum, the former being a global scale factor while the latter is a data variable-specific scale factor, we should first set the psize value so that all particles appear more or less as we would like to see them. Next, we should use the slum factor to fine-tune the brightness, particularly for polygons. Once polygons are added to the equation, some of your values might have to be adjusted. However, psize does not affect the size of the polygons, so slum and polysize should be used together to get the right polygon size and brightness.

These are our general guidelines for setting the brightness of data. Typically, if you'd like to see your data from afar, you will want a high value for psize. Additionally, you can set a minimum size for polygons using polyminpixels which will alter the apparent brightness of the particles at larger distances.

© 2002-2005 American Museum of Natural History
Last Modified: 2006-04-28 by Brian Abbott