Advertisement
gothick

Old-school snow

Sep 28th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void main() {
  2.     highp float grayComponent = rand(vec2(positionInput.x + u_Random, positionInput.y + u_Random));
  3.     // Daniel's code randomises every pixel. I found that randomising only those that came
  4.     // out higher than 0.9 made for a more old-school "television, tuned to a dead channel",
  5.     // which I also found more hypnotic.
  6.     if (grayComponent > 0.9) {    
  7.         gl_FragColor = vec4(grayComponent, grayComponent, grayComponent, 1.0);
  8.     } else {
  9.         gl_FragColor = vec4(0, 0, 0, 1.0);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement