From 2133c11b57397248138299d980e624c5300c1d77 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 14 Feb 2026 19:18:47 -0800 Subject: Directional light --- src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 17995bc..87515c1 100644 --- a/src/main.c +++ b/src/main.c @@ -331,8 +331,12 @@ static bool Render(State* state) { (sgVec2){1.0, 1.0}, }; sgTrianglesIndexed(state->gfx, 3, indices, positions, texcoords);*/ + constexpr R a = .4f; + constexpr R d = .8f; + const vec3 L = vec3_normalize(vec3_make(-1.f, -1.f, -1.f)); sgLighting(state->gfx); - sgAmbient(state->gfx, (sgVec3){1,1,1}); + sgAmbient(state->gfx, (sgVec3){a, a, a}); + sgDirectional(state->gfx, (sgColour3){d,d,d}, SgVec3FromMathVec3(L)); // Debugging <-- //sgDepth(state->gfx); //sgNormals(state->gfx); -- cgit v1.2.3