hurrmmm/godot/control_scheme/radial_ui.gdshader

40 lines
1.1 KiB
Plaintext
Raw 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;
#include "res://shaders/noise.gdshaderinc"
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;
}
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;
if ((bx % amount == 0) || (by % amount == 0)) {
discard;
}
ALBEDO = texture(colors, vec2(where)).rgb;
}