2024-06-09 18:42:23 +00:00
|
|
|
attribute vec3 vPosition;
|
|
|
|
attribute vec2 vTexCoord;
|
|
|
|
attribute vec3 vNormal;
|
2024-06-10 19:17:41 +00:00
|
|
|
attribute vec3 vTangent;
|
|
|
|
attribute vec3 vBinormal;
|
2024-06-09 18:42:23 +00:00
|
|
|
|
|
|
|
uniform mat4 ProjectionMatrix;
|
|
|
|
uniform mat3 ModelRotateMatrix;
|
|
|
|
uniform vec3 ModelTranslateVector;
|
|
|
|
|
|
|
|
varying vec2 texCoord;
|
|
|
|
varying vec3 vertexPos;
|
|
|
|
varying vec3 absoluteVertexPos;
|
|
|
|
varying vec3 normal;
|
2024-06-10 19:17:41 +00:00
|
|
|
varying vec3 tangent;
|
|
|
|
varying vec3 bitangent;
|
2024-06-09 18:42:23 +00:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
|
|
|
|
gl_Position = ProjectionMatrix * realVertexPos;
|
|
|
|
vertexPos = gl_Position.xyz;
|
|
|
|
|
|
|
|
absoluteVertexPos = vPosition;
|
|
|
|
|
|
|
|
texCoord = vTexCoord.st;
|
|
|
|
|
2024-06-10 19:17:41 +00:00
|
|
|
normal = normalize(vNormal);
|
|
|
|
tangent = normalize(vTangent);
|
|
|
|
bitangent = cross(normal, tangent);
|
2024-06-09 18:42:23 +00:00
|
|
|
|
|
|
|
}
|