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



GLSL Hacker, volumetric light post processing filter, GeForce GTX 780

  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.

GLSL Hacker, volumetric light post processing filter

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);
}

GLSL Hacker, volumetric light post processing filter

More post processing filters are listed in the Shader Library.

GLSL Hacker, volumetric light post processing filter, GeForce GTX 780

  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.

GLSL Hacker, volumetric light post processing filter

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);
}

GLSL Hacker, volumetric light post processing filter

More post processing filters are listed in the Shader Library.

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值