image-20240920-103439.png

The pxGradient plug-in has a similar functionality to the gradient function in Photoshop.

It can be applied on a container that holds a geometry, an image, or even an empty container. You can define as many gradient stops as you wish, as well as their origin points, angles, and extent. You can also define the gradient on the alpha channel (256 levels) and introduce turbulence noise that complies with the defined gradient.

Note: This plug-in is located in: Plugins -> Shader -> PixelFX

At the top of the pxGradient parameters, you see the controls that let you define the direction, radius and origin of the gradient. Below that you see a two radio button sets. The first lets you set the gradient type, followed by three Repeat types.

Below that, you see the color slider, the color values and alpha ramp settings.

Note: Under the title Color Ramp and Alpha Ramp, you have an active/inactive option, should you want to have an RGB ramp and no alpha ramp, or vice versa.

Below the RGB and Alpha area of the editor, you find the option of adding Turbulence to the gradient. The turbulence has three simple parameters. Amount determines how aggressive the turbulence looks. Wavelength determines how big or small the turbulence increments are. Progress (similar to that in TextFX plug-ins) allows you to breathe life into the turbulence, providing interesting an effect when animated.

At the very bottom, it is important to make sure that you turn off the Show GUI button, whose default is On; if shown On Air, the effect is more embarrassing than dramatic.

Best Practices

It is important to understand that pxGradient is actually drawing pixels. If this plug-in is applied to an empty group or if it is applied to a geometry object that does not contain a texture, the gradient plug-in generates the texture into which it draws its pixels. So if you have a cube and add pxGradient to it, it behaves exactly as a texture. However it can also work in conjunction with a texture. If you then take an image and drop it on the cube, you give a color wash to the image that works in a gradient-like fashion. The gradient-generated texture can also be edited via the texture editor as any other texture would be.

The biggest benefit of using pxGradient is conservation of texture memory. Instead of storing very many different alpha and color ramps in your image pool, you can achieve the overwhelming majority of these effects by well thought out and judicious use of pxGradient. It has a minimum performance penalty and it can be animated. If you use ramps often in your designs, pxGradient is one of your handiest tools.

Tips and Tricks

Often, reflection maps are placed on a translucent geometry to create a glass-like reflection (think of a light box or an aquarium).

For the reflection texture, one often uses an image of static noise or ramps of sorts. Since the texture is mapped on the object using a reflection mapping mode, it is very difficult to create the right intensity of noise in your texture so that the resulting reflection looks good.

The pxGradient turbulence functionality allows you to set the intensity of the noise of the texture “on the fly”, minimizing the round-trips to Photoshop.