mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-22 15:23:46 +00:00
Added shaders
This commit is contained in:
parent
45f3e9514d
commit
7414ff51c8
106 changed files with 2642 additions and 0 deletions
32
Shaders/GodotRetro/Screen Shaders/SimpleGrain.gdshader
Normal file
32
Shaders/GodotRetro/Screen Shaders/SimpleGrain.gdshader
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//SHADER ORIGINALY CREADED BY "juniorxsound" FROM SHADERTOY
|
||||
//MODIFIED AND PORTED TO GODOT BY AHOPNESS (@ahopness)
|
||||
//LICENSE : CC0
|
||||
//COMATIBLE WITH : GLES2, GLES3, WEBGL
|
||||
//SHADERTOY LINK : https://www.shadertoy.com/view/ldScWw
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
|
||||
|
||||
uniform float amount :hint_range(0.0, 0.4) = 0.1;
|
||||
|
||||
float grain (vec2 st, float time){
|
||||
return fract(sin(dot(st.xy, vec2(17.0,180.)))* 2500. + time);
|
||||
}
|
||||
|
||||
void fragment(){
|
||||
//Coords
|
||||
vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy;
|
||||
|
||||
//Produce some noise based on the coords
|
||||
vec3 grainPlate = vec3(grain(uv, TIME));
|
||||
|
||||
//Get the image
|
||||
vec4 img = texture(SCREEN_TEXTURE, uv);
|
||||
|
||||
//Mix the two signals together
|
||||
vec3 mixer = mix(img.rgb, grainPlate, amount);
|
||||
|
||||
|
||||
COLOR = vec4(mixer,1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue