RiPoints
PrimitiveRiPoints
primitive is intended to be used for small
particles such as sparks, snowflakes, or raindrops. They are optimized
for the case where the intended particle is small, taking up at most a couple
of pixels on the screen.
RiPoints
are much cheaper in terms of memory and in terms of
shading time. Each point is only shaded once, and generates only a single
"microdisk," which is completely round. You can efficiently render large
numbers of particles using the point primitive.
In other words, one should not use Points
if:
RiPoints
is:
Points "P" [ particle locations ... ] "width" [ particles radii ... ] ...The corresponding C calls would be
RiPoints(RtInt npoints, parameterlist);
RiPointsV(RtInt npoints, RtInt nargs, RtToken name[], RtPointer value[]);
The width of the points is defined in the current object coordinate system,
and defaults to 1.0. You can specify either a single width value for all points using the
"constantwidth"
parameter, which is defined as a uniform float,
or give individual points separate widths by using the varying float variable
"width"
.
Points are nearly ideal for generating star fields. The following image consists of about five thousand stars, randomly colored.
surface particle( ) { Ci = Cs; Oi = 0; }Note that the shader sets the opacity, Oi, to 0 causing the particle intensities to accumulate. At the center of an explosion where many particles overlap this gives the illusion of a glowing hot center.
Pixar Animation Studios
|