Project

General

Profile

« Previous | Next » 

Revision fd2db957

Added by Leszek Koltunski about 7 years ago

1) bugfix computing Gaussian BLUR kernel (for odd radii, the last offset was incorrectly computed)
2) introduce more advanced method of detecting BLUR halo (compute depths in a new way)

View differences:

src/main/res/raw/blur2_fragment_shader.glsl
40 40

  
41 41
void main()
42 42
  {
43
  gl_FragDepth = TEXTURE(u_DepthTexture,v_TexCoordinate).r;
43
  float depth = TEXTURE(u_DepthTexture,v_TexCoordinate).r;
44

  
45
  if( u_Radius>1 )
46
    {
47
    float offset = u_Offsets[u_Radius];
48

  
49
    depth = min(depth, TEXTURE(u_DepthTexture,vec2(v_TexCoordinate.x,v_TexCoordinate.y+offset)).r);
50
    depth = min(depth, TEXTURE(u_DepthTexture,vec2(v_TexCoordinate.x,v_TexCoordinate.y-offset)).r);
51
    depth = min(depth, TEXTURE(u_DepthTexture,vec2(v_TexCoordinate.x+offset,v_TexCoordinate.y)).r);
52
    depth = min(depth, TEXTURE(u_DepthTexture,vec2(v_TexCoordinate.x-offset,v_TexCoordinate.y)).r);
53
    }
54

  
55
  gl_FragDepth = depth;
44 56

  
45 57
  vec4 pixel= TEXTURE(u_ColorTexture,v_TexCoordinate) * u_Weights[0];
46 58

  

Also available in: Unified diff