From 75a9c87b50cef2f1d749bd9042a9348bc28b4c09 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 23 Oct 2022 02:48:51 +0200 Subject: Sun lighting --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5d5af2f..40034e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,10 +66,15 @@ void run() { auto view_uniform = program.uniform("view_matrix"); auto projection_uniform = program.uniform("projection_matrix"); + auto sun_direction_uniform = program.uniform("sun_direction"); + program.bind(); auto projection = Math::MVP::projection(ASPECT, FOV, 0.1f, 1000.0f); projection_uniform.set(projection); + Vector<3> sun_direction{1.0f, -1.0f, 0.0f}; + sun_direction_uniform.set(sun_direction); + glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); -- cgit 1.4.1