mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-13 09:12:39 +02:00
34 lines
791 B
Text
34 lines
791 B
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
// fragment shader
|
|
//
|
|
// Created by Bradley Austin Davis on 6/10/15.
|
|
// Copyright 2015 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
|
|
//
|
|
|
|
in vec4 varColor;
|
|
in float varSize;
|
|
|
|
out vec4 outFragColor;
|
|
|
|
const float EDGE_SIZE = 0.25;
|
|
const float ALPHA_BOUNDARY = 1.0 - EDGE_SIZE;
|
|
|
|
void main(void) {
|
|
vec2 coord = gl_PointCoord * vec2(2.0) - vec2(1.0);
|
|
coord = coord * coord;
|
|
|
|
float l = coord.x + coord.y;
|
|
if (l > 1.0) {
|
|
discard;
|
|
}
|
|
|
|
outFragColor = varColor;
|
|
if (l >= ALPHA_BOUNDARY) {
|
|
outFragColor.a = smoothstep(1.0, ALPHA_BOUNDARY, l);
|
|
}
|
|
}
|