Media and Particle Systems


Particle systems are commonly used in computer graphics to model various types of special effects such as fire, fluids, and flocking behavior of birds. Particle systems are collections of particles, typically point masses, in which the dynamic behavior of the particles can be determined by the solution of sets of coupled differential equations.

One can think of a particle system as dozens, hundreds, or even thousands of balls bouncing around and interacting with the light and objects in the scene. In general, particles are a kind of material, so they are created, applied, adjusted, and removed like a material. Particles are emitted from surfaces, and they can realistically collide with other surfaces while showing the effects of gravity and other phenomena based on natural physics. The parameters of a particle system can also be changed over time.

See the following links for examples:


Media in Povray

The notes below are excerpts from the POV-Ray tutorial.

Particle systems in Povray/Moray are generated using the media statement. Media can be global (atmosphere) or local to an object. In the latter case, the media is attached to the object as a material.

The media statement is used to specify particulate matter suspended in a medium such air or water. It can be used to specify

Media works by sampling the density of particles at some specified number of points along the ray's path. Sub-samples are also taken until the results reach a specified confidence level.

Media can be used in 2 ways::

Syntax:

MEDIA:
    media { [MEDIA_IDENTIFIER] [MEDIA_ITEMS...] }
MEDIA_ITEMS:
    method Number | intervals Number | samples Min, Max |
    confidence Value  | variance Value | ratio Value |
    absorption COLOR | emission COLOR | aa_threshold Value |
    aa_level Value | 
    scattering { 
       Type, COLOR [ eccentricity Value ] [ extinction Value ]
    }  | 
    density { 
       [DENSITY_IDENTIFIER] [PATTERN_TYPE] [DENSITY_MODIFIER...]
    }   | 
    TRANSFORMATIONS
DENSITY_MODIFIER:
    PATTERN_MODIFIER | DENSITY_LIST | COLOR_LIST |
    color_map { COLOR_MAP_BODY } | colour_map { COLOR_MAP_BODY } |
    density_map { DENSITY_MAP_BODY }

Media Types

There are three types of particle interaction in media:

All three activities may occur in a single media. Each of these three specifications requires a color. Only the red, green, and blue components of the color are used (no filter and transmit). The following two lines are legal and produce the same results:

emission 0.75
emission rgb<0.75,0.75,0.75>

Scattering

scattering { Type, COLOR [ eccentricity Value ] [ extinction Value ] }

Density

The density statement allows you to vary the density across space using any of POV-Ray's pattern functions such as those used in textures. If no density statement is given then the density remains a constant value of 1.0 throughout the media.

The pattern type is any one of POV-Ray's pattern functions such as bozo, wood, gradient, waves, etc. Of particular usefulness are the spherical, planar, cylindrical, and boxed patterns. All patterns return a value from 0.0 to 1.0. This value is interpreted as the density of the media at that particular point.

Examples

Very Simple Povray Examples


Absorbing - Code


Scattering - Code


Emmision - Code


Atmospheric Media
with Spotlight - Code



Refraction - Code

More Complex Povray Examples

Povray Code: Uses atmospheric media with spotlight. Particles are scattering with bozo density.

Uses atmospheric media with spotlight. Particles are scattering with wave density. For the moray code, see vase.mdl in our lab folder L:\classes\cs140.

Povray Code: Uses object media with spotlight. Particles are scattering (green), emissive (blue), and absorptive (white) with bozo density.

See POV-Ray Tutorial for many more details!

A number of examples came with Povray. For what the images look like, click here. To find the code, look in the folder
C:\Program Files\POV-Ray for Windows v3.6\scenes\interior\media


[Top]

[Home]