Moving RGB Rainbow Stripes

Chat gpt made this for me I think it is an interesting effect I wanted to share. I also have a youtube channle if anyone is interested. https://www.youtube.com/channel/UCREf5gBgyx7QASKsG_5dYEw

Can confirm compatability with Godot 4.1.3 Stable cause that what im using. 

Shader code
shader_type spatial;

uniform float speed : hint_range(0.1, 10.0) = 1.0;
uniform float frequency: hint_range(0.1, 10.0)=1.0;

void fragment() {
    float time = TIME * speed;
    
    // Generate rainbow colors based on the position and time
    vec3 pos = FRAGCOORD.xyz * frequency;
    float r = sin(pos.x + time) * 0.5 + 0.5;
    float g = sin(pos.x + time + 2.0) * 0.5 + 0.5;
    float b = sin(pos.x + time + 4.0) * 0.5 + 0.5;
    
    ALBEDO = vec3(r, g, b);
}
Tags
CRT, rainbow, rgb, tri-color
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.

More from Average Godot Enjoyer

Simple moving noise with glow

Related shaders

Moving Rainbow Gradient

Moving Decal

Circle Rainbow

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments