- Home /
How do I create an 'energy flowing through a circuit board' effect?
I'd like to make an effect similar to the clip of the circuit board seen here. I've thought about a couple different ways to create this effect, but none of them seem 'right'.
Let a shader do all the work. I haphazardly ported parts of that shader over to HLSL, and it makes for some cool abstract fractal visualizations, but it's super fiddly and doesn't really give me exactly what I'm looking for
Use a modified self-illum shader. I tried this and was able to get something that will flash the glow map and fade out. It's almost there, but not quite what I'm looking for.
Use a material and pan UVs to give the appearance of motion. This would work OK for just straight lines, but not for traces that bend around a lot (unless I'm missing something completely obvious).
Use particle systems and set their motion programmatically. Lots of work, difficult to get exactly the correct paths.
This might just be something that is difficult to implement quickly in Unity, but I want to make sure that I'm not missing anything big or obvious.
Not sure how much of what you see in that video you need. You could create the effect of circuits lighting up in the direction of a flow with a mask and an alpha-cutoff shader.
Answer by Kiloblargh · Apr 24, 2014 at 03:29 AM
An old school (as in mid-90s, 16-bit stuff) effect is palette cycling. Where you have 256 colors and each one moves its index one over each frame and wraps. Another thing they used to do is magic colors for palette swapping- like Warcraft II team colors, everything that was those colors of red on the sprites would be remapped to matching shades of another color.
I don't know how exactly to make that happen in a shader, but that would be the approach I would take. Have a Color32[] as big as you need of different shades of some garish full-saturated color, and another of the colors you want mapped to them, and then create the sprites with gradients of just those specific colors where the animated circuit traces will be and cycle the palette over time.
Your answer