pathfinder/shaders/mask_evenodd.fs.glsl

26 lines
686 B
Plaintext
Raw Normal View History

#version 330
2020-02-17 17:44:48 -05:00
// pathfinder/shaders/mask_evenodd.fs.glsl
//
// Copyright © 2020 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
precision highp float;
2020-02-17 17:44:48 -05:00
uniform sampler2D uFillTexture;
2020-02-17 17:44:48 -05:00
in vec2 vFillTexCoord;
in float vBackdrop;
2020-02-17 17:44:48 -05:00
out vec4 oFragColor;
2020-02-15 21:00:25 -05:00
2020-02-17 17:44:48 -05:00
void main() {
float alpha = texture(uFillTexture, vFillTexCoord).r + vBackdrop;
oFragColor = vec4(1.0 - abs(1.0 - mod(alpha, 2.0)));
}