In this lesson, you will learn how to reduce GPU memory bandwidth by stripping away unused vertex data from your Shuriken particle systems.
Understanding the Vertex Burden
By default, the Shuriken Particle System sends a massive amount of data to the GPU for every single particle, including positions, normals, tangents, colors, and UV sets. Even if your material doesn't use a normal map or a vertex color gradient, the system still allocates buffer space for that data. When you have thousands of particles, this "data bloat" significantly increases memory bandwidth requirements and slows down rendering performance.
Configuring Custom Vertex Streams
Custom Vertex Streams allow you to surgically define which vertex attributes are actually sent to your shader. Instead of using the default "everything" layout, you can choose exactly what your specific effect needs.
- Select your Particle System in the Inspector.
- Locate the Renderer module.
- Check the Vertex Streams box and click Custom.
- You will see a list of available attributes. Remove any that your shader doesn't explicitly sample (like
Normal,Tangent, orColor).
If you are writing a custom shader for these particles, you must ensure your struct matches the streams you've enabled. For example, if you only need position and UVs, your vertex input struct should look like this:
struct Attributes {
float3 positionOS : POSITION;
float2 uv : TEXCOORD0;
};
By removing unnecessary streams, you shrink the size of the vertex buffer per particle. This allows the GPU to process more particles per frame because each vertex occupies fewer bytes, significantly improving cache efficiency and reducing the stress on the graphics memory bus.
When to Use This
This optimization is most critical for mobile platforms or particle-heavy scenes where you are reaching the limits of your vertex throughput. Always start by auditing your shaders—if a shader is simple and opaque, it likely doesn't need tangent data for normal mapping or even color data if the tint is applied globally.
Key Takeaway: By disabling unused vertex streams in the Particle System Renderer, you directly reduce the bandwidth cost per particle, allowing for denser effects with a lower performance footprint.