20 lines
546 B
Plaintext
20 lines
546 B
Plaintext
|
#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);
|
||
|
}
|