Shared Output Settings and Properties
All outputs share these settings and property ports. The only exception is the Shader Graph setting which most outputs support, but not all of them.
Setting | Description |
---|---|
Shader Graph | Specifies the Shader Graph Unity uses to render particles this output produces. If you assign a Shader Graph to this property, the Inspector hides some settings and properties that are duplicates of those in the Shader Graph. Also, the Inspector exposes all the Surface Options from the Shader Graph which allows you to edit the Shader Graph properties inside the Inspector for the context. For information on the Surface Options this adds to the Inspector, see the documentation for the type of Shader Graph you assigned. For example, if you assigned an HDRP Lit Shader Graph, see the documentation for the Lit Shader Graph. |
Render State Settings
Setting | Type | Description |
---|---|---|
Blend Mode | Enum | Specifies the blending method for the system and determines how to use the alpha. The options are : • Opaque: Does not use the alpha value and renders the output in the opaque pass. This also writes to the depth buffer. • Alpha: Uses the standard alpha blend mode and renders the output in the transparent pass. By default, this enables GPU sorting for particle outputs (which you can override using the Sort setting). • Premultiplied Alpha: Uses the premultiplied alpha blend mode and renders the output in the transparent pass. By default, this enables GPU sorting for particle outputs (which you can override using the Sort setting). • Additive: Uses the additive blend mode for alpha and renders the output in the transparent pass. |
Use Alpha Clipping | Bool | Indicates whether the system uses alpha clipping and discards pixels under a certain alpha threshold. If you enable this property, use the Alpha Threshold input to set the alpha value below which the system discards pixels. |
Sorting Priority | Int | (Inspector) An offset Unity applies to the rendering order. This setting corresponds to the Material Sorting Priority in HDRP and Material Sorting Priority in URP. It is equivalent to modifying the Material.renderQueue property. This value can be negative or positive. HDRP and URP clamps this value between -50 and 50. |
Generate Motion Vectors | Bool | (Inspector) Indicates whether particles in the system write motion vectors and thus whether the System generates a motion vector pass. This is useful when you want temporal effects, like temporal anti-aliasing or motion blur, to take the output into account. Not all outputs can generate motion vectors and in that case, this setting is not visible. If you enable this setting with a transparent output, an Alpha Threshold input port appears. Use this port to specify the minimum alpha the system requires a pixel to have to write motion vectors for it. This is because motion vectors cannot be blended. |
Exclude From TAA | Bool | (Inspector) Indicates whether the render pipeline excludes particles from temporal anti-aliasing (TAA). This is useful when particles look blurry when TAA is enabled and especially useful for fast moving particles. Not all outputs can exclude TAA and in that case, this setting is not visible. |
Cast Shadows | Bool | (Inspector) Indicates whether particles in the system cast shadows and thus whether the System generates a shadow pass. If you enable this settings with a transparent output, an Alpha Threshold port appears. Use this port to specify the minimum alpha the system requires a pixel to have to write it to the shadow pass. This is because shadows cannot be transparent. |
Cull Mode | Enum | (Inspector) Specifies the cull mode to use with the system. The options are: • Default: Use the default cull mode for the system. • Front: Culls front faces of particles in the system. • Back: Culls back faces of particles in the system. • Off: Culls no faces. This mode makes the output render both front and back faces. |
Z Write Mode | Enum | (Inspector) Specifies the depth writing mode to use with the system. The options are: • Default: Uses the default depth write mode for the system. This is typically On for opaque and Off for transparent. • On: Enables depth writing for the system. • Off: Disables depth writing for the system. |
Z Test Mode | Enum | (Inspector) Specifies the depth test mode to use with the system. The options are: • Default: Use the default depth testing mode for the system. This is typically On. • On: Enables depth testing for the system. • Off: Disables depth testing for the system. This means the output renders regardless of whether the pixels are occluded by closer geometry. |
Particle Options Settings
Setting | Type | Description |
---|---|---|
Color Mapping | Enum | Specifies how to use the main texture to color particle pixels. The options are: • Default: Uses the main Texture color directly (and multiplies it with particle color. • GradientMapped: Uses the Texture alpha to fetch color from the created Gradient port (and then multiplies it with particle color. This property only appears on output Contexts that support texturing. |
UV Mode | Enum | Specifies how to use UVs for texturing. The options are: • Default: Uses UVs as-is to sample textures. • Flipbook: Uses sub-UVs to sample in a flipbook texture. To specify the dimensions of the flipbook texture (frame count per axis) use the Flip Book Size property. To determine the current frame of the flipbook, this Context uses the tex index attribute of the particle. In this mode, the Context does not interpolate between flipbook frames. • FlipbookBlend: Same as Flipbook but uses linear interpolation to blend between frames. This mode uses the fractional part of the tex index attribute to calculate the interpolation amount. • ScaleAndBias: Scales and biases the UV before the Context samples the texture. • FlipbookMotionBlend: Same as FlipbookBlend but uses an additional motion vector texture. To specify the motion vector texture, use the Motion Vector Map input port. To scale the motion vectors, use the Motion Vector Scale input port. This property only appears on output Contexts that support texturing. |
Use Soft Particle | Bool | Indicates whether to use soft particles. Soft particles remove hard intersections between particles and geometry. To specify a maximum distance to geometry at which to fade particles out, use the Soft Particle Fade Distance. This property only appears if Blend Mode is not set to Opaque. |
Flipbook Layout | Enum | Specifies the layout of the flipbook. The options are: • Texture 2D: Uses a single Texture with multiple frames. • Texture 2D Array: Uses a Texture array with multiple slices. This property only appears if you set UV Mode to Flipbook, FlipbookBlend, or FlipbookMotionBlend. |
Sort | Enum | (Inspector) Specifies if this VFX Graph system uses sorting. When the VFX Graph sorts particles for a system, it uses an additional compute pass and calculates how it sorts particles based on the option you have set in Sort Mode. The options for this property are: • Auto: The VFX Graph determines whether to sort the system's particles or not. Unity automatically sets sorting to On for the non-commutative blend modes Alpha and Premulitplied Alpha. • On: Enables particle sorting. • Off: Disables particle sorting. When you use this mode, enable Indirect Draw, and use the Alpha or Premultiplied Alpha blend mode, this causes a flickering effect. This is because the particle order for each frame is not deterministic. Note: The more particles VFX Graph needs to sort, the more resources the sorting process uses. This can make sorting a resource-intensive operation. When you enable particle sorting, Unity enables Indirect Draw automatically. |
Sort Mode | Enum | (Inspector) Specifies how Unity sorts the particles of the Output context. The options are: • Distance To Camera : Unity renders particles that are closest to the Camera in front of all other particles • Youngest in Front : Unity renders particles with the smallest Age attribute in front of all other particles. • Camera Depth : Unity renders particles that are closest to the Camera plane in front of all other particles. • Custom : This mode creates a Sort Key field in the Output context. You can use this to enter a value that Unity graph-computes for each particle. Unity renders particles with the largest Sort Key values in front of particles with lower Sort Key values. Note: When Unity sorts particles, it does not take into account any changes you make to the particles' attributes in the Output context. Exceptions to this rule are Output contexts that use Compute Culling, Frustrum Culling, Generate Motion Vectors, Multi Meshes or LOD. |
Revert Sorting | Bool | (Inspector) Reverses the order in which Unity draws particles from the Output context. |
Indirect Draw | Bool | (Inspector) Indicates whether the system only outputs alive particles as opposed to outputting all particles and culling dead ones in the vertex shader. Enable this setting to improve performance when the number of particles is not at the system capacity or there is a high number of vertices per particle (typically with mesh outputs). Other settings can implicitly enable Indirect Draw. In this case, this setting is enabled, but not visible. The settings that can implicitly enable Indirect Draw are Sort, Compute Culling, and Frustum Culling. |
Compute Culling | Bool | (Inspector) Indicates whether the system culls particles that are not alive in a compute pass rather than in the vertex shader. Enable this to improve performance if you set the alive attribute in the output and have a high number of vertices per particle. If you enable Frustum Culling, it implicitly enables Indirect Draw too. In this case, this setting is enabled, but not visible. |
Frustum Culling | Bool | (Inspector) Indicates whether to cull particles that are outside of the camera frustum in a compute pass. Enable this to improve the performance of large systems where a significant amount of particles can be out of the camera frustum. Note that frustum culling can cause issues with shadow casting as the system does not take culled particles outside of the camera frustum into account during shadow passes. |
Context Properties
Input | Type | Description |
---|---|---|
Alpha Threshold | float | Specifies the alpha threshold to use for pixel clipping. The system only renders pixels with an alpha value above this threshold. This port only appears if at least one of the following condition is met: • Use Alpha Clipping is enabled: Alpha clipping is active for all render passes including main color pass. • Generate Motion Vectors is enabled and the Blend Mode is not Opaque: Alpha clipping is active during the motion vector pass. • Cast Shadows is enabled and the Blend Mode is not Opaque: Alpha clipping is active during the shadow pass. |
Gradient | Gradient | The gradient to use to sample color from texture alpha. This property only appears if you set Color Mapping to GradientMapped. |
Flip Book Size | float2 | The number of frames in the flipbook along x and y dimensions. This property only appears if you set UV Mode to one that specifies a flipbook. |
Motion Vector Map | Texture2D | The texture to use to sample 2D motion vectors for a given pixel. This property only appears if you set UV Mode to FlipbookMotionBlend. |
Motion Vector Scale | float | The scale to apply to sampled motion vectors. This property only appears if you set UV Mode to FlipbookMotionBlend. |
UV Scale | float2 | The scale to apply to the UVs before sampling textures. This property only appears if you set UV Mode to ScaleAndBias. |
UV Bias | float2 | The bias to apply to UVs before sampling textures. This property only appears if you set UV Mode to ScaleAndBias. |
Soft Particle Fade Distance | float | The maximum distance in world space where a particle begins to fade. This property only appears if you enable Use Soft Particle. |
Sort Key | float | The value Unity uses to sort the particles. Unity renders particles with the largest Sort Key value in front. This property only appears if you enable Sort Mode and set it to Custom. |