initial commit-moved from vulkan_guide
This commit is contained in:
29
shaders/shadow.vert
Normal file
29
shaders/shadow.vert
Normal file
@@ -0,0 +1,29 @@
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_buffer_reference : require
|
||||
|
||||
#include "input_structures.glsl"
|
||||
|
||||
struct Vertex {
|
||||
vec3 position; float uv_x;
|
||||
vec3 normal; float uv_y;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
layout(buffer_reference, std430) readonly buffer VertexBuffer{
|
||||
Vertex vertices[];
|
||||
};
|
||||
|
||||
layout(push_constant) uniform PushConsts {
|
||||
mat4 render_matrix;
|
||||
VertexBuffer vertexBuffer;
|
||||
} PC;
|
||||
|
||||
void main()
|
||||
{
|
||||
Vertex v = PC.vertexBuffer.vertices[gl_VertexIndex];
|
||||
vec4 worldPos = PC.render_matrix * vec4(v.position, 1.0);
|
||||
gl_Position = sceneData.lightViewProj * worldPos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user