mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-13 04:04:51 +02:00
52 lines
1.3 KiB
Text
52 lines
1.3 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// model_unlit_fade.frag
|
|
// fragment shader
|
|
//
|
|
// Created by Olivier Prat on 06/05/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
|
|
//
|
|
|
|
<@include DeferredBufferWrite.slh@>
|
|
<@include LightingModel.slh@>
|
|
<@include model/Material.slh@>
|
|
|
|
<@include Fade.slh@>
|
|
<$declareFadeFragment()$>
|
|
|
|
<@include MaterialTextures.slh@>
|
|
<$declareMaterialTextures(ALBEDO)$>
|
|
|
|
in vec2 _texCoord0;
|
|
in vec3 _normal;
|
|
in vec3 _color;
|
|
in float _alpha;
|
|
in vec4 _worldFadePosition;
|
|
|
|
void main(void) {
|
|
vec3 fadeEmissive;
|
|
|
|
applyFade(_worldFadePosition.xyz, fadeEmissive);
|
|
|
|
Material mat = getMaterial();
|
|
int matKey = getMaterialKey(mat);
|
|
<$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex)$>
|
|
|
|
float opacity = 1.0;
|
|
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
|
<$discardTransparent(opacity)$>;
|
|
|
|
vec3 albedo = getMaterialAlbedo(mat);
|
|
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
|
albedo *= _color;
|
|
albedo += fadeEmissive;
|
|
packDeferredFragmentUnlit(
|
|
normalize(_normal),
|
|
opacity,
|
|
albedo * isUnlitEnabled());
|
|
}
|