Transparent walls

See the player through walls in teh foreground

Shader code
shader_type canvas_item;

uniform vec2 player_pos = vec2(576,324);
uniform float max_distance = 75.0;
uniform float num = 0;
void fragment() {
	if (COLOR.a!=0.0){
		vec2 place = FRAGCOORD.xy;
		float distance_to_player = distance(FRAGCOORD.xy, vec2(576,324));
		COLOR.a = clamp(((distance_to_player-max_distance)/max_distance*5.0),0.3,1);
	};
}
Tags
2d
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

page flip with transparent background

Transparent noise border

Transparent Lightning

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
TripleFFF
TripleFFF
13 hours ago

Thank you so much!
Exactly what i needed.