mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:16:00 +02:00
45 lines
1.3 KiB
Text
Executable file
45 lines
1.3 KiB
Text
Executable file
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// model_lightmap_normal_map.vert
|
|
// vertex shader
|
|
//
|
|
// Created by Sam Gateau on 11/21/14.
|
|
// 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()$>
|
|
|
|
const int MAX_TEXCOORDS = 2;
|
|
|
|
uniform mat4 texcoordMatrices[MAX_TEXCOORDS];
|
|
|
|
out vec4 _position;
|
|
out vec2 _texCoord0;
|
|
out vec2 _texCoord1;
|
|
out vec3 _normal;
|
|
out vec3 _tangent;
|
|
out vec3 _color;
|
|
|
|
void main(void) {
|
|
// pass along the diffuse color in linear space
|
|
_color = colorToLinearRGB(inColor.xyz);
|
|
|
|
// and the texture coordinates
|
|
_texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st;
|
|
_texCoord1 = (texcoordMatrices[1] * vec4(inTexCoord1.st, 0.0, 1.0)).st;
|
|
|
|
// standard transform
|
|
TransformCamera cam = getTransformCamera();
|
|
TransformObject obj = getTransformObject();
|
|
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
|
<$transformModelToEyeDir(cam, obj, inNormal.xyz, _normal)$>
|
|
<$transformModelToEyeDir(cam, obj, inTangent.xyz, _tangent)$>
|
|
}
|