LED BULB EFFECT SPATIAL SHADER

THIS IS A LED BULB EFFECT LIKE SHADER 

 

Shader code
shader_type spatial;

uniform float scroll_speed = 1.0;
uniform float led_size = 0.1;
uniform vec4 led_color = vec4(1.0, 0.0, 0.0, 1.0); // Red LED color

void fragment() {
    vec2 uv = UV; // Use UV mapping for 3D textures
    
    // Create a scrolling effect
    float scroll = mod(uv.y + TIME * scroll_speed, 1.0);
    
    // Simulate LED bulbs with a grid-like effect
    float led_effect = step(led_size, mod(uv.x, led_size * 2.0)) * step(led_size, mod(scroll, led_size * 2.0));
    
    // Set LED color for "on" pixels
    vec4 color = mix(led_color, vec4(0.0), led_effect);
    
    ALBEDO = color.rgb; // Set the final color of the surface
    ALPHA = color.a; // Apply transparency if needed
}
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Simple spatial CRT effect

Spatial particle shader

3D Bubble/Spatial shield shader

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments