Created
May 17, 2019 17:49
-
-
Save jimmyjonezz/46d5f9bcec0b8c36077653517f70cdfd to your computer and use it in GitHub Desktop.
Shader old film from MIZIZIZIZ. Conversion of this tutorial: http://fernandourquijo.com/index.php/2017/06/11/analyzing-and-emulating-limbo-style-shader/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment