overte-thingvellir/libraries/render-utils/src/drawOpaqueStencil.slf
2015-09-30 09:24:36 -07:00

34 lines
693 B
Text

<@include gpu/Config.slh@>
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// drawOpaqueStencil.frag
// fragment shader
//
// Created by Sam Gateau on 9/29/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
//
<@include gpu/Transform.slh@>
<$declareStandardTransform()$>
in vec2 varTexCoord0;
out vec4 outFragColor;
uniform sampler2D depthTexture;
void main(void) {
float depth = texture(depthTexture, varTexCoord0).r;
if (depth >= 0.9) {
outFragColor = vec4(1.0, 0.0, 0.0, 1.0);
} else {
discard;
}
}