Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type spatial;
- uniform sampler2D noise;
- uniform vec4 color : hint_color;
- uniform vec2 center = vec2(.5, .5);
- uniform float radial_scale = 1.0;
- uniform float length_scale = 1.0;
- uniform float divide_factor = 1.0;
- void vertex() {
- vec2 delta = UV - center;
- float radius = length(delta) * 2.0 * radial_scale - .15;
- float angle = atan(delta.x, delta.y) * 1.0 / 6.28 * length_scale;
- float depth = radius / divide_factor;
- depth = clamp(1.0 - depth, 0.0, 1.0);
- depth = pow(depth, 2.0) * 1.0;
- VERTEX.y -= depth;
- NORMAL.y -= depth;
- COLOR.x = radius;
- COLOR.y = angle;
- COLOR.z = depth;
- }
- void fragment() {
- vec2 delta = UV - center;
- float angle = atan(delta.x, delta.y) * 1.0 / 6.28 * length_scale;
- float scaling_distance = COLOR.x * 1.5;
- vec2 uvs = vec2(scaling_distance + TIME * .12, scaling_distance + angle);
- float whirpool = step(texture(noise, uvs).x, .5);
- if(COLOR.z < .01 || whirpool > .5) {
- ALBEDO = color.rgb * (1.0 - COLOR.z * 1.4);
- if(COLOR.z >= .01) {
- ALBEDO.r += .03;
- }
- } else {
- ALBEDO.rgb = color.rgb * .35;
- }
- ROUGHNESS = 1.0;
- }
Advertisement
Add Comment
Please, Sign In to add comment