Skip to content

xpSampleShader

The xpSampleShader can be used in any material channel which has a shader link.

For every point to be shaded on an object surface, the shader looks at a chosen parameter of all particles which are within a specified distance.

The parameter might be the particle speed, age, temperature, etc.

In its default mode, from those particles, the shader calculates an average value used as an index into a gradient; the color returned from the gradient is then used to shade the surface point.


xpSampleShader_UI.png

xpSampleShader menu settings.

A link field for the emitter to be sampled.

Set as Speed, by default, this is the particle data that will be sampled.

xpSampleShader_01.png

In this scene, the Sample Parameter being sampled is Radius, dictating where, in the color Gradient, the shading occurs from.

You can choose from a variety of parameters, including Custom Data, if required.

If you choose Custom Data, you will see the following three additional settings.

xpSampleShader_Sample Menu.png

Sample Parameter set to Custom Data.

Only custom data which are integers, floating point numbers or time values can be used here.

Other types are not supported.

The ID and name of the custom data, used to identify the custom data item.

Set as Simple Average, by default, this drop-down menu determines how the index into the gradient is calculated.

What difference you see between these options depends, to a great extent, on how many particles affect the point to be shaded (which in turn is affected by the Max Distance setting).

In some cases you may see little or no difference between these options.

The other options available are: Weighted Average and Nearest Particle.

A simple mean value of the parameter from all the particles within range is used.

With this option, more weight is given to particles nearer the shaded point.

The weighting is controlled by the Weighting spline control (see below).

The parameter of the nearest particle to the shaded point is used.

No other particles are taken into consideration.

These are the minimum and maximum settings for the selected sample parameter.

If the parameter value is less than the minimum value, the color at the left-hand edge of the gradient is returned; if it is greater than the maximum value the color at the right-hand edge of the gradient is returned.

Any particle further away than this distance from the shaded point will not be included in calculation of the color for that point.

The color is chosen from this gradient, as described above.

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


xpSampleShader_02.png

Here, there is an Earth shader with the sample shader beneath it. Note: The Earth shader is set to Overlay. In the sample shader, Base Color is set to 50% Gray. With these settings, the colour from the sample shader is overlaid on the Earth shader without any of the base color (gray) being visible.

Set as 50% Gray, by default, this is the color the shader will return if no particles are within range of the shaded point.

The other options are: Black, White and Custom.

A color field which is only available if Base Color is set to Custom.

Set as Normal, by default, this controls how the color from the gradient is blended with the base color.

The usual choices are available, such as Add, Difference, Multiply, etc.

This controls the ratio in which the gradient and base colors are mixed.


This spline controls the weight given to particles at different distances from the shaded point.

It is only available if Mode is set to Weighted Average.

xpSampleShader_07.png

The default Weighting spline is controlling the weight given to particles here.

xpSampleShader_08.png

In this second image, a custom Weighting spline is adding control over where colors start and end.


If this box is checked, the Falloff spline becomes available.

This lets you produce soft edges to the rendered circle rather than hard edges.

This spline controls the falloff of the rendered circle.

xpSampleShader_03.png

With no falloff set, the shading is hard, around the edges.

xpSampleShader_04.png

This gentle downwards Falloff setting gives a gradual fade towards the edges.

xpSampleShader_05.png

In this image, the Falloff has been pushed further towards the edges.

xpSampleShader_06.png

This final custom Falloff setting is creating rings, with softened edges.


Copyright © 2026 INSYDIUM LTD. All rights reserved.