2024-03-19 21:56:01 +01:00
|
|
|
#version 330
|
2024-03-19 11:21:37 +01:00
|
|
|
|
2024-03-19 21:56:01 +01:00
|
|
|
// uniforms
|
2024-04-09 16:50:08 +02:00
|
|
|
uniform mat4 modelMatrix;
|
2024-03-19 21:56:01 +01:00
|
|
|
uniform mat4 modelViewMatrix;
|
|
|
|
|
uniform mat4 normalMatrix;
|
2024-03-19 11:21:37 +01:00
|
|
|
uniform mat4 modelViewProjectionMatrix;
|
2024-03-19 21:56:01 +01:00
|
|
|
uniform int instanceId;
|
2024-03-27 17:27:50 +01:00
|
|
|
uniform int pointSize;
|
2024-03-19 21:56:01 +01:00
|
|
|
|
|
|
|
|
// in
|
|
|
|
|
in vec3 vertexPosition;
|
|
|
|
|
in vec3 vertexNormal;
|
|
|
|
|
in vec2 vertexTexCoord;
|
|
|
|
|
|
|
|
|
|
// out
|
|
|
|
|
out vec3 esVertex;
|
|
|
|
|
out vec3 esNormal;
|
2024-03-27 17:27:50 +01:00
|
|
|
//out vec2 texCoord0;
|
2024-03-19 11:21:37 +01:00
|
|
|
|
2024-03-19 21:56:01 +01:00
|
|
|
void main()
|
2024-03-19 11:21:37 +01:00
|
|
|
{
|
2024-03-27 17:27:50 +01:00
|
|
|
if (pointSize !=0)
|
|
|
|
|
{
|
|
|
|
|
gl_PointSize = pointSize;
|
|
|
|
|
esVertex = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
|
|
|
|
|
esNormal = vec3(normalMatrix * vec4(0, 0, 1, 1.0));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
esVertex = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
|
|
|
|
|
esNormal = vec3(normalMatrix * vec4(vertexNormal, 1.0));
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-19 21:56:01 +01:00
|
|
|
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
|
2024-03-27 17:27:50 +01:00
|
|
|
|
2024-03-19 11:21:37 +01:00
|
|
|
}
|