This Could Have Been A Tree Shader

A cute flag shader where you can tweak how visible the rainbow is. Or less visible. Or way less visible. Or-

…anyways.

The rainbow can be made dimmer, weaker, or more vibra-

ANYWAYS

The X can be made thicker.

Much thicker.

Then thicker again.

In fact, a concerning amount of development time was spent investigating just how thick an X can reasonably become before it stops being an X and starts qualifying as urban infrastructure.

I, yes I, the author and developer of this magnificent shader highly and sincerely suggest you try out setting the cross_thickness value to a 100 for maximum visual enjoyment of this shader.

This shader is absolutely PERFECT for projects where the rainbow is everything but a background detail, a disturbance or a the main slogan of a project.

Minor warning I must inform you of: setting X thickness too high may upset certain players and MAY cause them to vioneltly attack something or someone. Keep your family and friends close at own RISK.

I AM NOT RESPONSIBLE FOR ANY HARM

 

for more information about legal rights and the involvement of this shader please refer to your country legal code of conduct.

Happy coding!

Shader code
shader_type canvas_item;

uniform float cross_thickness = 0.18;

uniform float wave_strength = 0.03;
uniform float wave_frequency = 8.0;
uniform float wave_speed = 2.0;

void fragment() {
    vec2 uv = UV;

    uv.x += sin(uv.y * wave_frequency + TIME * wave_speed) * wave_strength;

    vec3 col;

    if (uv.y < 1.0/6.0)
        col = vec3(1.0, 0.0, 0.0);
    else if (uv.y < 2.0/6.0)
        col = vec3(1.0, 0.5, 0.0);
    else if (uv.y < 3.0/6.0)
        col = vec3(1.0, 1.0, 0.0);
    else if (uv.y < 4.0/6.0)
        col = vec3(0.0, 0.5, 0.2);
    else if (uv.y < 5.0/6.0)
        col = vec3(0.25, 0.25, 1.0);
    else
        col = vec3(0.7, 0.0, 0.8);

    float d1 = abs(uv.y - uv.x);
    float d2 = abs(uv.y - (1.0 - uv.x));

    if (d1 < cross_thickness || d2 < cross_thickness)
        col = vec3(0.0);

    COLOR = vec4(col, 1.0);
}
Live Preview
Tags
flag
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

7 Comments
Oldest
Newest Most Voted
bob
bob
2 days ago

please I’m begging you, stop this wokeness now. My kids don’t even call me anymore, I just want to hear their voices, I just want to say that I’m sorry

Netanyahu
Netanyahu
1 day ago

This is epic!!!!!! Love from Tel Aviv

ghoma
ghoma
1 day ago

crazy, the carbon monoxide fandom is making shaders now

renderlessgames
renderlessgames
7 hours ago
Reply to  ghoma

They got LBS, loose booty syndrome

Skl
Skl
1 day ago

love it! do a trans pride one next pls 😀

renderlessgames
renderlessgames
7 hours ago

Mental illness awareness month!