Operating system: Linux Mint 18.3 Cinnamon 64-bit
Cinnamon version: 3.6.7
Linux Kernel: 4.13.0-39-generic
Processor: Intel Core i5-4430 CPU @ 3.00GHz (4 cores)
Graphics card: NVIDIA GTX 1070 + NVIDIA GTX 760
- 2.79b (official),
- 2.79.6 (build hash: ec20d311da4),
- 2.79.6 (build hash: 5c10c92b23c),
- 2.80 Alpha 2 (build hash: f520f01),
- possibly more
Short description of error
In Blender Cycles, when using particle objects, each particle can be given a specific color using a texture "From Dupli". However, this functionality breaks when enabling the option "Use Modifier Stack" in the particle system settings and there are modifiers in the stack above the particle system that alter geometry. An example of such modifiers are the mirror modifier, the subdivision surface modifier or the array modifier (possibly others as well).
Normally, each particle obtains the proper UV-coordinates using the UV Map node with "From Dupli" enabled. However, with the above options enabled, the UV Map node with "From Dupli" enabled returns a 0-vector, as if there is no UV Map at all. This happens in the viewport as well as the final render.
Unfortunately, having "Use Modifier Stack" enabled while also using the UV Map From Dupli is essential for many particle system effects without a simple workaround.
Note for 2.8: here, the same bug occurs in the final render. However, for the viewport, it seems that even the particle system with "Use Modifier Stack" disabled doesn't receive the proper UV Map From Dupli. In the final render, the particle system with "Use Modifier Stack" disabled renders properly.
Note for 2.7: when returning from the final render back to the viewport render, the particle system with "Use Modifier Stack" disabled suddenly also stops displaying properly. However, unlike in 2.8, this can easily be resolved by switching to e.g. the flat renderer and then back to the Cycles viewport renderer to reinitialize it.
Exact steps for others to reproduce the error
See attached .blend file for the finished result. After opening the file, switch to the viewport Cycles renderer to see that the left cube (with "Use Modifier Stack" disabled) renders the UV as colors, whereas the right particle system (with "Use Modifier Stack" enabled) renders as black cubes. Both have the UV-vector as color input. As you can also see, the "Use Modifier Stack" option is required to have the particles distributed properly...
Steps to reproduce:
- Load the default .blend file. Switch to Cycles.
- Duplicate the default cube, this duplicated cube will be the particle mesh. The existing cube will be the emitter.
- UV-unwrap the emitter cube.
- Create a particle system on the emitter cube. Set the emitter type to "hair" (for convenience only) and under the particle system's "Render" settings, change the render type to "Object".
- Set the particle system's "Dupli Object" to the particle cube (Cube.001). Now, the particles should show up.
- Create a new material for the particle cube (Cube.001). Use an emission node for its surface output.
- Add a "UV Map" node, enable "From Dupli". Use the UV-output as color-input for the emission node. Using the Cycles viewport renderer, you should see the particles display in a nice green-to-red gradient over the emitter cube. So far, this is correct behavior.
- Now, add a modifier to the emitter cube that alters its geometry (e.g. the array modifier for clarity). Make sure it is positioned before (above) the particle system. Now, the particle system should still show up the proper colors. However, the particles aren't properly distributed over the emitter. To fix this:
- Enable "Use Modifier Stack" in the particle settings. Now, the particles should be properly distributed, but they no longer show up the proper colors. Instead, they render as black cubes, indicating that the UV Map From Dupli no longer exists.
Another note: rendering on CPU or GPU does not seem to matter.