Double texture blend 2D

Allow add one texture to another and control it’s color. You can change TEXTURE(base texture of node) to any another.

Shader code
shader_type canvas_item;

uniform sampler2D img_texture: filter_nearest, repeat_enable;
uniform vec4 img_color: source_color;


void fragment(){
	vec4 base_pixel = texture(TEXTURE, UV);
	vec4 texture_pixel = texture(img_texture, UV);
	
	texture_pixel.rgb = vec3(img_color.rgb);
	
	COLOR.rgb = mix(base_pixel.rgb, texture_pixel.rgb, texture_pixel.a * img_color.a);
}
Tags
2d, blend, Mix, sprites, textures
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

Double Vision w/ chromatic aberration

Texture Blend

Blend damage revealed with noise texture mask

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments