Shader特效——三种“径向模糊”的实现 【GLSL】

原理参考:

http://blog.csdn.net/yangtrees/article/details/9103935

http://blog.csdn.net/yangtrees/article/details/9114283

 

效果1

Shader特效——三种“径向模糊”的实现 【GLSL】_第1张图片

 

GLSL 代码:

const float PI = 3.14159265;
uniform sampler2D uImageUnit;
uniform float uR;

void main(void)
{
   ivec2 ires = textureSize(uImageUnit, 0);
   
   float Res = float(ires.s);
   
   vec2 st = gl_FragCoord.xy/ires;
   float Radius = Res * uR;
   // pixel coordinates from texture coords
   vec2 xy = Res * st;
   
   // twirl center is (Res/2, Res/2)
   vec2 dxy = xy - vec

你可能感兴趣的:(Shader,ShaderJoy,——,Shader,实例详解)