diff --git a/QGameDev/CMakeLists.txt b/QGameDev/CMakeLists.txt index 7e76a7d..68caa0c 100644 --- a/QGameDev/CMakeLists.txt +++ b/QGameDev/CMakeLists.txt @@ -164,7 +164,7 @@ set (INCLUDE_DIR ../thirdparty/glew/include ../thirdparty/glm/glm ../thirdparty/webview2/include -../packages/v8-v143-x64.10.0.139.9/include +../packages/v8-v143-x64.11.9.169.4/include ) set (LINK_DIR @@ -174,9 +174,9 @@ set (LINK_DIR ../thirdparty/portaudio/lib ../thirdparty/webp/lib ../thirdparty/webview2/lib -../packages/zeroc.openssl.v143.1.1.1.2/build/native/lib/x64/Release +../packages/zeroc.openssl.v143.1.1.1.3/build/native/lib/x64/Release ../packages/FFmpeg.Nightly.20200831.1.0/build/native/lib/x64 -../packages/v8-v143-x64.10.0.139.9/lib/Release +../packages/v8-v143-x64.11.9.169.4/lib/Release ) set (LINK_LIBS @@ -209,7 +209,9 @@ swscale.lib v8.dll.lib v8_libbase.dll.lib v8_libplatform.dll.lib -zlib.dll.lib +third_party_abseil-cpp_absl.dll.lib +third_party_icu_icui18n.dll.lib +third_party_zlib.dll.lib ) set (DLLS_TO_COPY @@ -227,7 +229,7 @@ set (DEFINES ${DEFINES} include_directories(${INCLUDE_DIR}) add_definitions(${DEFINES}) add_executable (QGameDev ${SOURCES} ${HEADERS}) -set_property(TARGET QGameDev PROPERTY WIN32_EXECUTABLE true) +set_property(TARGET QGameDev PROPERTY WIN32_EXECUTABLE false) target_link_directories(QGameDev PUBLIC ${LINK_DIR}) target_link_libraries(QGameDev ${LINK_LIBS}) diff --git a/QGamePlayer/CMakeLists.txt b/QGamePlayer/CMakeLists.txt index 7ad0d5a..0541ef0 100644 --- a/QGamePlayer/CMakeLists.txt +++ b/QGamePlayer/CMakeLists.txt @@ -47,7 +47,7 @@ set (INCLUDE_DIR ../thirdparty/glew/include ../thirdparty/glm/glm ../thirdparty/webview2/include -../packages/v8-v143-x64.10.0.139.9/include +../packages/v8-v143-x64.11.9.169.4/include ) set (LINK_DIR @@ -57,9 +57,9 @@ set (LINK_DIR ../thirdparty/portaudio/lib ../thirdparty/webp/lib ../thirdparty/webview2/lib -../packages/zeroc.openssl.v143.1.1.1.2/build/native/lib/x64/Release +../packages/zeroc.openssl.v143.1.1.1.3/build/native/lib/x64/Release ../packages/FFmpeg.Nightly.20200831.1.0/build/native/lib/x64 -../packages/v8-v143-x64.10.0.139.9/lib/Release +../packages/v8-v143-x64.11.9.169.4/lib/Release ) set (LINK_LIBS @@ -92,7 +92,9 @@ swscale.lib v8.dll.lib v8_libbase.dll.lib v8_libplatform.dll.lib -zlib.dll.lib +third_party_abseil-cpp_absl.dll.lib +third_party_icu_icui18n.dll.lib +third_party_zlib.dll.lib ) set (DLLS_TO_COPY @@ -109,13 +111,14 @@ ${QT_ROOT}/bin/Qt6OpenGLWidgets.dll ../packages/FFmpeg.Nightly.20200831.1.0/build/native/bin/x64/postproc-55.dll ../packages/FFmpeg.Nightly.20200831.1.0/build/native/bin/x64/swresample-3.dll ../packages/FFmpeg.Nightly.20200831.1.0/build/native/bin/x64/swscale-5.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/icudtl.dat -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/icui18n.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/icuuc.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/v8.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/v8_libbase.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/v8_libplatform.dll -../packages/v8.redist-v143-x64.10.0.139.9/lib/Release/zlib.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/icudtl.dat +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/icuuc.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/v8.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/v8_libbase.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/v8_libplatform.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/third_party_abseil-cpp_absl.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/third_party_icu_icui18n.dll +../packages/v8.redist-v143-x64.11.9.169.4/lib/Release/third_party_zlib.dll ) diff --git a/Test.Cpp/Game.cpp b/Test.Cpp/Game.cpp index 013a532..7b3fe1b 100644 --- a/Test.Cpp/Game.cpp +++ b/Test.Cpp/Game.cpp @@ -1,7 +1,10 @@ #include #include "Game.h" #include -#include +#include +#include +#include +#include #define ENABLE_MSAA 1 @@ -24,14 +27,54 @@ Game::Game(int width, int height) m_directional_light.setShadowProjection(-10.0f, 10.0f, -10.0f, 10.0f, 0.0f, 50.0f); m_scene.add(&m_directional_light); - m_bg.skyColor = { 1.0f, 1.0f, 1.0f }; + /*m_bg.skyColor = {1.0f, 1.0f, 1.0f}; m_bg.groundColor = { 0.02843f, 0.07819f, 0.0781f }; m_scene.background = &m_bg; m_envLight.skyColor = { 1.0f, 1.0f, 1.0f }; m_envLight.groundColor = { 0.02843f, 0.07819f, 0.0781f }; + m_scene.indirectLight = &m_envLight;*/ + + CubeImage image; + ImageLoader::LoadCubeFromFile(&image, + "../game/assets/textures/sky_cube_face0.jpg", + "../game/assets/textures/sky_cube_face1.jpg", + "../game/assets/textures/sky_cube_face2.jpg", + "../game/assets/textures/sky_cube_face3.jpg", + "../game/assets/textures/sky_cube_face4.jpg", + "../game/assets/textures/sky_cube_face5.jpg"); + + m_bg.cubemap.load_memory_rgba(image.images[0].width(), image.images[0].height(), + image.images[0].data(), image.images[1].data(), image.images[2].data(), image.images[3].data(), image.images[4].data(), image.images[5].data()); + m_scene.background = &m_bg; + + EnvironmentMapCreator creator; + creator.Create(&image, &m_envLight); m_scene.indirectLight = &m_envLight; + { + int size = 1024; + GLTexture2D tex_out; + glBindTexture(GL_TEXTURE_2D, tex_out.tex_id); + glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, size, size); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + + std::vector rgba(size * size * 4); + Cube2Octa convert; + convert.convert(&m_bg.cubemap, &tex_out, size, size); + glBindTexture(GL_TEXTURE_2D, tex_out.tex_id); + glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba.data()); + glBindTexture(GL_TEXTURE_2D, 0); + + stbi_write_png("octa.png", size, size, 4, rgba.data(), size * 4); + + } + + m_box.name = "box"; GeometryCreator::CreateBox(&m_box.geometry, 2.0f, 2.0f, 2.0f); m_box.translateX(-1.5f); diff --git a/Test.Cpp/Game.h b/Test.Cpp/Game.h index 444dc28..846aaa8 100644 --- a/Test.Cpp/Game.h +++ b/Test.Cpp/Game.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -26,8 +27,10 @@ class Game Scene m_scene; PerspectiveCamera m_camera; DirectionalLight m_directional_light; - HemisphereBackground m_bg; - HemisphereLight m_envLight; + //HemisphereBackground m_bg; + //HemisphereLight m_envLight; + CubeBackground m_bg; + EnvironmentMap m_envLight; SimpleModel m_box; SimpleModel m_sphere; diff --git a/Test.Cpp/Test.Cpp.vcxproj b/Test.Cpp/Test.Cpp.vcxproj index 43f520f..a404628 100644 --- a/Test.Cpp/Test.Cpp.vcxproj +++ b/Test.Cpp/Test.Cpp.vcxproj @@ -130,7 +130,7 @@ true _CRT_SECURE_NO_WARNINGS; GLEW_STATIC=1;%(PreprocessorDefinitions) true - ../ThreeEngine;../thirdparty/glew/include;../thirdparty/glm/glm;../thirdparty/draco/lib;%(AdditionalIncludeDirectories) + ../ThreeEngine;../thirdparty/glew/include;../thirdparty/glm/glm;../thirdparty/draco/lib;../thirdparty;%(AdditionalIncludeDirectories) stdcpp17 @@ -161,12 +161,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/Test.Cpp/packages.config b/Test.Cpp/packages.config index 44c89a5..04f9fc0 100644 --- a/Test.Cpp/packages.config +++ b/Test.Cpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Test.V8/Test.V8.vcxproj b/Test.V8/Test.V8.vcxproj index de263f8..f23e25a 100644 --- a/Test.V8/Test.V8.vcxproj +++ b/Test.V8/Test.V8.vcxproj @@ -1,7 +1,7 @@ - - + + Debug @@ -164,18 +164,18 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + \ No newline at end of file diff --git a/Test.V8/main.cpp b/Test.V8/main.cpp index 061895b..c801613 100644 --- a/Test.V8/main.cpp +++ b/Test.V8/main.cpp @@ -90,7 +90,7 @@ class AppMain : private GLMain int main(int argc, const char* argv[]) { AppMain app(argv[0]); - app.LoadScript("../game", "bundle_game.js"); + app.LoadScript("../game", "bundle_http_test.js"); app.MainLoop(); return 0; } diff --git a/Test.V8/packages.config b/Test.V8/packages.config index a9992d0..e8f4084 100644 --- a/Test.V8/packages.config +++ b/Test.V8/packages.config @@ -1,8 +1,8 @@  - + - - - + + + \ No newline at end of file diff --git a/Three.V8/Three.V8.vcxproj b/Three.V8/Three.V8.vcxproj index aecda0b..dc9cc42 100644 --- a/Three.V8/Three.V8.vcxproj +++ b/Three.V8/Three.V8.vcxproj @@ -1,7 +1,7 @@ - - + + Debug @@ -219,16 +219,16 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + \ No newline at end of file diff --git a/Three.V8/binding.cpp b/Three.V8/binding.cpp index 7b9a4bd..7113905 100644 --- a/Three.V8/binding.cpp +++ b/Three.V8/binding.cpp @@ -24,7 +24,7 @@ V8VM::~V8VM() m_isolate->Exit(); m_isolate->Dispose(); v8::V8::Dispose(); - v8::V8::ShutdownPlatform(); + v8::V8::DisposePlatform(); delete m_array_buffer_allocator; } diff --git a/Three.V8/packages.config b/Three.V8/packages.config index 57e79dc..cb44329 100644 --- a/Three.V8/packages.config +++ b/Three.V8/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/ThreeEngine/ThreeEngine.vcxproj b/ThreeEngine/ThreeEngine.vcxproj index 6ce1ea2..a5d57b5 100644 --- a/ThreeEngine/ThreeEngine.vcxproj +++ b/ThreeEngine/ThreeEngine.vcxproj @@ -430,14 +430,14 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/ThreeEngine/packages.config b/ThreeEngine/packages.config index 5fc0fa0..c105c11 100644 --- a/ThreeEngine/packages.config +++ b/ThreeEngine/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/ThreeMM/ThreeMM.vcxproj b/ThreeMM/ThreeMM.vcxproj index 920dc5c..c3267a0 100644 --- a/ThreeMM/ThreeMM.vcxproj +++ b/ThreeMM/ThreeMM.vcxproj @@ -162,15 +162,15 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/ThreeMM/packages.config b/ThreeMM/packages.config index b4e575a..1bf95f7 100644 --- a/ThreeMM/packages.config +++ b/ThreeMM/packages.config @@ -1,6 +1,6 @@  - + - + \ No newline at end of file