In-camera Rainbow motion blur

So, I’ve had the idea for a lightsaber that appears white, but when swung it reveals the visible light spectrum in the motion trail. I’ve tried changing the color every frame, or even multiple times a frame, but the motion blur changes color every frame instead of trailing the previous frame’s color. Is this possible to do in Cycles? If not, is it possible anywhere else, or if all else fails, how can it be faked?

So I’ve been on quite the journey trying to figure this out! Long story short: It doesn’t seem to be easily doable in Cycles, but it’s a very quick to set up something like this in Eevee.

Regarding Cycles:
The big issue seems to be that Cycles doesn’t interpolate the frame driver when evaluating the material for motion blur. This means that, when you’re rendering frame 9 all subframes will use 9 for the material drivers, even though the frame might be half way between frame 8 and 9. I wonder if that’s a bug.

Workaround: If your Material is using other drivers to change the hue of the lightsaber (like location or rotation) Cycles will correctly evaluate the color based on the position of the object in the subframe. If you find a way to nicely tie the light sabers color to its position you might be able to do it that way.

Eevee:
In Eevee the setup is as simple as you’d expect. Create a material that changes the color based on the frame with a driver. Enable motion blur and really crank up the steps. Done! The only issue is that, as far as I know, you can’t enable motion blur in eevee for single objects.

Comparison Renders

Cycles with frame driver:

Cycles with location driver:

Eevee with frame driver:

Node setups images

Cycles with frame driver:

Cycles with location driver:

Eevee with frame driver:

Edit:
After playing some more this is the best I could achieve with Eevee:

Setup and blend file


rainbow-trail.blend (1.0 MB)

2 Likes

That was incredibly comprehensive and incredibly helpful! Thanks so much! I guess using EEVEE as part of a pipeline isn’t such a bad idea! XD

1 Like