Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Adds lighting;
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Mar 10, 2021
1 parent 48a9848 commit b8f362d
Show file tree
Hide file tree
Showing 7 changed files with 432 additions and 155 deletions.
8 changes: 8 additions & 0 deletions src/light.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version 450

layout(location=0) in vec3 v_color;
layout(location=0) out vec4 f_color;

void main() {
f_color = vec4(v_color, 1.0);
}
27 changes: 27 additions & 0 deletions src/light.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#version 450

layout(location=0) in vec3 a_position;

layout(location=0) out vec3 v_color;

layout(set=0, binding=0)
uniform Uniforms {
vec3 u_view_position; // unused
mat4 u_view_proj;
};

layout(set=1, binding=0)
uniform Light {
vec3 u_position;
vec3 u_color;
};

// Let's keep our light smaller than our other objects
float scale = 0.25;

void main() {
vec3 v_position = a_position * scale + u_position;
gl_Position = u_view_proj * vec4(v_position, 1);

v_color = u_color;
}
Loading

0 comments on commit b8f362d

Please sign in to comment.