hurrmmm/godot/control_scheme/radial_ui.gdshader

38 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-11-11 14:56:43 -07:00
// NOTE: Shader automatically converted from Godot Engine 4.1.3.stable.mono's StandardMaterial3D.
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_disabled,unshaded,shadows_disabled,ambient_light_disabled, depth_test_disabled;
uniform float grow;
uniform sampler2D colors : source_color, repeat_disable;
uniform float charge = 1.0;
void vertex() {
// Billboarding
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
VERTEX+=NORMAL*grow;
float speed = pow(2.0, ((charge+.4)*5.0));
float dy = sin(speed*.7) * 0.005;
float dx = sin(speed) * 0.005;
VERTEX.y += dy;
VERTEX.x += dx;
}
2023-11-11 18:48:23 -07:00
uniform sampler2D alpha_falloff : repeat_disable;
2023-11-11 14:56:43 -07:00
void fragment() {
float where = distance(UV, vec2(0.5))*2.0;
if (where >= charge) {
discard;
}
vec2 buv = floor(UV * 350.0);
int bx = int(buv.x);
int by = int(buv.y);
int amount = 2;
2023-11-11 18:48:23 -07:00
ALPHA = texture(alpha_falloff, vec2(where/charge)).r;
2023-11-11 14:56:43 -07:00
ALBEDO = texture(colors, vec2(where)).rgb;
}