diff --git a/cmake-build-relwithdebinfo/.ninja_deps b/cmake-build-relwithdebinfo/.ninja_deps index 9fc2ba6..fa2d723 100644 Binary files a/cmake-build-relwithdebinfo/.ninja_deps and b/cmake-build-relwithdebinfo/.ninja_deps differ diff --git a/cmake-build-relwithdebinfo/.ninja_log b/cmake-build-relwithdebinfo/.ninja_log index 4cd2e81..17ecd56 100644 --- a/cmake-build-relwithdebinfo/.ninja_log +++ b/cmake-build-relwithdebinfo/.ninja_log @@ -139,3 +139,45 @@ 1876 2007 1678249648477944606 FinalProject 9e02455301d10951 2 2022 1678251955314585263 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 2022 2153 1678251955446588751 FinalProject 9e02455301d10951 +2 1933 1678252580647737417 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1933 2067 1678252580779741069 FinalProject 9e02455301d10951 +2 2070 1678252594716126402 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2071 2209 1678252594856130274 FinalProject 9e02455301d10951 +3 1938 1678252683618577276 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1938 2081 1678252683762581236 FinalProject 9e02455301d10951 +3 1310 1678252738860094491 CMakeFiles/FinalProject.dir/src/main.cpp.o 44f0aca089894d0f +3 1393 1678252738944096795 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 19cb330422f1ead7 +4 1504 1678252739056099867 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 3e7542c3498b07ce +4 2090 1678252739640115884 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +3 4066 1678252741616170081 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 257310165eab029f +4067 4204 1678252741752173814 FinalProject 9e02455301d10951 +2 2131 1678252782041277781 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2131 2283 1678252782193281943 FinalProject 9e02455301d10951 +2 2104 1678252801381807062 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2104 2241 1678252801521810892 FinalProject 9e02455301d10951 +2 1792 1678252933293406710 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1792 1924 1678252933425410304 FinalProject 9e02455301d10951 +2 1970 1678252964198247745 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1970 2100 1678252964326251229 FinalProject 9e02455301d10951 +2 1927 1678253018383720500 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1927 2064 1678253018519724196 FinalProject 9e02455301d10951 +2 1965 1678253059152827185 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1965 2104 1678253059292830984 FinalProject 9e02455301d10951 +3 2066 1678253099489921051 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2066 2250 1678253099673926038 FinalProject 9e02455301d10951 +2 2010 1678253137158941648 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2010 2141 1678253137286945113 FinalProject 9e02455301d10951 +3 2011 1678253164823690665 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2011 2154 1678253164967694564 FinalProject 9e02455301d10951 +3 1977 1678253191412410160 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1978 2115 1678253191552413947 FinalProject 9e02455301d10951 +2 1920 1678253205668795785 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1920 2083 1678253205832800221 FinalProject 9e02455301d10951 +3 1925 1678253234233568143 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1925 2056 1678253234365571711 FinalProject 9e02455301d10951 +2 2030 1678253266642443972 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +2030 2167 1678253266778447646 FinalProject 9e02455301d10951 +3 1974 1678253411210345498 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1974 2116 1678253411350349272 FinalProject 9e02455301d10951 +3 1967 1678253495928628418 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 5a5f514ae327b7c6 +1967 2127 1678253496088632727 FinalProject 9e02455301d10951 diff --git a/cmake-build-relwithdebinfo/FinalProject b/cmake-build-relwithdebinfo/FinalProject index 478aa5d..496fb42 100755 Binary files a/cmake-build-relwithdebinfo/FinalProject and b/cmake-build-relwithdebinfo/FinalProject differ diff --git a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log index 6726664..172be03 100644 --- a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log +++ b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Mar 08 00:05 EST +Start testing: Mar 08 00:31 EST ---------------------------------------------------------- -End testing: Mar 08 00:05 EST +End testing: Mar 08 00:31 EST diff --git a/include/render/textures.h b/include/render/textures.h index 9a4670c..bfab81e 100644 --- a/include/render/textures.h +++ b/include/render/textures.h @@ -137,7 +137,7 @@ namespace fp::texture { // Anisotropy helps preserve textures at oblique angles float a = 0; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &a); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, a); + glTexParameterf(textureBindType, GL_TEXTURE_MAX_ANISOTROPY_EXT, a); unbind(); } diff --git a/src/world/chunk/world.cpp b/src/world/chunk/world.cpp index 4894df8..0e78569 100644 --- a/src/world/chunk/world.cpp +++ b/src/world/chunk/world.cpp @@ -10,6 +10,7 @@ #include #include "stb/stb_perlin.h" #include +#include #include #include @@ -190,17 +191,29 @@ fp::chunk* fp::world::generateChunk(const fp::chunk_pos& pos) { auto block_x = float(pos.x * CHUNK_SIZE + i); for (int k = 0; k < CHUNK_SIZE; k++) { auto block_z = float(pos.z * CHUNK_SIZE + k); - auto world_height = stb_perlin_ridge_noise3( + + auto noise1 = stb_perlin_ridge_noise3( block_x / 128.0f, 8.1539123f, block_z / 128.0f, 2.0f, 0.5f, 1.0, 12.0f - ) * 128 + 64; + ); + + float noise_total = 1; + + for (int i = 1; i <= 8; i++) + noise_total += stb_perlin_noise3(block_x / 256.0f, block_z / 256.0f, i * 5.213953, 0, 0, 0) * (float)(i); + + noise_total /= 8; + + auto world_height = noise1 * noise_total * 128 + 64; for (int j = 0; j < CHUNK_SIZE; j++) { auto block_y = float(pos.y * CHUNK_SIZE + j); - if (block_y < world_height) - storage->set({i, j, k}, fp::registry::STONE); + float noise2 = stb_perlin_fbm_noise3(block_x / 32.0f, block_y / 32.0f, block_z / 32.0f, 2.0, 0.5, 5) + 0.75f; + + if (block_y < world_height && noise2 > 0) + storage->set({i, j, k}, noise2 > 1 ? fp::registry::GRASS : fp::registry::STONE); } } }