DEV Community

Cover image for How Can You Analyze the GPU Performance of VFX Independently in Unity?
GameOptim
GameOptim

Posted on

How Can You Analyze the GPU Performance of VFX Independently in Unity?

Summary

  • VFX performance pressure is generally more significant on the GPU than on the CPU.
  • Isolating VFX from backgrounds, gameplay elements, and other rendering factors makes GPU analysis more reliable.
  • GPU Clocks can help identify which VFX produce the highest GPU pressure.
  • GPU pressure can be further investigated from three perspectives: vertex pressure, fragment pressure, and shader complexity.
  • Metrics such as GPU Input Primitive, Culled Primitives, GPU Fragment Shaded, GPU Total Shader Cycles, and GPU Shader Instructions can help identify the underlying causes.

How Should You Prepare a VFX Performance Test Package?

During gameplay, VFX generally have a relatively limited impact on CPU performance, while their performance pressure is primarily concentrated on the GPU. Therefore, the analysis should focus mainly on GPU performance.

To reduce interference from other game elements, it is recommended to create a dedicated package containing the project's VFX resources.

The test environment can use a default skybox or a static texture as the background, minimizing the impact of the scene itself on the results.

The package should also support playing VFX individually. If the project contains a large number of effects, you can add automatic playback and effect navigation to make testing more efficient.

After each effect finishes playing, clear the relevant resources when appropriate. This helps prevent excessive memory usage from accumulating during long test sessions.

How Can You Separate VFX in the GOT Online Report?

When many effects are tested in the same package, it is important to distinguish individual VFX in the performance report.

When building the test package, use the UWAEngine.Tag API provided by GameOptim to divide the test into separate scenes or tagged intervals, with each VFX treated as an independent analysis unit.

This makes it easier to map performance data in GOT Online back to a specific effect.

How Can You Quickly Identify Expensive VFX?

After uploading the test data to GameOptim GOT Online, open:

GPU Mode → Performance Overview → Pressure Localization

The GPU analysis report provides a detailed view of the rendering performance of each VFX.

Why Is GPU Clocks Useful for VFX Analysis?

GPU Clocks represents the number of GPU clock cycles used per frame during the test. It provides a direct indication of the GPU workload for the current frame.

By comparing the GPU Clocks curve with the previously defined VFX scene names or tags, developers can quickly identify which effects generate relatively high GPU pressure.

When many VFX are included in the test package, the Scene Overview → Performance Overview page can make the comparison more efficient.

The scene performance table provides performance metrics for all tested effects. Developers can sort the table by GPU Clocks in descending order to quickly identify the VFX with the highest GPU pressure and prioritize them for optimization.

How Can You Locate the Source of VFX GPU Pressure?

After identifying the most expensive VFX, the next step is to determine why they are expensive.

A useful way to break down VFX GPU pressure is to analyze three major areas:

  1. Vertex pressure
  2. Fragment pressure
  3. Shader complexity

Each represents a different stage or source of GPU workload.

Is High Triangle Count Causing the Vertex Pressure?

Triangle count can be checked in the Rendering Statistics module.

For a VFX with a relatively high triangle count, combine this information with:

  • GPU Input Primitive
  • Culled Primitives

These metrics can help determine why the effect is processing a large number of primitives.

For example, a high triangle count combined with a large number of culled primitives may indicate that some geometry is being submitted for rendering but ultimately contributes little to the visible result.

This provides a more targeted direction for checking and optimizing potentially wasted geometry.

Is Overdraw Causing the Fragment Pressure?

GPU Fragment Shaded directly reflects the workload generated during the fragment shading stage.

Because the dedicated VFX test package removes the influence of rendering resolution and post-processing on the effect's GPU workload, this metric can be used as a useful indicator of the VFX's own rendering and overdraw pressure.

For VFX with relatively high fragment pressure, developers can manually perform an Overdraw Dump during testing.

The Overdraw page provides an overdraw heatmap, allowing developers to visually inspect where excessive fragment processing occurs.

For example, an effect may not look particularly complex in the final image while still generating substantial overdraw.

Left: VFX appearance | Right: Overdraw heatmap

This is an important case to investigate because visual complexity and rendering cost do not always correlate directly.

Is Shader Complexity Causing the GPU Pressure?

Shader execution is another important source of VFX GPU workload.

GPU Total Shader Cycles reflects the overall shader computation complexity during VFX playback, while GPU Shader Instructions represents the number of shader instructions executed by the GPU.

By comparing these metrics with the VFX's overall GPU workload, developers can determine whether shader computation is a major contributor to the effect's GPU pressure.

If shader complexity is confirmed as the primary bottleneck, the next step is to analyze the individual shaders used by the effect.

For single-shader analysis, developers can use the Mali Offline Compiler to obtain metrics such as the shader's instruction count and clock cycle count.

This provides a more granular view of shader execution cost and can help guide further shader optimization.

What Is a Practical Workflow for VFX GPU Optimization?

A practical workflow can be summarized as follows:

  1. Isolate VFX from other gameplay and rendering elements.
  2. Create independent test units for individual effects.
  3. Tag each VFX using UWAEngine.Tag to simplify report analysis.
  4. Run GPU analysis with GameOptim GOT Online.
  5. Rank VFX by GPU Clocks to identify the most expensive effects.
  6. Analyze vertex pressure using triangle count, GPU Input Primitive, and Culled Primitives.
  7. Analyze fragment pressure using GPU Fragment Shaded and Overdraw data.
  8. Analyze shader complexity using GPU Total Shader Cycles and GPU Shader Instructions.
  9. Inspect individual shaders with Mali Offline Compiler when necessary.
  10. Optimize the actual bottleneck instead of optimizing VFX based only on visual complexity.

Key Takeaways

  • VFX should ideally be analyzed in an isolated test environment rather than directly inside complex gameplay scenes.
  • GPU Clocks is useful for quickly ranking VFX by GPU workload.
  • High GPU pressure does not necessarily have a single cause. It may come from excessive geometry, overdraw, or shader computation.
  • Triangle count + GPU Input Primitive + Culled Primitives can help investigate vertex-related pressure.
  • GPU Fragment Shaded + Overdraw can help identify fragment and overdraw pressure.
  • GPU Total Shader Cycles + GPU Shader Instructions can help determine whether shader computation is a major contributor.
  • When higher-level GPU metrics point to shader complexity, individual shaders can be analyzed further with Mali Offline Compiler.

FAQ

Should VFX performance be analyzed separately from the game scene?

Yes, when the goal is to understand the GPU cost of the VFX itself. Isolating effects removes interference from elements such as terrain, characters, background rendering, resolution, and post-processing, making the resulting performance data easier to interpret.

Which metric should I check first when comparing multiple VFX?

GPU Clocks is a useful starting point because it provides a direct indication of GPU workload per frame. Sorting VFX by GPU Clocks can quickly reveal which effects deserve further investigation.

Does a high triangle count always mean that a VFX is expensive?

Not necessarily. Triangle count should be analyzed together with metrics such as GPU Input Primitive and Culled Primitives to understand how much geometry is actually contributing to the GPU workload.

How can I determine whether overdraw is the main problem?

Check GPU Fragment Shaded and use an Overdraw Dump to inspect the overdraw heatmap. A VFX can appear visually simple while still generating significant overdraw.

How can I analyze a specific shader used by a VFX?

After identifying shader complexity as a potential source of GPU pressure, use Mali Offline Compiler to analyze the individual shader's instruction count and clock cycle count.

Top comments (0)