Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cutoutFragmentClear: `#define GLSLIFY 1
- varying vec2 vMaskCoord;
- varying vec2 vTextureCoord;
- uniform vec2 scale_diff;
- uniform sampler2D uSampler;
- uniform sampler2D mask;
- uniform float alpha;
- uniform float r;
- uniform float g;
- uniform float b;
- // Coords
- uniform float w;
- uniform float h;
- uniform float x;
- uniform vec4 maskClamp;
- uniform float y;
- uniform bool invert;
- varying vec4 temp;
- void main(void) {
- vec2 maskyCord = (vTextureCoord - (vec2(1.0/w,1.0/h))-vec2(x/w,y/h));
- maskyCord.x = clamp(maskyCord.x, 0., 1.0);
- maskyCord.y = clamp(maskyCord.y, 0., 1.0);
- vec4 color = texture2D(uSampler, vTextureCoord);
- vec4 masky = texture2D(mask, maskyCord);
- vec4 colorCoord = texture2D(uSampler, vTextureCoord);
- if(colorCoord.a == 0.0) {
- gl_FragColor = colorCoord;
- } else {
- if(invert) {
- if (masky.a != 1.0 && maskyCord.x < 1.0 && maskyCord.y < 1.0) {
- color = vec4(color.rgb, 1.0) * masky.a;
- }
- } else {
- if (masky.a != 0.0 && maskyCord.x < 1.0 && maskyCord.y < 1.0) {
- color = vec4(color.rgb, 1.0) * (1. - masky.a);
- }
- }
- gl_FragColor = color;
- }
- }`,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement