Basically the sphere has an emission shader that I want to only emit when a particle passes through it. It is supposed to be a muzzle flash from a firearm and right now I have to manually animate it to line up with each particle. So the question is there a way to have each particle effect the emission shader. I was thinking that I could use particle age but I have no way to link it between the two different objects materials. Is there some way to have the particles weight paint the sphere kind of like you can do with two objects? Or should I make the muzzle flash a particle system too? that copies the emission pattern of the bullets.
1 Answer
Using dynamic paint
Result:
How to:
UV unwrap your "receiver" object (I'm using a cylinder)
On that object, enable (from the Physics panel): Dynamic Paint > Canvas > Add Canvas. Make its type "Image Sequence", and its initial color completely black. Enable "Dissolve" and use a very short time for dissolve, like 5.
Select the Emitter object, enable: Dynamic Paint > Canvas > Add Brush. Make the brush fully white. Change the "Source" to "Particle system" and select the correct particle system. Increase the brush radius.
Go back to the target object, select the correct "UVMap" under "Dynamic Paint Output", and bake the Image Sequence.
Create a material for the target that has an emission shader modulated by the Dynamic Paint paintmap (for the Image Texture, remember to open all the image files together with Ctrl+Shift+Select, and "Detect Sequences" activated):
-
$\begingroup$ Very helpful thank you. However, I have multiple particle systems because this is supposed to be a gun firing and because of how the particles work if I want it to have a 3 round burst at frame 10 then have another 3 round burst at frame 20 I have to have two separate systems that are copies but with different emission start times. Can I select two systems as the same brush? $\endgroup$ Nov 26, 2018 at 18:53
-
$\begingroup$ nevermind I found a workaround thank you for this helpful answer. $\endgroup$ Nov 26, 2018 at 19:00
-
$\begingroup$ glad it helped! anyway you can add several brushes to the same emitter $\endgroup$ Nov 26, 2018 at 19:56
-
$\begingroup$ Yea my workaround solved that issue entirely I have it contained to one particle system. $\endgroup$ Nov 26, 2018 at 21:20