Pong/resources/shaders/SolidColor.vert

22 lines
472 B
GLSL
Raw Permalink Normal View History

2024-07-01 19:55:24 -07:00
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(std140, binding = 0) uniform Transform
{
mat4 viewProj;
mat4 model;
} transform;
layout(location = 0) in vec3 vPos;
layout(location = 1) in vec3 vNorm;
layout(location = 1) out vec3 fNorm;
layout(location = 0) out vec4 fWorldPos;
void main()
{
fNorm = (transform.model * vec4(vNorm, 0.0f)).xyz;
fWorldPos = transform.model * vec4(vPos, 1.0f);
gl_Position = transform.viewProj * fWorldPos;
}