summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-02-14 19:18:47 -0800
committer3gg <3gg@shellblade.net>2026-02-14 19:18:47 -0800
commit2133c11b57397248138299d980e624c5300c1d77 (patch)
tree329229169b86a2ece4beecdbc78026b69001950b /src/main.c
parent2bdc393e9a3987f5e35a967933cde0c4bf3ceeca (diff)
Directional light
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
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) {
331 (sgVec2){1.0, 1.0}, 331 (sgVec2){1.0, 1.0},
332 }; 332 };
333 sgTrianglesIndexed(state->gfx, 3, indices, positions, texcoords);*/ 333 sgTrianglesIndexed(state->gfx, 3, indices, positions, texcoords);*/
334 constexpr R a = .4f;
335 constexpr R d = .8f;
336 const vec3 L = vec3_normalize(vec3_make(-1.f, -1.f, -1.f));
334 sgLighting(state->gfx); 337 sgLighting(state->gfx);
335 sgAmbient(state->gfx, (sgVec3){1,1,1}); 338 sgAmbient(state->gfx, (sgVec3){a, a, a});
339 sgDirectional(state->gfx, (sgColour3){d,d,d}, SgVec3FromMathVec3(L));
336 // Debugging <-- 340 // Debugging <--
337 //sgDepth(state->gfx); 341 //sgDepth(state->gfx);
338 //sgNormals(state->gfx); 342 //sgNormals(state->gfx);