box3d/shaders/mesh.fs
2026-05-10 13:36:52 -07:00

20 lines
No EOL
448 B
GLSL

#version 330 core
layout (location = 0) out vec3 gPosition;
layout (location = 1) out vec3 gNormal;
layout (location = 2) out vec4 gAlbedoSpec;
in vec3 fragmentPosition;
in vec3 normal;
in vec4 color;
void main()
{
// store the fragment position vector in the first gbuffer texture
gPosition = fragmentPosition;
// also store the per-fragment normals into the gbuffer
gNormal = normalize(normal);
gAlbedoSpec = color;
}