source: trunk/tools/neercs/video/noise.lolfx @ 2815

Last change on this file since 2815 was 2815, checked in by lolbot, 9 years ago

fixed 542 files out of 2754:

  • removed 0 CR characters
  • removed 0 trailing whitespaces
  • replaced 0 tabs with spaces
  • fixed 542 svn:eol-style properties
  • Property svn:eol-style set to CR
File size: 802 bytes
Line 
1[vert.glsl] #version 120 void main() {     gl_Position = gl_Vertex; } [frag.glsl] #version 120 uniform sampler2D texture; uniform vec2 screen_size; uniform float time; uniform vec2 offset; uniform float noise; uniform vec3 retrace; float rand(in vec2 p, in float t, in float v) {     return fract(sin(dot(p + mod(t, 1.0), vec2(12.9898, 78.2333))) * v); } void main(void) {     vec2 p=gl_FragCoord.xy/screen_size.xy;     float r1=rand(p,time,43758.5453);     float r2=rand(p,time,70425.2854);     vec2 o=(offset-offset*2.0*r1)/screen_size;     vec3 c=texture2D(texture,p+o).xyz;                          // offset     c*=1.0+(noise-noise*2.0*r1);                                // noise     c-=retrace.x*0.01*mod(p.y*retrace.y+time*retrace.z,1.0);    // retrace     gl_FragColor=vec4(c,1.0); }
Note: See TracBrowser for help on using the repository browser.