From 62aa2fbc3b4d208cf798ed20139b678fff552a30 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sat, 24 Aug 2024 23:15:38 +0100 Subject: [PATCH] Change directional light to point light --- src/model/obj.h | 6 +++--- src/shader/shaders.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/model/obj.h b/src/model/obj.h index 4bda0d7..49e96a7 100644 --- a/src/model/obj.h +++ b/src/model/obj.h @@ -33,11 +33,11 @@ struct phong_material { f32 shininess; }; -typedef struct directional_light DirectionalLight; -struct directional_light { +typedef struct point_light PointLight; +struct point_light { V3f diffuse_intensity; V3f specular_intensity; - V3f direction; + V3f position; }; typedef struct model Model; diff --git a/src/shader/shaders.c b/src/shader/shaders.c index 483f68c..1d1d9d2 100644 --- a/src/shader/shaders.c +++ b/src/shader/shaders.c @@ -22,10 +22,10 @@ internal Shader perspective = {0}; internal Shader orthographic = {0}; internal V3f g_ambient_light = {0.6f, 0.45f, 0.55f}; -internal DirectionalLight g_directional_light = { +internal PointLight g_directional_light = { .diffuse_intensity = {0.9f, 1.0f, 1.0f}, .specular_intensity = {1.0f, 0.8f, 2.0f}, - .direction = {0.0f, 0.0f, 1.45f}, + .position = {1.05f, 0.9f, 1.2f}, }; internal V3f g_eye = {0.2f, 0.1f, 0.75f}; internal V3f g_target = {0};