2.5. Effects

2.5.1. Glow

Chris Huff

This atmospheric glow effect makes a fast-rendering glow effect. It is based on the light source glow effect from POV-AFX, written by Marcos Fajardo, but has been heavily modified.

Syntax is:

glow {
  type 0 | 1 | 2 | 3
  location VECTOR
  size FLOAT
  radius FLOAT
  fade_power FLOAT
  color COLOR
  TRANSFORMATIONS
}

You can specify glows individually, or attached to a light_source. If created in a light source, they will be automatically initialized with the light's position and color (though transforming the light source will not give the expected result).

Choose a glow type from 0, 1, 2 or 3. Type 2 and 3 glows are not completely implemented yet, but 2 will be based on the exp() function and 3 will simulate a sphere with constant density.

The size keyword adjusts the scale of the glow effect. It is not an absolute size, just a scaling amount (because some glows are infinite). It does not quite work properly yet, it causes strange effects with changing distances of objects behind the glow.

The radius keyword specifies a clipping radius confining the glow to a circular area perpendicular to the ray. If the glow is still visible at this radius, it will make a sudden transition.

The fade_power keyword allows you to provide an exponent to adjust the falloff with.

[Note]Note

A glow is not an object, it is an atmospheric effect. Therefore glows cannot be used in CSG operations.

Transformations on a glow only affect the location vector. So will scale not change the size or shape of a glow, but scale the location coordinates.

2.5.2. Motion blur

Nathan Kopp

A motion_blur object is created by averaging many transformed copies of that object. Because only part of the image has to go through some extra calculations, this internal motion blur is usually faster than averaging whole images with an external program.

This patch only does per-object motion blur. The camera cannot be blurred using this method.

Also lights can be blurred using this method: the performance is comparable to the performance of area lights.

To initialize motion blur, add the following to your global_settings block:

  global_settings {
    motion_blur SAMPLES, SHUTTER-TIME
  }

SAMPLES is the number of time-frames that will be sampled. More samples will give smoother results, but will take longer to render.

SHUTTER-TIME is the amount of time the shutter is open in POV-clock units. Depending on the specified type, this time interval will be centered around, or added to the clock value for the current frame.

[Note]Note

Especially in animations it will give more natural results when this value is kept close to the clock_delta value. You could #declare Shutter_time = clock_delta*Small_factor;

To create a Motion Blur object, use the following syntax:

  motion_blur {
    type 0 | 1
    OBJECT | LIGHT-SOURCE
    OBJECT-MODIFIERS
  }

Type 0 will oscillate the motion blur around the current clock value. Half of the SHUTTER-TIME value is subtracted from, the other half added to that clock value. Type 0 is the default.

Type 1 will add the full SHUTTER-TIME value to the current clock value.

Motion blur is triggered by the keyword clock. Any modifier in the motion_blur block that contains the clock keyword will show a blurring effect on that modifier.

Example:

  motion_blur {
    sphere { 0, 1  material { My_material rotate x*clock}}
    translate x*clock
  }

Here the clock keyword within the material will trigger a rotational blurring of this material and the clock keyword within the motion_blur block will trigger a motion blur in the translation of the sphere.

[Note]Note

A motion_blur object contains many copies of the blurred object (one copy for each time sample). For this reason, adding this kind of motion blur can use a lot of memory. Be careful of this. (Remember that multiple copies of mesh objects do not use much memory, though.)

[Important]Important

The blurring is achieved by parsing the contents of the motion_blur object (everything between the curly braces) many times (once for each time sample). Anything outside of the motion_blur block is only parsed once. This means that only one copy gets created of any item declared outside the blur object. And this static copy is applied to each copy of the motion-blurred object.

2.5.3. Fur

Thomas Willhalm

The fur patch extends media to generate faked three dimensional fur. This is done by "filling" a media container with a new scattering type 6. The light is scattered inside the container approximately like a lot of hairs would scatter them. Furthermore, the density is varied between dense regions ("Here is a hair.") and sparse regions ("Space between the hairs").

The syntax is:

scattering { 6, COLOUR
	[ structure { OBJECT_TYPE } ]
	[ ratio FLOAT ]
	[ falloff FLOAT ]
	[ frequency FLOAT ]
	[ diffuse FLOAT ]
	[ reflection FLOAT ]
	[ reflection_exponent FLOAT ]
	[ force VECTOR ]
	[ waves FLOAT ]
	[ pigment PIGMENT ]
}

OBJECT_TYPE:
  sphere { VECTOR, FLOAT } |
  torus { FLOAT, FLOAT } |
  box { VECTOR, VECTOR } |
  cylinder { VECTOR, VECTOR, FLOAT } |
  cone { VECTOR, VECTOR, FLOAT } |
  plane { VECTOR, FLOAT } |
  smooth_triangle { VECTOR, VECTOR, VECTOR, VECTOR, VECTOR, VECTOR }

In order to simulate fur, we need a structure to which we attach the hairs. The structure provides the positions and directions in which the hairs grow. The possible object types sphere, torus, box, cylinder, cone, plane, and smooth_triangle and their respective parameters are known from POV-Ray™. Remark however, that the provided structure is not necessarily tied to the type of container you use. You are free to fill a (complicated) container with a different (approximating) structure. The default structure is a sphere at the origin with radius 1.

With the next three parameters you can influence the way hairs are grown. The ratio is the ratio between hairs and empty space (default: 0.3). The falloff value describes how fast the density changes from dense (hair) to sparse (space). It you change the default value 0.9, you can create sharper hairs or more fluffy fur. The frequency (default 200.0) determines the scale of the fur (lots of thin hairs vs. fewer thicker hairs).

The next three parameters describe how light is reflected in the media. The diffuse component is similar to the diffuse reflection in usual textures. The default value however is 5.0. The reflection component creates highlights on the hairs. The default reflection is 1.0. The appearance of the reflection can be modified by the reflection_exponent varying from bright spots to soft areas. The default exponent is 1.0.

With the parameter force you can simulate a force pulling the hairs in one direction. Applications include gravity and wind. The vector that you provide determines the direction and the strength of the force.

Curly fur can be created by setting the parameter waves. The larger this parameter is, the bigger the turbulence of the hairs.

Last but not least the fur patch provides a convenient way of setting a pigment of the fur. If you're modelling a tiger or a cow, you can realize the colors by using pigment. The default value is the usual colour of the media. Using a pigment overrides this colour.