mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-17 17:20:21 +02:00
48 lines
1.7 KiB
Text
48 lines
1.7 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// model_normal_map_fade.vert
|
|
// vertex shader
|
|
//
|
|
// Created by Olivier Prat on 04/24/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 gpu/Inputs.slh@>
|
|
<@include gpu/Color.slh@>
|
|
<@include gpu/Transform.slh@>
|
|
<@include graphics/MaterialTextures.slh@>
|
|
<@include render-utils/ShaderConstants.h@>
|
|
|
|
<$declareStandardTransform()$>
|
|
<$declareMaterialTexMapArrayBuffer()$>
|
|
|
|
|
|
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
|
layout(location=RENDER_UTILS_ATTR_POSITION_WS) out vec4 _positionWS;
|
|
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
|
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
|
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) out vec3 _tangentWS;
|
|
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
|
|
|
void main(void) {
|
|
// pass along the color
|
|
_color.rgb = color_sRGBToLinear(inColor.rgb);
|
|
_color.a = inColor.a;
|
|
|
|
TexMapArray texMapArray = getTexMapArray();
|
|
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord01.xy)$>
|
|
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord01.zw)$>
|
|
|
|
// standard transform
|
|
TransformCamera cam = getTransformCamera();
|
|
TransformObject obj = getTransformObject();
|
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _positionES, gl_Position)$>
|
|
<$transformModelToWorldPos(obj, inPosition, _positionWS)$>
|
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
|
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
|
}
|