体积光/径向模糊滤波(佛光、记忆幻影)



体积光/径向模糊滤波(佛光、记忆幻影)_第1张图片

  While I was browsing Shadertoy for the new version of MadShaders, I stumbled on this very cool post processing effect. This kind of volumetric light effect (actually a radial blur effect) is perfectly suited to add a nice illuminated touch to the webcam output.

体积光/径向模糊滤波(佛光、记忆幻影)_第2张图片

I quickly coded a small GLSL Hacker demo that exploits this postfx filter with the webcam. The demo is available in themoon3d/gl-210-webcam/ folder of the code sample pack (download the DEV version, same thing for GLSL Hacker). Just load the demo_webcam_lua_win32_postfx_03.xml in GLSL Hacker and you are ready to play with it. This demo is available for Windows only.

Here is the GLSL fragment shader:

uniform sampler2D tex0;
uniform vec3 resolution; // screen resolution
#define T texture2D(tex0,.5+(p.xy*=.992))
void main() 
{
  vec3 p = gl_FragCoord.xyz/resolution-.5;
  vec3 o = T.rbb;
  for (float i=0.;i<100.;i++) 
    p.z += pow(max(0.,.5-length(T.rg)),2.)*exp(-i*.08);
  gl_FragColor=vec4(o*o+p.z,1);
}

体积光/径向模糊滤波(佛光、记忆幻影)_第3张图片

More post processing filters are listed in the Shader Library.

体积光/径向模糊滤波(佛光、记忆幻影)_第4张图片

  While I was browsing Shadertoy for the new version of MadShaders, I stumbled on this very cool post processing effect. This kind of volumetric light effect (actually a radial blur effect) is perfectly suited to add a nice illuminated touch to the webcam output.

体积光/径向模糊滤波(佛光、记忆幻影)_第5张图片

I quickly coded a small GLSL Hacker demo that exploits this postfx filter with the webcam. The demo is available in themoon3d/gl-210-webcam/ folder of the code sample pack (download the DEV version, same thing for GLSL Hacker). Just load the demo_webcam_lua_win32_postfx_03.xml in GLSL Hacker and you are ready to play with it. This demo is available for Windows only.

Here is the GLSL fragment shader:

uniform sampler2D tex0;
uniform vec3 resolution; // screen resolution
#define T texture2D(tex0,.5+(p.xy*=.992))
void main() 
{
  vec3 p = gl_FragCoord.xyz/resolution-.5;
  vec3 o = T.rbb;
  for (float i=0.;i<100.;i++) 
    p.z += pow(max(0.,.5-length(T.rg)),2.)*exp(-i*.08);
  gl_FragColor=vec4(o*o+p.z,1);
}

体积光/径向模糊滤波(佛光、记忆幻影)_第6张图片

More post processing filters are listed in the Shader Library.

你可能感兴趣的:(滤波处理)