klionmatter.blogg.se

Moving rain overlay
Moving rain overlay









moving rain overlay

I managed to improve with this: vec2 uv= UV īut what he wanted was to be able to pass three uniforms, direction, velocity and intensity, and to be able to control the direction (right equer), the speed with which they fall, the intensity (higher or lower particles, more or less drops). I realize that here is the problem: vec2 uv=(COLOR.xy*2.0-SCREEN_UV.xy)/min(SCREEN_UV.x,SCREEN_UV.y) But my screen seems to be divided in two, cut by a diagonal line, I do not understand much because. I have discovered that by decreasing the value I am passing to the scale, it increases the "particles", I mean how octaves in a noise, the smaller the number last, the greater the peaos generated. What really is done that line? I can not understand what he does.įloat snow(vec2 uv, float scale, float time)įloat w = smoothstep(1.0,0.0,-uv.y*(scale/10.0))

Moving rain overlay code#

I managed to translate the code for godot 3, but it does not work very well, I believe this line is to blame: p=0.5+0.35*sin(11.0*fract(sin((s+p+scale)*mat2(vec2(7,3),vec2(6,5)))*5.0))-f I found this code, I really wanted to understand what is done in it: I thought of doing the following, moving the texture with just a few painted pixels. But I'm just finding very complex examples for me, I understand little about shaders, I wanted to achieve something very basic even to be able to walk. I'm trying to implement a rain effect using shader, I use godot 3-alpha, which uses a simplified GLSL 3.0 language.











Moving rain overlay