mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-23 15:19:51 +02:00
52 lines
1.5 KiB
Text
52 lines
1.5 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// skin_model.vert
|
|
// vertex shader
|
|
//
|
|
// Created by Andrzej Kapolka on 10/14/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 _color;
|
|
out float _alpha;
|
|
|
|
void main(void) {
|
|
vec4 position = vec4(0.0, 0.0, 0.0, 0.0);
|
|
vec3 interpolatedNormal = vec3(0.0, 0.0, 0.0);
|
|
|
|
skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal);
|
|
|
|
// pass along the color
|
|
_color = color_sRGBToLinear(inColor.rgb);
|
|
_alpha = inColor.a;
|
|
|
|
TexMapArray texMapArray = getTexMapArray();
|
|
<$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$>
|
|
<$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$>
|
|
|
|
// standard transform
|
|
TransformCamera cam = getTransformCamera();
|
|
TransformObject obj = getTransformObject();
|
|
<$transformModelToEyeAndClipPos(cam, obj, position, _positionES, gl_Position)$>
|
|
<$transformModelToWorldDir(cam, obj, interpolatedNormal.xyz, _normalWS.xyz)$>
|
|
}
|