3d projection

This commit is contained in:
2025-11-09 14:00:55 +01:00
parent 0eebe09d47
commit 10b0b54e71
2 changed files with 15 additions and 4 deletions

View File

@@ -5,11 +5,14 @@ layout(std430, binding = 3) buffer layoutName
float data_SSBO[];
};
layout(location = 0) uniform mat4 viewMatrix;
layout(location = 1) uniform mat4 projectionMatrix;
vec3 unpack(uint index) {
return vec3(data_SSBO[index * 3], data_SSBO[index * 3 + 1], data_SSBO[index * 3 + 2]);
}
void main()
{
gl_Position = vec4(unpack(gl_InstanceID), 1.0);
gl_Position = projectionMatrix * viewMatrix * vec4(unpack(gl_InstanceID), 1.0);
}