🔽How I made this cool "LED panel" effect in Unity
⚠️Disclaimer: I have no idea what I'm actually doing
#madewithunity #unitytips #shader #vfx #unity
Now, the easiest way of doing this would be with a simple scrolling texture. However, if you need many different messages, you need many different textures, and file size can be a problem if you are targeting mobile platforms (which I'm doing)
So instead, I'm only going to use one "high res" mask texture, and keep all the other ones with a really small resolution, which scales better the more textures you need (I think that makes sense?)
#1, I create a simple panel model in Blender, keeping the screen and the panel itself in different meshes, nothing fancy here
#2 I made my mask with 32 x 8 "leds" in total, which means that as long as the message textures also maintain that resolution, the effect should work (1 pixel = 1 led)
#3 In Unity, create a new Unlit Shader (Create -> Shader -> Universal Render Pipeline -> Unlit Shader Graph), with 3 properties: the main texture, the mask texture, and a Vector2 for the scroll speed. The basic implementation should look something like this
#4 Now we can just offset the UV of the main texture with time, round the value and divide between the number of leds in the mask (32 and 8 in my case) to get the effect we want
And just like that, apply the shader and you are done!
As I said, this is the implementation that better fits my game, probably won't be worth it in most projects, just wanted to share anyways.
Also thanks for 1000 followers :)
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.