Files
qG3Point/shaders/DrawGrains.vs
T
Paul Leroy bfe48528a2 Work on lighting
Only keep ambient and diffuse ate the current time
2024-04-09 16:50:08 +02:00

38 lines
739 B
GLSL

#version 330
// uniforms
uniform mat4 modelMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 normalMatrix;
uniform mat4 modelViewProjectionMatrix;
uniform int instanceId;
uniform int pointSize;
// in
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 vertexTexCoord;
// out
out vec3 esVertex;
out vec3 esNormal;
//out vec2 texCoord0;
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));
}
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
}