spooky-game/assets/shaders/model-default-depth-vertex....

22 lines
608 B
GLSL

#version 450
layout (location = 0) in vec3 vertexPosition;
layout (location = 1) in vec2 vertexTexCoords;
layout (location = 2) in vec3 vertexNormal;
layout (location = 0) out vec3 vertexViewSpacePosition;
layout (location = 1) out vec2 vertexTexCoordsOut;
uniform mat4 modelViewMatrix;
uniform mat4 modelViewProjectionMatrix;
void main() {
// Handle position
vertexViewSpacePosition = vec3((modelViewMatrix * vec4(vertexPosition, 1.0)).xyz);
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
// Handle texCoords
vertexTexCoordsOut = vertexTexCoords;
}