Skip to content

Commit

Permalink
Merge pull request #148 from ninjadev/splooshing-fixes
Browse files Browse the repository at this point in the history
Repair lowres texture
  • Loading branch information
stianjensen committed Jul 11, 2015
2 parents 35fe086 + 5784ec5 commit 706d3fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Binary file modified res/sploosh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions src/shaders/reveal/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ varying vec2 vUv;
void main() {
vec4 color = texture2D(texture, vUv);

gl_FragColor = color;
if(gl_FragColor.a > alphaBound){
gl_FragColor.a = alphaBound;
vec4 outp = color;
if(outp.a > alphaBound){
outp.a = alphaBound;
}

if(vUv.x > reveal && vUv.x < reveal + 0.05){
gl_FragColor.a *= 1. - ((vUv.x - reveal)/0.05);
}else if(vUv.x >= reveal + 0.05){
gl_FragColor.a = 0.;
outp.a *= 1. - ((vUv.x - reveal)/0.05);
}
else if(vUv.x >= reveal + 0.05){
outp.a -= 0.5;
}

if(reveal == 0.){
gl_FragColor.a = 0.;
outp.a = 0.;
}

gl_FragColor = outp;
}

0 comments on commit 706d3fb

Please sign in to comment.