NightVision.glsl 427 B

12345678910111213141516
  1. uniform sampler2D colorTexture;
  2. varying vec2 v_textureCoordinates;
  3. float rand(vec2 co)
  4. {
  5. return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
  6. }
  7. void main(void)
  8. {
  9. float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
  10. vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;
  11. vec3 green = vec3(0.0, 1.0, 0.0);
  12. gl_FragColor = vec4((noiseValue + rgb) * green, 1.0);
  13. }