Skip to content

Commit

Permalink
Fix pixelize filter's issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Aug 8, 2016
1 parent f420ae1 commit 364126d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Realtime camera filters. Process frames by OpenGL shaders.

**[Download the apk](https://github.com/WeLikeVis/CameraFilter/releases/download/1.2/app-debug.apk)** to have a try.
**[Download the apk](https://github.com/WeLikeVis/CameraFilter/releases/download/1.2.1/app-debug.apk)** to have a try.

## Filters

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/raw/pixelize.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ uniform vec3 iResolution;
uniform samplerExternalOES sTexture;
varying vec2 texCoord;

void mainImage(out vec4 f,vec2 u)
#define S (iResolution.x / 6e1) // The cell size.

void mainImage(out vec4 c, vec2 p)
{
vec2 r = iResolution.xy;
f = texture2D(sTexture,ceil(u / (r.x/1e2)) * r.x/1e2 / r);
c = texture2D(sTexture, floor((p + .5) / S) * S / iResolution.xy);
}

void main() {
Expand Down

0 comments on commit 364126d

Please sign in to comment.