mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
61 lines
2 KiB
Text
61 lines
2 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// skin_model_normal_map.vert
|
|
// vertex shader
|
|
//
|
|
// Created by Andrzej Kapolka on 10/29/13.
|
|
// 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@>
|
|
<$declareStandardTransform()$>
|
|
|
|
<@include Skinning.slh@>
|
|
<$declareUseDualQuaternionSkinning()$>
|
|
|
|
<@include MaterialTextures.slh@>
|
|
<$declareMaterialTexMapArrayBuffer()$>
|
|
|
|
out vec4 _positionES;
|
|
out vec2 _texCoord0;
|
|
out vec2 _texCoord1;
|
|
out vec3 _normalWS;
|
|
out vec3 _tangentWS;
|
|
out vec3 _color;
|
|
out float _alpha;
|
|
|
|
void main(void) {
|
|
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
|
vec4 interpolatedNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
|
vec4 interpolatedTangent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
skinPositionNormalTangent(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, inTangent.xyz, position, interpolatedNormal.xyz, interpolatedTangent.xyz);
|
|
|
|
// pass along the color
|
|
_color = color_sRGBToLinear(inColor.rgb);
|
|
_alpha = inColor.a;
|
|
|
|
TexMapArray texMapArray = getTexMapArray();
|
|
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$>
|
|
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$>
|
|
|
|
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
|
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
|
|
|
|
// standard transform
|
|
TransformCamera cam = getTransformCamera();
|
|
TransformObject obj = getTransformObject();
|
|
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
|
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
|
|
<$transformModelToWorldDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
|
|
|
|
_normalWS = interpolatedNormal.xyz;
|
|
_tangentWS = interpolatedTangent.xyz;
|
|
}
|