0

How to implement generation of grain noise like that one in Adobe Illustrator? (example here: https://graphicdesign.stackexchange.com/questions/19601/how-to-create-a-grain-noise-effect-in-adobe-illustrator)

Simplex or Perlin noise is too smooth for my purposes. I also want to adjust grain size.

I already visited this question: Random / noise functions for GLSL.

This function:

float rand(vec2 co){
    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

Is close enough, but it generates the same noise each time. I don't know how to provide a random seed without disturbing noise picture.

Community
  • 1
  • 1
kelin
  • 11,323
  • 6
  • 67
  • 104
  • You can add parameter: time to shader and change this parameter for each render. As the result you will have different noise for different frames. – Unick Apr 29 '16 at 11:34
  • @Unick, yes, that's what I want to do. But I don't know where to add this param. If I do like this: `fract(sin(t + dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);` the resulting noise become look like periodic structure. – kelin Apr 29 '16 at 12:29

0 Answers0