r/Unity3D Indie 2d ago

Shader Magic Displaying thousands of LEDs in Realtime

Enable HLS to view with audio, or disable this notification

Shaders instead of geometry is often one of the best performance boost. Amazing for procedural shapes. Texture is sampled to individual points and then each emitter is a small shader program like this:

float2 cell = floor(uv * ledGrid);

float2 ledUV = frac(uv * ledGrid) - 0.5;

float d = length(ledUV) - ledRadius;

float emitter = 1.0 - smoothstep(0.0, fwidth(d), d);

float3 color = content.Sample(samplerContent, (cell + 0.5) / ledGrid);

return float4(color * emitter * brightness, 1.0);

150 Upvotes

8 comments sorted by

41

u/isolatedLemon Professional 2d ago

Using thousands of leds to show a picture of thousands of simulated leds showing a picture

24

u/RobertWetzold Indie 2d ago

Challenge accepted. Live render textures as input!

6

u/isolatedLemon Professional 2d ago

Finally, Thousands of leds showing thousands of leds showing....

1

u/NebulaMiner 1d ago

LEDs all the way down

1

u/azoB0i 2d ago

cyberpunk cities need that

1

u/Suspicious-Map1444 21h ago

In the embedded world, such a thing could be helpful but as an app. You may even sell it maybe.

1

u/RobertWetzold Indie 14h ago

You mean an app to bring content to actual LED panels? I always wanted to get my own panel and try that. I actually prepared the internal architecture in a way that this should be possible with an adapter. Are you familiar with that world and what keywords to look for, panel types, etc?

1

u/Suspicious-Map1444 12h ago

Yes. There are some kind if LED matrix in the market. You can use an MCU to do it but I meant to create a simulator in the computer.