mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 01:18:26 +02:00
45 lines
1.6 KiB
Text
45 lines
1.6 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// <$_SCRIBE_FILENAME$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// Created by Hifi Engine Team.
|
|
// Copyright 2013 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_WS) out vec4 _positionWS;
|
|
layout(location=RENDER_UTILS_ATTR_POSITION_ES) out vec4 _positionES;
|
|
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;
|
|
|
|
// standard transform
|
|
TransformCamera cam = getTransformCamera();
|
|
TransformObject obj = getTransformObject();
|
|
<$transformModelToWorldAndEyeAndClipPos(cam, obj, inPosition, _positionWS, _positionES, gl_Position)$>
|
|
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normalWS)$>
|
|
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangentWS)$>
|
|
|
|
TexMapArray texMapArray = getTexMapArray();
|
|
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _positionWS, _texCoord01.xy)$>
|
|
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _positionWS, _texCoord01.zw)$>
|
|
}
|