First commit
This commit is contained in:
35
visuals/shaders/noise.gdshader
Normal file
35
visuals/shaders/noise.gdshader
Normal file
@@ -0,0 +1,35 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D main_texture;
|
||||
uniform float granularity;
|
||||
uniform float opacity_limit;
|
||||
|
||||
float random (vec2 uv) {
|
||||
return fract(sin(dot(uv.xy,
|
||||
vec2(12.9898,78.233))) * 43758.5453123);
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
vec2 uv = UV;
|
||||
uv.y = TIME * uv.y + TIME * 0.5;
|
||||
uv.x = 2.0 * TIME * uv.x + TIME * 1.0;
|
||||
float val = random(uv);
|
||||
float op = random(-uv) / val;
|
||||
float alpha = 1.0;
|
||||
if(op < opacity_limit){
|
||||
alpha = 0.0;
|
||||
}
|
||||
vec4 color = vec4(val, val, val, alpha);
|
||||
COLOR = color;
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the CanvasItem.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
Reference in New Issue
Block a user