1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| shader_type canvas_item;
uniform int samples=6;
uniform float angle=0.2;
void fragment(){
vec2 p=UV-0.5; float r=length(p); float a=atan(p.y,p.x);
vec4 acc=vec4(0.0);
for(int i=0;i<6;i++){
float t=(float(i)/float(max(samples,1))-0.5)*angle;
vec2 uv=0.5+vec2(cos(a+t),sin(a+t))*r;
acc+=texture(TEXTURE,uv);
}
COLOR=acc/float(max(samples,1));
}
|