Steps to correctly propagate alpha color fade in 3D model mesh particles that are not billboard (flat image). Unity's Particle System (Shuriken) allows you to easily implement not only flat images (billboards), but also effects that release and scatter large amounts of 3D model meshes (leaves, rocks, coins, medicine bottles, etc.) in space (Mesh release mode). When using these mesh particles, in order to improve the quality of the effect, it is common to use the "Color over Lifetime" module to make the emitted mesh gradually turn red over time, or finally become transparent and disappear (alpha fade out). However, despite setting a beautiful gradation color in the inspector, have you ever been bothered by the vertex color non-reflection bug? ``The color of the mesh does not change at all on the game screen, and it freezes and falls with the solid texture of the material,'' or ``The mesh that is supposed to be transparent suddenly disappears in the last frame, which looks unnatural.'' In this article, we will explain the root cause of this problem using the analogy of "white sculpture and a projector" and explain in detail the graphics settings (Custom Vertex Streams) and shader binding procedure.
1. Understand with an analogy: ``A white plaster sculpture and a special projector that bounces off the projection''
In order to intuitively understand this bug in which colors are not reflected by mesh particles, let's imagine ``A production in which a projector (color module of Particle System) is used to project a colorful image onto a white plaster sculpture (3D mesh) on a museum stage''.
As a director (developer), you want to make a white sculpture emitted onto the stage gradually turn into the color of the setting sun as time passes, so you turn on the projector. However, no matter how much light is shined on the sculpture, it remains pure white plaster and does not budge. When I investigated, I found three problems.
The first problem is that the surface material of the sculpture (mesh asset) does not have the property of absorbing and reflecting light (vertex color COLOR channel) in the first place, and all light is transmitted or nullified.
The second problem is that the "connection cable (Custom Vertex Streams)" used to send color data from the projector has been disconnected, and the projector itself is only outputting pure white light (default value).
The third problem was that the paint (shader) applied to the sculpture was not designed to mix with the light from the projector (color multiplication), and was designed to only reflect the paint's own color.
This is the true nature of 'color reflection failure bug' in mesh particles. The color will only be reflected when all three things work together: preparing a ``vessel'' for the 3D model itself to receive color information, connecting a cable that sends ``color data'' from the particle system to the GPU, and using a shader to multiply that color by the material color.
2. Unbound data stream and unsupported shader
When emitting particles with a billboard (plane board polygon), Unity automatically binds vertex color information (`COLOR` semantics) to the GPU. However, in the case of mesh modes that emit external 3D models (such as FBX), the process of transferring color data from the particle system to the mesh is cut (deactivated) by default to save memory. There are three technical reasons:
Cause 1: "COLOR" is not registered in Custom Vertex Streams
The `Custom Vertex Streams` settings in the Renderer module of Particle System define which vertex information (coordinates, normals, colors, UVs, etc.) is transferred to the GPU. In the initial state, only the original vertex coordinates and UVs of the mesh are sent, and the `Color` information is not included in the stream (transfer buffer), so no matter how much the shader side tries to sample the vertex color, the value will always remain `(1, 1, 1, 1)` (white).
Cause 2: There is no vertex color channel in the mesh asset.
When creating a mesh using 3D modeling software such as Blender, please make sure that you have added one or more "vertex color layers" to the model itself before exporting it. If the model itself does not have a color buffer, Unity will not allocate a color buffer for the mesh vertex data itself and will not be able to receive the transferred colors.
Cause 3: The material shader does not multiply the vertex color (Vertex Color)
The material shader (custom shader, Shader Graph, etc.) applied to the mesh multiplies the original color (Albedo) of the texture by the `Vertex Color` sent from the vertex (`Color * VertexColor`) processing is not performed internally, the color will of course remain specific to the material and will not change.
3. Step-by-step procedure for solution
Step 1: Stream binding in Particle System's Renderer module
- Select the target Particle System game object.
- Open the Renderer module at the bottom of the inspector.
- Enable the **`Custom Vertex Streams`** checkbox.
- Add **`Color (COLOR)`** to the stream list using the `[+]` button.
☑ Custom Vertex Streams
- Position (POSITION)
- Color (COLOR) <-- これを追加!
Step 2: Add vertex color multiplication node in Shader Graph
If you are using Shader Graph for your own material for mesh, please make the following connections.
- Open the Shader Graph editor.
- Create a new “Vertex Color” node.
- Create a "Multiply" node that connects the main color output such as "Sample Texture 2D" and the output of "Vertex Color".
- Connect the result of the multiplication to Base Color (and Alpha for alpha transparency effects) in the master stack.
4. Checklist for mesh particle color settings
| Layer to check | Check item | Corresponding action |
|---|---|---|
| 1. 3D model (DCC tool) | Presence of mesh vertex color buffer | Export including ``Vertex Colors'' in the export settings of Blender etc. |
| 2. Particle System | Custom Vertex Streams | Explicitly bind `Color (COLOR)` in the Renderer module. |
| 3. Shader / Material | Vertex color multiplication logic | Sample the `VertexColor` in the shader and multiply it by the base color and alpha. |