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);
	};
}
Live Preview
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

Comments 3

  1. Dylan Author

    change the player_pos value to the middle of the screen

    0
  2. TripleFFF

    Thank you so much!
    Exactly what i needed.

    4