Files
qG3Point/shaders/DrawGrains.vs
T

38 lines
739 B
GLSL
Raw Normal View History

2024-03-19 21:56:01 +01:00
#version 330
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;
uniform mat4 modelViewProjectionMatrix;
2024-03-19 21:56:01 +01:00
uniform int instanceId;
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;
//out vec2 texCoord0;
2024-03-19 21:56:01 +01:00
void main()
{
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);
}