overte-HifiExperiments/libraries/render-utils/src/stencil_drawMask.slf
2018-10-29 16:42:46 -07:00

26 lines
642 B
Text

<@include gpu/Config.slh@>
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// stencil_drawMask.frag
// fragment shader
//
// Created by Sam Gateau on 5/31/17.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
layout(location=0) in vec2 varTexCoord0;
float aspectRatio = 0.95;
void main(void) {
vec2 pos = varTexCoord0 * 2.0 - vec2(1.0);
pos.x = aspectRatio * (pos.x * mix(-2.0, 2.0, float(pos.x > 0.0)) - 1.0);
if (1.0 - dot(pos.xy, pos.xy) > 0.0) {
discard;
}
}