pathfinder/demo2/cover.fs.glsl

25 lines
647 B
Plaintext
Raw Normal View History

2018-11-14 16:56:45 -05:00
#version 300 es
// pathfinder/demo2/cover.fs.glsl
//
// Copyright © 2018 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;
2018-11-15 17:37:32 -05:00
uniform sampler2D uStencilTexture;
in vec2 vTexCoord;
2018-11-14 16:56:45 -05:00
out vec4 oFragColor;
void main() {
2018-11-15 17:37:32 -05:00
float coverage = texture(uStencilTexture, vTexCoord).r;
oFragColor = vec4(vec3(1.0 - coverage), coverage);
2018-11-14 16:56:45 -05:00
}