From 22aeb320b193705f493747714404c8ddc752919b Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 9 Jul 2023 23:49:46 +0200 Subject: Added corners to AO --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c690391..9b88986 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,7 @@ void run() { MC::World::World world; MC::GFX::Camera camera{}; - camera.set_position({0.0f, MC::World::Chunk::Height / 2.0f, 0.0f}); + camera.set_position({0, MC::World::Chunk::Height / 2.0, 0}); MC::GFX::Shading::Program program( MC::GFX::Shading::Shader::create_vertex(), @@ -73,10 +73,10 @@ void run() { auto projection = Math::MVP::perspective_projection(ASPECT, FOV, 0.1f, 1000.0f); projection_uniform.set(projection); - Vector<3, F32> sun_direction{1.0f, -1.0f, 0.0f}; + Vector<3, F32> sun_direction{1, -1, 0}; sun_direction_uniform.set(sun_direction); - Vector<3, F32> sky_color{0.85f, 0.85f, 0.85f}; // #DBDBDB + Vector<3, F32> sky_color{0.85, 0.85, 0.85}; // #DBDBDB sky_color_uniform.set(sky_color); glEnable(GL_DEPTH_TEST); @@ -104,6 +104,7 @@ void run() { glClearColor(sky_color.x(), sky_color.y(), sky_color.z(), 1.0f); // #DBDBDB glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + for (auto chunk : world.get_visible_chunks(camera.position())) { auto model = Math::MVP::model(chunk->chunk.value().position(), {}); model_uniform.set(model); -- cgit 1.4.1