Implement configurable lighting
This commit is contained in:
1 parent
070758b6cc
commit
b5bda150d2
6 files changed
+148
-49
No files matched your search
+5
-5
@@ -3,10 +3,10 @@
|
||||
layout(location = 0) out vec3 frag_normal;
|
||||
layout(location = 1) out vec4 light_pos;
|
||||
|
||||
layout(push_constant) uniform push_t {
|
||||
layout(push_constant) uniform vps_t {
|
||||
mat4 vp;
|
||||
mat4 light_vp;
|
||||
} push;
|
||||
} vps;
|
||||
|
||||
vec2 vertices[4] = vec2[](
|
||||
vec2(-1, -1),
|
||||
@@ -16,9 +16,9 @@ vec2 vertices[4] = vec2[](
|
||||
);
|
||||
|
||||
void main() {
|
||||
const vec2 pos = 3 * vertices[gl_VertexIndex];
|
||||
const vec2 pos = 4 * vertices[gl_VertexIndex];
|
||||
const vec4 world_pos = vec4(pos.x, 0, pos.y, 1);
|
||||
gl_Position = push.vp * world_pos;
|
||||
gl_Position = vps.vp * world_pos;
|
||||
frag_normal = vec3(0, 1, 0);
|
||||
light_pos = push.light_vp * world_pos;
|
||||
light_pos = vps.light_vp * world_pos;
|
||||
}
|
||||
Reference in new issue
Block a user