Skip to Content
Procedural Slash TrailShader Customization

Shader Customization

Shader Graph Overview

Shader Graph Overview When you open the SlashTrailShader, you’ll notice a collection of reusable sub-graphs, each designed to handle specific visual effects. On the left side, you’ll see several categorized properties. While some property names may seem confusing at first, they’re simply shorthand references to the corresponding sub-graphs. For example:

  • TWAM refers to TrailWidthAlphaMask
  • TM refers to TextureMask

Configuring the Shader

There are two ways to configure the shader’s properties:

  1. Exposing Properties in the VFX Graph
    This method allows you to modify parameters directly in the VFX Graph, enabling live tweaking while pausing the effects. However, if you expose too many properties, the list can become cluttered.

  2. Setting Values Directly in the Shader Graph
    This method avoids creating additional properties. Instead, you set values directly within the shader graph itself. While this keeps things cleaner, changes will require saving the shader graph, triggering a recompile. This prevents live tweaking while the effect is paused.

You can choose which properties to expose and which to configure directly in the shader graph based on your workflow.

Sub-graphs

  • TrailThickness: Adjusts the thickness of the trail.
  • TrailShape: Controls the trail’s overall form, including width, radius, and curvature.
  • TrailUVSelect: Allows you to randomize the UV coordinates. You can choose to randomize the U-axis, V-axis, both, or none.
  • UVDistortion: Distorts the UV using flow maps to create dynamic motion effects.
  • AlphaErosion: Controls the erosion of the trail’s alpha, allowing you to create fading effects either over phase or along the trail itself.
  • TextureMask: Offers flexible masking options with control over both color and alpha. It allows you to utilize different texture channels and apply operations like multiply, subtract, or add. The mask can be adjusted using remapping and UV controls, including tiling, scrolling, and rotation for enhanced flexibility.
  • TrailWidthAlphaMask: Adds an alpha mask along the vertical axis of the trail to control transparency.
  • TrailWidthColorMulti: Similar to TrailWidthAlphaMask, but modifies color instead.
  • ColorVibrance: Enhances color intensity and vibrancy across the trail.
  • SoftParticle: Improves blending between particles and the background, reducing harsh edges.

Example Configurations

  • UV Distortion: Using a flow map, the UVDistortion node shifts UV coordinates to create a dynamic warping effect. Adjust ScrollSpeed, Intensity, and Variance to control the distortion. You can simply use a Sample Texture 2D node to preview how it works. UV Distortion

  • Combining Multiple Texture Masks: You can combine mask textures to enhance detail or to create a brighter, more pronounced mask. Try the different operation options. Texture Mask

    If you’re manipulating the Alpha channel, use a Swizzle node to preview the result.


  • Masks on the trail’s Y-Axis: The Trail Width Mask nodes provide precise control over the appearance of the trail along its Y-axis.

    • Setting the MaskScale to 1 highlights the center of the trail.
    • Setting the MaskScale to 0.5 erodes the color from the inner to the outer edges, creating a smooth gradient effect.

    Trail Width Mask

    Experiment with the color multiplier to see how it affects the mask.

Last updated on