Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # conversion of this tutorial: http://fernandourquijo.com/index.php/2017/06/11/analyzing-and-emulating-limbo-style-shader/
- # to godot, with some of my own tweaks, be sure to get accompanying gd script: https://pastebin.com/uhBb2xCs
- shader_type canvas_item;
- render_mode unshaded;
- uniform float randx;
- uniform float randy;
- uniform float grain_scale : hint_range(0.0, 1.0);
- uniform sampler2D noise_tex;
- uniform sampler2D vignette_tex;
- void fragment()
- {
- vec4 col = texture(SCREEN_TEXTURE, SCREEN_UV);
- float lum = col.r * 0.299 + col.g * 0.587 + col.b * 0.114;
- vec2 offset = vec2(randx,randy);
- vec4 noise = texture(noise_tex, mod(SCREEN_UV * grain_scale + offset, 1.0));
- vec4 v_fade = texture(vignette_tex, SCREEN_UV);
- COLOR.rgb = vec3(lum, lum, lum) * noise.rgb * v_fade.rgb;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement