Skip to content

Commit

Permalink
modified mask.frag, now it should work with grayscale luminance and t…
Browse files Browse the repository at this point in the history
…ake alpha into account as well, maybe...
  • Loading branch information
hvfrancesco committed Jan 10, 2012
1 parent 18a3857 commit a94ea4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/data/shaders/mask.frag
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ void main(){
vec4 nullo = vec4(0.0,0.0,0.0,0.0);
//if(mode == 0) factor = maskcol.w;
//if(mode == 1) factor = 1.0 - maskcol.w;
if(mode == 0) factor = (maskcol.x*maskcol.y*maskcol.z*maskcol.w);
if(mode == 1) factor = 1.0 - (maskcol.x*maskcol.y*maskcol.z*maskcol.w);
//if(mode == 0) factor = (maskcol.x*maskcol.y*maskcol.z*maskcol.w);
//if(mode == 1) factor = 1.0 - (maskcol.x*maskcol.y*maskcol.z*maskcol.w);
if(mode == 0) factor = ((maskcol.x+maskcol.y+maskcol.z)/3.0*maskcol.w);
if(mode == 1) factor = 1.0 - ((maskcol.x+maskcol.y+maskcol.z)/3.0*maskcol.w);

// set final color
//gl_FragData[0] = vec4(col.xyzw);
Expand Down

0 comments on commit a94ea4d

Please sign in to comment.