github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/gpu/shaders/intersect.frag (about)

     1  #version 310 es
     2  
     3  // SPDX-License-Identifier: Unlicense OR MIT
     4  
     5  precision mediump float;
     6  
     7  // Use high precision to be pixel accurate for
     8  // large cover atlases.
     9  layout(location = 0) in highp vec2 vUV;
    10  
    11  layout(binding = 0) uniform sampler2D cover;
    12  
    13  layout(location = 0) out vec4 fragColor;
    14  
    15  void main() {
    16    float cover = abs(texture(cover, vUV).r);
    17    fragColor.r = cover;
    18  }