15 lines
545 B
GLSL
15 lines
545 B
GLSL
#version 450 core
|
|
struct PosColNorm { vec4 pos; uint norm; uint col; };
|
|
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
|
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
|
|
layout (std430, binding = 4) readonly buffer Indices { uint indices[]; };
|
|
out vec4 vCol;
|
|
out vec4 vPos;
|
|
out vec4 vNorm;
|
|
void main() {
|
|
vPos = data[indices[gl_VertexID]].pos;
|
|
vCol = unpackUnorm4x8(data[indices[gl_VertexID]].col);
|
|
vNorm = unpackSnorm4x8(data[indices[gl_VertexID]].norm);
|
|
gl_Position = theMat * vec4(vPos.xyz,1);
|
|
}
|