Skip to main content

· 2 min read

Every person interested in rendering through fragment shaders has already come across a function like this to generate some white noise:

float random(vec2 uv) {
return fract(sin(dot(uv ,vec2(12.9898,78.233))) * 43758.5453);
}

And I used it too, until someone pointed out a big problem to me: on her device my artworks were all messed up! And it turned out that many people were actually encountering the same problem. (You can see the artifacts in the comparison at the end)