Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
prism/engine/shaders/billboard.vert.glsl
Joshua Goins ea93df18dd Remove all push constant binding declarations
This was a leftover from sharing GLSL with Metal and OpenGL, this is now a warning with modern SPIR-V compilers anyway.
2022-02-07 10:11:19 -05:00

25 lines
593 B
GLSL

layout (location = 0) out vec2 outUV;
layout(push_constant) uniform readonly PushConstant{
mat4 mvp;
vec4 color;
};
layout(std430, binding = 3) buffer readonly SceneInformation {
mat4 view;
};
void main() {
vec2 p = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
outUV = vec2(p.x, 1.0 - p.y);
p = p * 2.0f + -1.0f;
const vec3 right = {view[0][0], view[1][0], view[2][0]};
const vec3 up = {view[0][1], view[1][1], view[2][1]};
vec3 position = right * p.x * 0.25 + up * p.y * 0.25;
gl_Position = mvp * vec4(position, 1.0);
}