spooky-game/assets/shaders/point-light-vertex.glsl

20 lines
546 B
Plaintext
Raw Normal View History

2020-08-13 20:14:37 +02:00
#version 450
layout (location = 0) in vec3 vertexPosition;
layout (location = 0) out vec3 vertexViewSpacePosition;
layout (location = 1) out vec2 vertexTexCoords;
void main() {
// Handle texCoords
if (vertexPosition.x < 0) vertexTexCoords.x = 0;
if (vertexPosition.y < 0) vertexTexCoords.y = 0;
if (vertexPosition.x > 0) vertexTexCoords.x = 1;
if (vertexPosition.y > 0) vertexTexCoords.y = 1;
// Handle position
vertexViewSpacePosition = vertexPosition;
gl_Position = vec4(vertexPosition, 1.0);
}