mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
34 lines
942 B
Text
34 lines
942 B
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// paintStroke.frag
|
|
// fragment shader
|
|
//
|
|
// Created by Eric Levin on 8/10/2015
|
|
// 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 DeferredBufferWrite.slh@>
|
|
|
|
// the albedo texture
|
|
layout(binding=0) uniform sampler2D originalTexture;
|
|
|
|
// the interpolated normal
|
|
layout(location=0) in vec3 interpolatedNormal;
|
|
layout(location=1) in vec2 varTexcoord;
|
|
layout(location=2) in vec4 varColor;
|
|
|
|
void main(void) {
|
|
vec4 texel = texture(originalTexture, varTexcoord);
|
|
int frontCondition = 1 -int(gl_FrontFacing) * 2;
|
|
vec3 color = varColor.rgb;
|
|
packDeferredFragmentTranslucent(
|
|
float(frontCondition) * interpolatedNormal,
|
|
texel.a * varColor.a,
|
|
color * texel.rgb,
|
|
10.0);
|
|
}
|