The Proximity Shader

This shader is intended to shade a surface depending on the closeness of the surface point to a particle.

Interface

This is the shader's interface:

Using the shader

At render time, for each point on the surface the distance to each particle is measured. If the distance falls within the range 'Min. Distance' to 'Max. Distance' the shader will return a value from 1 to 0. This is then multiplied by a value from the 'Falloff' spline to give additional control over the value returned. Finally, this value is returned as a greyscale colour ranging from white to black.

In many cases the surface point will be within range of more than one particle. You can use the 'Mix Mode' to determine how multiple values are treated to return a colour for that point.

Parameters

Emitter

Drag the emitter generating the particles to shade the surface into this field.

Min. Distance

Particles closer to the surface point than this distance will return a value of 1. The value from the falloff spline will be that from the left-hand end of the spline.

Max. Distance

Particles further away from the surface point than this distance will return a value of 0. The value from the falloff spline will be that from the right-hand end of the spline.

Strength

The strength of the effect. A value of zero will always return zero (black).

Falloff

A spline used to give additional control over the returned value. You can use it, for example, to give softer edges to the circle around the particle. The default spline shown above does that.

Mix Mode

If more than one particle falls within the specified range of the surface point, the values returned from each must be blended in some way to give a final result. This drop-down menu controls how values are blended. The blend modes are the same used in image editors such as Photoshop, and are described in this Wikipedia article.

The options are:

  • Normal
  • Screen
  • Add
  • Lighten
  • Multiply
  • Subtract
  • Difference
  • Darken

Invert

if checked, the returned colour is inverted (i.e. black becomes white and vice-versa).