glsl Dream

时间:2024-04-22 00:04:35

glsl  Dream

glsl  Dream

<-vertex->

  #version 

  varying vec2 uv;

  void main(void)
{ uv = gl_MultiTexCoord0.st;
gl_Position = ftransform();
} <-fragment-> uniform sampler2D sceneTex; //
varying vec2 uv; void main ()
{ vec4 c = texture2D(sceneTex, uv); c += texture2D(sceneTex, uv+0.001);
c += texture2D(sceneTex, uv+0.003);
c += texture2D(sceneTex, uv+0.005);
c += texture2D(sceneTex, uv+0.007);
c += texture2D(sceneTex, uv+0.009);
c += texture2D(sceneTex, uv+0.011); c += texture2D(sceneTex, uv-0.001);
c += texture2D(sceneTex, uv-0.003);
c += texture2D(sceneTex, uv-0.005);
c += texture2D(sceneTex, uv-0.007);
c += texture2D(sceneTex, uv-0.009);
c += texture2D(sceneTex, uv-0.011); c.rgb = vec3((c.r+c.g+c.b)/3.0);
c = c / 9.5;
gl_FragColor = c;
}