How to achieve this effect in an easy way?


I always wondered if there is an easier way to achieve this effect (the green light stripes):

My current approach is to align the UVs and make the texture scroll (as you can see it´s messed up right now). This takes a lot of time. Is there an easier way to do this? Through a shader or something (I have zero experience in shader writing)?

It´s from an UE4 experiment of mine. Don´t stone me to death for this :smiley:

Shaders are absolutely the way to do this. Whilst I can’t tell you off the top of my head what the best approach is, you’ll probably want to look at having a scrolling gradient which you then tint. The speed of the scroll can be controlled through an exposed property, as can the colour tinting etc.

If you’re not familiar with writing shaders, then looking at something like Shaderforge would be a good start. It’s fairly similar to UE4 with respect to building shaders.

If you’re shading in world space coordinates you don’t need to worry about lining up the UVs, but if you want them in object coordinates then the way I’ve always done it is the same as you describe you’re already doing.