Corruption

Based on the Dissolve shader, this shader changes the sprite to have a purple tint.

It needs a Noise texture for the effect, akin to the Dissolve shader

Shader code
shader_type canvas_item;

uniform sampler2D dissolve_texture : hint_albedo;

void fragment(){
    vec4 main_texture = texture(TEXTURE, UV);
    float dissolve_value = mix(0.5, 0.6, sin(TIME));
    vec4 noise_texture = texture(dissolve_texture, UV+vec2(10.0*sin(TIME/5.0),10.0*cos(TIME/5.0))/5.0);
    float mult = floor(dissolve_value + min(1, noise_texture.x));
    main_texture.g *= mult;
    main_texture.r -= mult - 0.1;
    main_texture.g -= mult - 0.1;
    main_texture.b -= mult - 0.1;
    COLOR = main_texture;
}
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.
guest

0 Comments
Inline Feedbacks
View all comments