Kyon
Member
Hi everyone
17:15 update:
Ok so new question really, how do I remove these lines in my old shader:
Kyon.
I'm working on how to visualize "health" or being dmg in my game
and I thought of this little noise-gradient:
So on the top you're damaged.
But I would like the noise to be animated like static noise.
Right now it's just a large png I made in photoshop, but it costs around 2mb.
Is there a way to do this in code, and is there a way to generate noise on a gradient?
(I looked online but couldn't really find anything about static noise)
and I thought of this little noise-gradient:
So on the top you're damaged.
But I would like the noise to be animated like static noise.
Right now it's just a large png I made in photoshop, but it costs around 2mb.
Is there a way to do this in code, and is there a way to generate noise on a gradient?
(I looked online but couldn't really find anything about static noise)
17:15 update:
Ok so new question really, how do I remove these lines in my old shader:
Heya, thanks for this, very interesting and helpful!
Are you a bit of an expert with shaders?
Because I kind of have a noise shader for a while that I really like, but it gives these "lines":
Do you maybe have a way for my shader to remove those? I really like the look/feel on the shader (next to those annoying lines...)
I believe this is the important code within fshader:
Code:varying vec2 v_vTexcoord; varying vec2 var_texcoord; float random(vec3 _scale, float _seed) { return fract(sin(dot(vec3(var_texcoord, 4.0)+_seed, _scale))*u_noise+_seed); } void main() { vec4 base = texture2D( gm_BaseTexture, var_texcoord ); float noise_strength = u_settings.z; float noise = noise_strength * ( 0.5 - random( vec3( 1.0 ), length(vec2(var_texcoord.x/var_texcoord.y, var_texcoord.x)) ) ); if (u_settings.w == 1.0) {vignette_colour += noise;} /// gl_FragColor = vec4((v_vColour * vec4(base.rgb * vignette_colour, base.a)) + out_col) ;
Yeah I removed a lot of code. I made multiple shaders into one shader. This one does shockwave effect, vignette and noise.
Something I collected(from a few posts and tutorials)/wrote over the years and now always use. But those lines in the noise part are very annoying.
(it's not a part of the vignette or other stuff, I had this when I first started)
I has something to do withBecause that is sort of how it "wraps" around or something.Code:length(vec2(var_texcoord.x/var_texcoord.y, var_texcoord.x))
Here is a picture of the u_noise on a very low number:
So you can see the actual effect. But I'm just not sure why those lines exist. It should just like cover it up with more noise because the u_noise is such a large number?
In the first gif, the noise is moving because I'm randomly generating the variable "u_noise" to somewhere between 30k-50k I believe.
Idk, I just can't wrap my head around shaders even though I tried for a long while.
Kyon.
(if you need more info I'm here)
Kyon.
Last edited: