summaryrefslogtreecommitdiff
path: root/engine/fragment.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'engine/fragment.glsl')
-rw-r--r--engine/fragment.glsl15
1 files changed, 12 insertions, 3 deletions
diff --git a/engine/fragment.glsl b/engine/fragment.glsl
index a9d192b..9becd4c 100644
--- a/engine/fragment.glsl
+++ b/engine/fragment.glsl
@@ -10,19 +10,28 @@ in vec3 in_frag_pos;
in vec3 in_normal;
uniform vec3 view_pos;
-
uniform sampler2D input_texture;
+uniform Material material;
+uniform PointLight light;
void main()
{
- vec3 ambient_light = calc_ambient_light(in_texture_coords);
+ vec3 ambient_light = calc_ambient_light(material, in_texture_coords);
vec3 light_direction = normalize(light.position - in_frag_pos);
vec3 norm = normalize(in_normal);
- vec3 diffuse_light = calc_diffuse_light(light_direction, norm, in_texture_coords);
+ vec3 diffuse_light = calc_diffuse_light(
+ material,
+ light,
+ light_direction,
+ norm,
+ in_texture_coords
+ );
vec3 specular_light = calc_specular_light(
+ material,
+ light,
light_direction,
norm,
view_pos,