31 lines
729 B
Plaintext
31 lines
729 B
Plaintext
attribute vec3 vPosition;
|
|
attribute vec2 vTexCoord;
|
|
attribute vec3 vNormal;
|
|
attribute vec3 vTangent;
|
|
attribute vec3 vBinormal;
|
|
|
|
uniform mat4 ProjectionMatrix;
|
|
uniform mat3 ModelRotateMatrix;
|
|
uniform vec3 ModelTranslateVector;
|
|
|
|
varying vec2 texCoord;
|
|
varying vec3 vertexPos;
|
|
varying vec3 absoluteVertexPos;
|
|
varying vec3 normal;
|
|
varying vec3 tangent;
|
|
varying vec3 bitangent;
|
|
void main()
|
|
{
|
|
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
|
|
gl_Position = ProjectionMatrix * realVertexPos;
|
|
vertexPos = gl_Position.xyz;
|
|
|
|
absoluteVertexPos = vPosition;
|
|
|
|
texCoord = vTexCoord.st;
|
|
|
|
normal = normalize(vNormal);
|
|
tangent = normalize(vTangent);
|
|
bitangent = cross(normal, tangent);
|
|
|
|
} |