From 26d8f19e450c76b765be9860a0fa9f15ca36ffeb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:16:23 +0000 Subject: [PATCH 01/60] Implement Option To Create New Project (#271( --- .../Menus/GUI_Menu_File/GUI_Menu_File.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index 198fb1f33c..681b85e2ab 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -31,21 +31,12 @@ void GUI_Menu_File::Draw() { // File Menu if (ImGui::BeginMenu("File")) { + ImGui::MenuItem("New", ""); ImGui::MenuItem("Open", "", &Windows_->GUI_Window_OpenProject_->Enabled_); ImGui::Separator(); - ImGui::MenuItem("About", "", &Windows_->GUI_Window_About_->Enabled_); - ImGui::Separator(); - - ImGui::MenuItem("Project Settings", "", &Windows_->GUI_Window_ProjectSettings_->Enabled_); - ImGui::Separator(); - if (ImGui::MenuItem("Import Model")) { - ImportAsset_->OpenFileDialog(); - } ImGui::Separator(); - - // Save All if (ImGui::MenuItem("Save")) { SystemUtils_->Logger_->Log("Saving Project Data", 4); @@ -61,6 +52,13 @@ void GUI_Menu_File::Draw() { } } + ImGui::MenuItem("Project Settings", "", &Windows_->GUI_Window_ProjectSettings_->Enabled_); + ImGui::MenuItem("About", "", &Windows_->GUI_Window_About_->Enabled_); + ImGui::Separator(); + + if (ImGui::MenuItem("Import Model")) { + ImportAsset_->OpenFileDialog(); + } ImGui::Separator(); // Exit Options From 54b58c18cb1a8fb72d84a66d3d3d3e8ae22d3f34 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:18:00 +0000 Subject: [PATCH 02/60] Implement Option To Create New Project (#271) --- .../GUI_Window_NewProject/CMakeLists.txt | 31 ++++++++ .../GUI_Window_OpenProject.cpp | 74 +++++++++++++++++++ .../GUI_Window_OpenProject.h | 57 ++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt create mode 100644 Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp create mode 100644 Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt b/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt new file mode 100644 index 0000000000..60ab691ea7 --- /dev/null +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt @@ -0,0 +1,31 @@ +######################################################################## +# This file is part of the BrainGenix-ERS Environment Rendering System # +######################################################################## + +# Create Library (Name Should Be Parent Dir Name) +add_library(GUI_Window_OpenProject + + # Add Source Files (.cpp) + "GUI_Window_OpenProject.cpp" + + # Add Header Files (.h) + "GUI_Window_OpenProject.h" + + + ${BACKWARD_ENABLE} + ) + +# Link 3rd Party Libs +target_link_libraries(GUI_Window_OpenProject + glad + glfw + IMGUI + ImGuiFileDialog + ) + +# Link Internal Libs +target_link_libraries(GUI_Window_OpenProject + ERS_STRUCT_SystemUtils + ) + +target_include_directories(GUI_Window_OpenProject PUBLIC ./) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp new file mode 100644 index 0000000000..1030bb7908 --- /dev/null +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp @@ -0,0 +1,74 @@ +//======================================================================// +// This file is part of the BrainGenix-ERS Environment Rendering System // +//======================================================================// + +#include + + +GUI_Window_OpenProject::GUI_Window_OpenProject(ERS_STRUCT_SystemUtils* SystemUtils) { + + SystemUtils_ = SystemUtils; + SystemUtils_->Logger_->Log("Seting Up Open Project Window Dialog", 5); + +} + + +GUI_Window_OpenProject::~GUI_Window_OpenProject() { + + SystemUtils_->Logger_->Log("Open Project Window Dialog Destructor Called", 6); + +} + + +void GUI_Window_OpenProject::Draw() { + + if (Enabled_ && !LastWindowState_) { + ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", ".ERS", ".", "", 0); + } + + if (Enabled_) { + + // Draw File Dialog + if (ImGuiFileDialog::Instance()->Display("Open Project", ImGuiWindowFlags_None, ImVec2(400, 200))) { + + + if (ImGuiFileDialog::Instance()->IsOk()) + { + + std::string Path = ImGuiFileDialog::Instance()->GetCurrentPath(); + Path += "/"; + SystemUtils_->Logger_->Log(std::string("Opening Project At Path '") + Path + "'", 5); + + std::string Command; + +#if defined(_WIN32) + Command += ""; +#elif defined(__APPLE__) + Command += "./"; +#else + Command += "./"; +#endif + Command += "BrainGenix-ERS -ProjectDirectory "; + Command += '"' + Path + '"' + " &"; + std::system(Command.c_str()); + + // Quit System + SystemUtils_->Logger_->Log("Shutting Down This Editor Window Now", 5); + *SystemUtils_->SystemShouldRun_ = false; + + + } + + ImGuiFileDialog::Instance()->Close(); + } + + + + + } + + LastWindowState_ = Enabled_; + + +} + diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h new file mode 100644 index 0000000000..6c4e3f2352 --- /dev/null +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h @@ -0,0 +1,57 @@ +//======================================================================// +// This file is part of the BrainGenix-ERS Environment Rendering System // +//======================================================================// + +#pragma once + + +// Standard Libraries (BG convention: use <> instead of "") +#include +#include + +// Third-Party Libraries (BG convention: use <> instead of "") +#include + +#include + +#include + +// Internal Libraries (BG convention: use <> instead of "") +#include + + +/** + * @brief This class provides the GUI to the import asset option within the file menu. + * + */ +class GUI_Window_OpenProject { + +private: + + ERS_STRUCT_SystemUtils* SystemUtils_; /** Date: Wed, 6 Jul 2022 04:18:19 +0000 Subject: [PATCH 03/60] Implement Option To Create New Project (#271) --- Source/Core/Editor/Windows/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Windows/CMakeLists.txt b/Source/Core/Editor/Windows/CMakeLists.txt index 5d25840da9..25b5b101b6 100644 --- a/Source/Core/Editor/Windows/CMakeLists.txt +++ b/Source/Core/Editor/Windows/CMakeLists.txt @@ -20,6 +20,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_ShaderEditor) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_ScriptEditor) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_OpenProject) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_NewProject) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_ThemeSelector) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/GUI_Window_FontSelector) From e25e41dd8fdc267af6ee95c0bec1eb8f4f88383b Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:18:43 +0000 Subject: [PATCH 04/60] Implement Option To Create New Project (#271) --- .../{GUI_Window_OpenProject.cpp => GUI_Window_NewProject.cpp} | 0 .../{GUI_Window_OpenProject.h => GUI_Window_NewProject.h} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Source/Core/Editor/Windows/GUI_Window_NewProject/{GUI_Window_OpenProject.cpp => GUI_Window_NewProject.cpp} (100%) rename Source/Core/Editor/Windows/GUI_Window_NewProject/{GUI_Window_OpenProject.h => GUI_Window_NewProject.h} (100%) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp similarity index 100% rename from Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.cpp rename to Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h similarity index 100% rename from Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_OpenProject.h rename to Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h From 97c76b740eb5f9e875145b61a9f3072488f42d34 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:18:54 +0000 Subject: [PATCH 05/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt b/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt index 60ab691ea7..894e609d91 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/CMakeLists.txt @@ -3,20 +3,20 @@ ######################################################################## # Create Library (Name Should Be Parent Dir Name) -add_library(GUI_Window_OpenProject +add_library(GUI_Window_NewProject # Add Source Files (.cpp) - "GUI_Window_OpenProject.cpp" + "GUI_Window_NewProject.cpp" # Add Header Files (.h) - "GUI_Window_OpenProject.h" + "GUI_Window_NewProject.h" ${BACKWARD_ENABLE} ) # Link 3rd Party Libs -target_link_libraries(GUI_Window_OpenProject +target_link_libraries(GUI_Window_NewProject glad glfw IMGUI @@ -24,8 +24,8 @@ target_link_libraries(GUI_Window_OpenProject ) # Link Internal Libs -target_link_libraries(GUI_Window_OpenProject +target_link_libraries(GUI_Window_NewProject ERS_STRUCT_SystemUtils ) -target_include_directories(GUI_Window_OpenProject PUBLIC ./) +target_include_directories(GUI_Window_NewProject PUBLIC ./) From fa374c9648bb538718edbd8a574f4a926a6c0ace Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:19:07 +0000 Subject: [PATCH 06/60] Implement Option To Create New Project (#271) --- .../GUI_Window_NewProject.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 1030bb7908..c52d6a8635 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -2,34 +2,34 @@ // This file is part of the BrainGenix-ERS Environment Rendering System // //======================================================================// -#include +#include -GUI_Window_OpenProject::GUI_Window_OpenProject(ERS_STRUCT_SystemUtils* SystemUtils) { +GUI_Window_NewProject::GUI_Window_NewProject(ERS_STRUCT_SystemUtils* SystemUtils) { SystemUtils_ = SystemUtils; - SystemUtils_->Logger_->Log("Seting Up Open Project Window Dialog", 5); + SystemUtils_->Logger_->Log("Seting Up New Project Window Dialog", 5); } -GUI_Window_OpenProject::~GUI_Window_OpenProject() { +GUI_Window_NewProject::~GUI_Window_NewProject() { - SystemUtils_->Logger_->Log("Open Project Window Dialog Destructor Called", 6); + SystemUtils_->Logger_->Log("New Project Window Dialog Destructor Called", 6); } -void GUI_Window_OpenProject::Draw() { +void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", ".ERS", ".", "", 0); + ImGuiFileDialog::Instance()->NewDialog("New Project", "New Project", ".ERS", ".", "", 0); } if (Enabled_) { // Draw File Dialog - if (ImGuiFileDialog::Instance()->Display("Open Project", ImGuiWindowFlags_None, ImVec2(400, 200))) { + if (ImGuiFileDialog::Instance()->Display("New Project", ImGuiWindowFlags_None, ImVec2(400, 200))) { if (ImGuiFileDialog::Instance()->IsOk()) @@ -37,7 +37,7 @@ void GUI_Window_OpenProject::Draw() { std::string Path = ImGuiFileDialog::Instance()->GetCurrentPath(); Path += "/"; - SystemUtils_->Logger_->Log(std::string("Opening Project At Path '") + Path + "'", 5); + SystemUtils_->Logger_->Log(std::string("Newing Project At Path '") + Path + "'", 5); std::string Command; From 6ed258778ccea6ea7db465e4187365882eb93ca2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:19:17 +0000 Subject: [PATCH 07/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h index 6c4e3f2352..3b1284e65b 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.h @@ -24,7 +24,7 @@ * @brief This class provides the GUI to the import asset option within the file menu. * */ -class GUI_Window_OpenProject { +class GUI_Window_NewProject { private: @@ -40,13 +40,13 @@ class GUI_Window_OpenProject { * * @param SystemUtils */ - GUI_Window_OpenProject(ERS_STRUCT_SystemUtils* SystemUtils); + GUI_Window_NewProject(ERS_STRUCT_SystemUtils* SystemUtils); /** * @brief Destroy the gui importasset object. * */ - ~GUI_Window_OpenProject(); + ~GUI_Window_NewProject(); /** * @brief Update Any Windows From 0153dd168b3eee5bdc361cd7a3109f6b4e075499 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:19:56 +0000 Subject: [PATCH 08/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index c52d6a8635..60cc825a92 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->NewDialog("New Project", "New Project", ".ERS", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".ERS", ".", "", 0); } if (Enabled_) { From abeb191a15e834d7ac6ae27e3eb98fc76a90c511 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:20:49 +0000 Subject: [PATCH 09/60] Implement Option To Create New Project (#271) --- Source/Core/Editor/Utils/ERS_Editor_WindowManager/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/CMakeLists.txt b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/CMakeLists.txt index 7d3c0bce5a..02b8506cfa 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/CMakeLists.txt +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/CMakeLists.txt @@ -47,6 +47,7 @@ target_link_libraries(ERS_Editor_WindowManager GUI_Window_ThemeSelector GUI_Window_FontSelector GUI_Window_OpenProject + GUI_Window_NewProject ) From 3117ddfacfa31e7b62e0c08ccef6f72746290725 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:21:02 +0000 Subject: [PATCH 10/60] Implement Option To Create New Project (#271) --- .../Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h index d0cd8c8bd1..40f8d4f9db 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h @@ -31,6 +31,7 @@ #include #include #include +#include /** * @brief This structure holds unique pointers to all windows that are instantiated by the GUI. From 7d8cc1f77f3e276570f0330233cf145185e616e6 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:21:18 +0000 Subject: [PATCH 11/60] Implement Option To Create New Project (#271) --- .../Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h index 40f8d4f9db..0a3f89ea5c 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_STRUCT_Windows.h @@ -62,6 +62,7 @@ struct ERS_STRUCT_Windows { std::unique_ptr GUI_Window_ThemeSelector_; std::unique_ptr GUI_Window_FontSelector_; std::unique_ptr GUI_Window_OpenProject_; + std::unique_ptr GUI_Window_NewProject_; }; \ No newline at end of file From 66c9b5bfdf157dffc4b2ecc0465c775417de8ca8 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:21:36 +0000 Subject: [PATCH 12/60] Implement Option To Create New Project (#271) --- .../Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.h b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.h index bf067912a8..89abf212a1 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.h @@ -44,6 +44,7 @@ #include #include #include +#include From dab58528111568656b7fe1ef1f8940f009cbf457 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:21:59 +0000 Subject: [PATCH 13/60] Implement Option To Create New Project (#271) --- .../ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp index d6c58fa211..2dd014a68e 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp @@ -55,7 +55,8 @@ ERS_CLASS_ThemeManager* ThemeManager, ERS_CLASS_FontManager* FontManager, Cursor Windows_->GUI_Window_TestEditor_ = std::make_unique(SystemUtils_); Windows_->GUI_Window_ThemeSelector_ = std::make_unique(ThemeManager); Windows_->GUI_Window_FontSelector_ = std::make_unique(FontManager); - Windows_->GUI_Window_OpenProject_ = std::make_unique(SystemUtils_); + Windows_->GUI_Window_OpenProject_ = std::make_unique(SystemUtils_); + Windows_->GUI_Window_NewProject_ = std::make_unique(SystemUtils_); SystemUtils_->Logger_->Log("WindowManager Subsystem Finished Setting Up Window Struct", 3); SystemUtils_->Logger_->Log("WindowManager Subsystem Setting Up Window Index", 4); From aaf2b87677bd271cba1fa2bb71ef18b2185e386b Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:22:07 +0000 Subject: [PATCH 14/60] Implement Option To Create New Project (#271) --- .../Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp index 2dd014a68e..cd7236456c 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp @@ -82,6 +82,7 @@ ERS_CLASS_ThemeManager* ThemeManager, ERS_CLASS_FontManager* FontManager, Cursor WindowNames_.push_back("ThemeSelector"); WindowNames_.push_back("FontSelector"); WindowNames_.push_back("OpenProject"); + WindowNames_.push_back("NewProject"); SystemUtils_->Logger_->Log("WindowManager Subsystem Finished Setting Up Window Index", 3); From 6430333766c1987c3e3d994576f25aeb91866b7a Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:22:19 +0000 Subject: [PATCH 15/60] Implement Option To Create New Project (#271) --- .../Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp index cd7236456c..f9aa0323aa 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp @@ -115,6 +115,7 @@ void ERS_CLASS_WindowManager::UpdateAllWindows() { Windows_->GUI_Window_ThemeSelector_->Draw(); Windows_->GUI_Window_FontSelector_->Draw(); Windows_->GUI_Window_OpenProject_->Draw(); + Windows_->GUI_Window_NewProject_->Draw(); } From 01a6533a10181364cf1dac0710b23bda501e9568 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:22:39 +0000 Subject: [PATCH 16/60] Implement Option To Create New Project (#271) --- .../ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp index f9aa0323aa..08e3b8e0c6 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp @@ -186,6 +186,9 @@ bool ERS_CLASS_WindowManager::SetWindowStatus(std::string WindowName, bool Statu } else if (WindowName == "OpenProject") { Windows_->GUI_Window_OpenProject_->Enabled_ = Status; return true; + } else if (WindowName == "NewProject") { + Windows_->GUI_Window_NewProject_->Enabled_ = Status; + return true; } else { return false; } From a5fccdf5a1d38964856076cdb4c23b85836fd650 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:23:10 +0000 Subject: [PATCH 17/60] Implement Option To Create New Project (#271) --- .../ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp index 08e3b8e0c6..ed22cfd673 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_WindowManager/ERS_Editor_WindowManager.cpp @@ -262,6 +262,9 @@ bool ERS_CLASS_WindowManager::GetWindowStatus(std::string WindowName, bool* Stat } else if (WindowName == "OpenProject") { *Status = Windows_->GUI_Window_OpenProject_->Enabled_; return true; + } else if (WindowName == "NewProject") { + *Status = Windows_->GUI_Window_NewProject_->Enabled_; + return true; } else { return false; } From 028b67d259775fa62b68b69c9b06d2dcfe9af841 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:23:48 +0000 Subject: [PATCH 18/60] Implement Option To Create New Project (#271) --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index 681b85e2ab..de258b24ed 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -31,7 +31,7 @@ void GUI_Menu_File::Draw() { // File Menu if (ImGui::BeginMenu("File")) { - ImGui::MenuItem("New", ""); + ImGui::MenuItem("New", "", &Windows_->GUI_Window_NewProject_->Enabled_); ImGui::MenuItem("Open", "", &Windows_->GUI_Window_OpenProject_->Enabled_); ImGui::Separator(); From 193b78b89251b9bc95a120e3f79dd9ce54010deb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:37:53 +0000 Subject: [PATCH 19/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 60cc825a92..d203ba2202 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".ERS", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "", ".", "", 0); } if (Enabled_) { From ef1ee382ad245ea953b3b186b382b7c352a32eed Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:38:41 +0000 Subject: [PATCH 20/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index d203ba2202..ccf1240f95 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "", "", "", 0); } if (Enabled_) { From 06656c3994b54723b91d4f630fcce84976040615 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:39:16 +0000 Subject: [PATCH 21/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index ccf1240f95..cd5f0b7b09 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "", "", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".", ".", "", 0); } if (Enabled_) { From 4a6a682bb20bb2aee9f5a6db8b131b2e6da22f42 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:41:30 +0000 Subject: [PATCH 22/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index cd5f0b7b09..b3bdb022d4 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "[DIR]", ".", "", 0); } if (Enabled_) { From a47824edd6a2aed98631ae2d02dc2ffdf5c9521c Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:45:39 +0000 Subject: [PATCH 23/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index b3bdb022d4..dc8da064c3 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,8 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", "[DIR]", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".", ".", "", 0); + } if (Enabled_) { From 3d2e158dab7e7f4a5fc6aced4b99df4fd5efda1d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:47:46 +0000 Subject: [PATCH 24/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index dc8da064c3..857c8212a6 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", ".", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", nullptr, ".", "", 0); } From 0bbffa816d27c5fdaf0f9e206cd701fa3ebf37fa Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 04:48:07 +0000 Subject: [PATCH 25/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp index 1030bb7908..a5340ebdce 100644 --- a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp @@ -23,7 +23,7 @@ GUI_Window_OpenProject::~GUI_Window_OpenProject() { void GUI_Window_OpenProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", ".ERS", ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", nullptr, ".", "", 0); } if (Enabled_) { From a6c99df5491f34d274c39e4bd2677b2a48efd00c Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:30:59 +0000 Subject: [PATCH 26/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp index a5340ebdce..07f61f3916 100644 --- a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp @@ -29,7 +29,7 @@ void GUI_Window_OpenProject::Draw() { if (Enabled_) { // Draw File Dialog - if (ImGuiFileDialog::Instance()->Display("Open Project", ImGuiWindowFlags_None, ImVec2(400, 200))) { + if (ImGuiFileDialog::Instance()->Display("Open Project", ImGuiWindowFlags_None, ImVec2(600, 300))) { if (ImGuiFileDialog::Instance()->IsOk()) From 318d1d6a54e05ec3a15deba86f4e6325af65ec20 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:31:10 +0000 Subject: [PATCH 27/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 857c8212a6..9ec9aeee9a 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -30,7 +30,7 @@ void GUI_Window_NewProject::Draw() { if (Enabled_) { // Draw File Dialog - if (ImGuiFileDialog::Instance()->Display("New Project", ImGuiWindowFlags_None, ImVec2(400, 200))) { + if (ImGuiFileDialog::Instance()->Display("New Project", ImGuiWindowFlags_None, ImVec2(600, 300))) { if (ImGuiFileDialog::Instance()->IsOk()) From caebc0f4beca3b6426c9b0d9b7fcd30c4ec40efb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:35:25 +0000 Subject: [PATCH 28/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 9ec9aeee9a..1259f7e919 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -23,7 +23,7 @@ GUI_Window_NewProject::~GUI_Window_NewProject() { void GUI_Window_NewProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", nullptr, ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("New Project", "New Project", nullptr, "~", "", 0); } @@ -41,7 +41,9 @@ void GUI_Window_NewProject::Draw() { SystemUtils_->Logger_->Log(std::string("Newing Project At Path '") + Path + "'", 5); std::string Command; - + + + #if defined(_WIN32) Command += ""; #elif defined(__APPLE__) From 2ec6cd30f03dea8cdd4f060bdf57fb53e2a5f01d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:35:33 +0000 Subject: [PATCH 29/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp index 07f61f3916..d66847696e 100644 --- a/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_OpenProject/GUI_Window_OpenProject.cpp @@ -23,7 +23,7 @@ GUI_Window_OpenProject::~GUI_Window_OpenProject() { void GUI_Window_OpenProject::Draw() { if (Enabled_ && !LastWindowState_) { - ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", nullptr, ".", "", 0); + ImGuiFileDialog::Instance()->OpenDialog("Open Project", "Open Project", nullptr, "~", "", 0); } if (Enabled_) { From 80b1a970de6abba31b1bd3df2f983584ecf09b95 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:37:06 +0000 Subject: [PATCH 30/60] Implement Option To Create New Project (#271) --- .../GUI_Window_NewProject/GUI_Window_NewProject.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 1259f7e919..576c2c75e3 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -38,12 +38,13 @@ void GUI_Window_NewProject::Draw() { std::string Path = ImGuiFileDialog::Instance()->GetCurrentPath(); Path += "/"; - SystemUtils_->Logger_->Log(std::string("Newing Project At Path '") + Path + "'", 5); - - std::string Command; - + SystemUtils_->Logger_->Log(std::string("Creating New Project In Target Directory '") + Path + "'", 5); + + // Create New Files + + std::string Command; #if defined(_WIN32) Command += ""; #elif defined(__APPLE__) @@ -56,7 +57,7 @@ void GUI_Window_NewProject::Draw() { std::system(Command.c_str()); // Quit System - SystemUtils_->Logger_->Log("Shutting Down This Editor Window Now", 5); + SystemUtils_->Logger_->Log("Shutting Down This Editor Window Now, Launching Editor For That Project", 5); *SystemUtils_->SystemShouldRun_ = false; From 0336c63efd285daccda06fb3e306bb51ab7afe42 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:38:01 +0000 Subject: [PATCH 31/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 576c2c75e3..a92a040b6b 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -41,8 +41,6 @@ void GUI_Window_NewProject::Draw() { SystemUtils_->Logger_->Log(std::string("Creating New Project In Target Directory '") + Path + "'", 5); - // Create New Files - std::string Command; #if defined(_WIN32) From 13ad52d79bb58bdb412c501b1c21ae751ed839b8 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:43:22 +0000 Subject: [PATCH 32/60] Implement Option To Create New Project (#271) --- Source/EditorAssets/Projects/NewProject/0.ERS | 216 ++++++++ Source/EditorAssets/Projects/NewProject/1.ERS | 56 +++ .../Projects/NewProject/10000.ERS | 37 ++ .../Projects/NewProject/10001.ERS | 49 ++ .../Projects/NewProject/10002.ERS | 26 + .../Projects/NewProject/10003.ERS | 36 ++ .../Projects/NewProject/10004.ERS | 26 + .../Projects/NewProject/10005.ERS | 36 ++ .../Projects/NewProject/10006.ERS | 26 + .../Projects/NewProject/10007.ERS | 36 ++ .../Projects/NewProject/10008.ERS | 26 + .../Projects/NewProject/10009.ERS | 35 ++ .../Projects/NewProject/10010.ERS | 27 + .../Projects/NewProject/10011.ERS | 38 ++ .../Projects/NewProject/10012.ERS | 27 + .../Projects/NewProject/10013.ERS | 38 ++ .../Projects/NewProject/10014.ERS | 27 + .../Projects/NewProject/10015.ERS | 38 ++ .../Projects/NewProject/10016.ERS | 27 + .../Projects/NewProject/10017.ERS | 38 ++ .../Projects/NewProject/10018.ERS | 27 + .../Projects/NewProject/10019.ERS | 38 ++ .../Projects/NewProject/10020.ERS | 27 + .../Projects/NewProject/10021.ERS | 38 ++ .../Projects/NewProject/10022.ERS | 27 + .../Projects/NewProject/10023.ERS | 38 ++ .../Projects/NewProject/10024.ERS | 27 + .../Projects/NewProject/10025.ERS | 38 ++ .../Projects/NewProject/10026.ERS | 27 + .../Projects/NewProject/10027.ERS | 38 ++ .../Projects/NewProject/10028.ERS | 27 + .../Projects/NewProject/10029.ERS | 38 ++ .../Projects/NewProject/10030.ERS | 27 + .../Projects/NewProject/10031.ERS | 38 ++ .../Projects/NewProject/10032.ERS | 27 + .../Projects/NewProject/10033.ERS | 38 ++ .../Projects/NewProject/10034.ERS | 27 + .../Projects/NewProject/10035.ERS | 38 ++ .../Projects/NewProject/10038.ERS | 50 ++ .../Projects/NewProject/10039.ERS | 25 + .../Projects/NewProject/10040.ERS | 86 ++++ .../Projects/NewProject/10041.ERS | 464 ++++++++++++++++++ 42 files changed, 2075 insertions(+) create mode 100644 Source/EditorAssets/Projects/NewProject/0.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/1.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10000.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10001.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10002.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10003.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10004.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10005.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10006.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10007.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10008.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10009.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10010.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10011.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10012.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10013.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10014.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10015.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10016.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10017.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10018.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10019.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10020.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10021.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10022.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10023.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10024.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10025.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10026.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10027.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10028.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10029.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10030.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10031.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10032.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10033.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10034.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10035.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10038.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10039.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10040.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10041.ERS diff --git a/Source/EditorAssets/Projects/NewProject/0.ERS b/Source/EditorAssets/Projects/NewProject/0.ERS new file mode 100644 index 0000000000..ec7e4d770d --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/0.ERS @@ -0,0 +1,216 @@ +0: + AssetType: Metadata + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +1: + AssetType: Undefined + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-04-03-02-53-58 +2: + AssetType: Placeholder + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +3: + AssetType: Undefined + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-04-03-02-53-59 +4: + AssetType: Mesh + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +5: + AssetType: Image + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +6: + AssetType: Image + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +7: + AssetType: Image + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +8: + AssetType: Image + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +9: + AssetType: Image + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +10: + AssetType: Model + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +11: + AssetType: Controller Settings + AssetCreationDate: 1970-01-01-00-00-00 + AssetModificationDate: 2022-01-01-00-00-00 +10000: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10001: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10002: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10003: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10004: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10005: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10006: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10007: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10008: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10009: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10010: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10011: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10012: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10013: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10014: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10015: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10016: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10017: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10018: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10019: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10020: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10021: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10022: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10023: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10024: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10025: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10026: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10027: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10028: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10029: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10030: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10031: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10032: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10033: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10034: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10035: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10036: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10037: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10038: + AssetType: Vertex Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10039: + AssetType: Fragment Shader + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-02-16-23-23-16 +10040: + AssetType: Undefined + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-04-17-01-28-56 +10041: + AssetType: Undefined + AssetCreationDate: 1970-01-01-00-00-01 + AssetModificationDate: 2022-04-17-01-28-56 \ No newline at end of file diff --git a/Source/EditorAssets/Projects/NewProject/1.ERS b/Source/EditorAssets/Projects/NewProject/1.ERS new file mode 100644 index 0000000000..54c27f3d05 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/1.ERS @@ -0,0 +1,56 @@ +ProjectName: Untitled +ProjectDescription: The default project. +ProjectVersion: 1.0.0 +ProjectCreationDate: 0000-00-00 00-00-00 +ProjectModificationDate: 2022-04-03 02-53-58 +ProjectCreator: "" +ProjectLicense: AGPL-V3.0 Or Higher +IsLicenseProprietary: false +SceneIDs: +DefaultScene: 0 +EditorLayouts: + 0: 2 +DefaultLayout: 0 +DefaultShaderProgram: 9 +ShaderPrograms: + 0: + Name: _Grid + VertexID: 10000 + FragmentID: 10001 + 1: + Name: _LightIcon + VertexID: 10038 + FragmentID: 10039 + 2: + Name: Ambient Occlusion Texture Map + VertexID: 10004 + FragmentID: 10005 + 3: + Name: Diffuse Texture Map + VertexID: 10008 + FragmentID: 10009 + 4: + Name: Emissive Texture Map + VertexID: 10016 + FragmentID: 10017 + 5: + Name: Height Texture Map + VertexID: 10018 + FragmentID: 10019 + 6: + Name: Metalic Texture Map + VertexID: 10022 + FragmentID: 10023 + 7: + Name: Normals Texture Map + VertexID: 10026 + FragmentID: 10027 + 8: + Name: Shininess Texture Map + VertexID: 10032 + FragmentID: 10033 + 9: + Name: Viewport + VertexID: 10040 + FragmentID: 10041 + diff --git a/Source/EditorAssets/Projects/NewProject/10000.ERS b/Source/EditorAssets/Projects/NewProject/10000.ERS new file mode 100644 index 0000000000..e4cce6ac2e --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10000.ERS @@ -0,0 +1,37 @@ +#version 400 + +layout (location = 0) in vec4 aPos; +layout (location = 2) in vec3 aTexCoords; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +out vec3 UV; +out vec3 OriginalPosition; + + +void main() +{ + gl_Position = projection * view * model * aPos; + + UV = aTexCoords; + OriginalPosition = vec3(aPos.xyz); +} + + + + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10001.ERS b/Source/EditorAssets/Projects/NewProject/10001.ERS new file mode 100644 index 0000000000..bd01fda26d --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10001.ERS @@ -0,0 +1,49 @@ +#version 400 + +// Set IO +out vec4 FragColor; +in vec3 UV; +in vec3 OriginalPosition; + +// Get Configuration Params +uniform vec3 CameraPosition; +uniform vec3 GRID_COLOR_BASE; +uniform vec3 GRID_COLOR_X; +uniform vec3 GRID_COLOR_Z; +uniform float GRID_SIZE; +uniform float GRID_LINE_THICKNESS; +uniform float GRID_SCALE; + + + +void main(void) +{ + + if(fract(UV.x / GRID_SIZE) < GRID_LINE_THICKNESS || fract(UV.y / GRID_SIZE) < GRID_LINE_THICKNESS) { + + // Check If X Or Y Axis Line, Set Color + vec3 LineColor; + float ScaledThickness = GRID_LINE_THICKNESS * GRID_SIZE; + if (abs(OriginalPosition[0] + ScaledThickness) < ScaledThickness) { + LineColor = GRID_COLOR_Z; + } else if (abs(OriginalPosition[1] + ScaledThickness) < ScaledThickness) { + LineColor = GRID_COLOR_X; + } else { + LineColor = GRID_COLOR_BASE; + } + + // Calculate Opacity Based On Distance From Camera + vec3 CameraLocation2D = vec3(CameraPosition[0], CameraPosition[2], CameraPosition[1]/4.0f); + float Distance = distance(CameraLocation2D, GRID_SCALE*OriginalPosition); + float Alpha = 75.0f/pow(Distance, 3); + + // Draw Pixel + if (Alpha > 0.0001f) { + FragColor = vec4(LineColor, Alpha); + } + + } else { + FragColor = vec4(0.0f); + } +} + diff --git a/Source/EditorAssets/Projects/NewProject/10002.ERS b/Source/EditorAssets/Projects/NewProject/10002.ERS new file mode 100644 index 0000000000..21680739e5 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10002.ERS @@ -0,0 +1,26 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/Source/EditorAssets/Projects/NewProject/10003.ERS b/Source/EditorAssets/Projects/NewProject/10003.ERS new file mode 100644 index 0000000000..4a4c006533 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10003.ERS @@ -0,0 +1,36 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_ambient1, TexCoords); +} diff --git a/Source/EditorAssets/Projects/NewProject/10004.ERS b/Source/EditorAssets/Projects/NewProject/10004.ERS new file mode 100644 index 0000000000..21680739e5 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10004.ERS @@ -0,0 +1,26 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/Source/EditorAssets/Projects/NewProject/10005.ERS b/Source/EditorAssets/Projects/NewProject/10005.ERS new file mode 100644 index 0000000000..190d4c2e2d --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10005.ERS @@ -0,0 +1,36 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_ambient_occlusion1, TexCoords); +} diff --git a/Source/EditorAssets/Projects/NewProject/10006.ERS b/Source/EditorAssets/Projects/NewProject/10006.ERS new file mode 100644 index 0000000000..21680739e5 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10006.ERS @@ -0,0 +1,26 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/Source/EditorAssets/Projects/NewProject/10007.ERS b/Source/EditorAssets/Projects/NewProject/10007.ERS new file mode 100644 index 0000000000..12e51422ba --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10007.ERS @@ -0,0 +1,36 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_base_color1, TexCoords); +} diff --git a/Source/EditorAssets/Projects/NewProject/10008.ERS b/Source/EditorAssets/Projects/NewProject/10008.ERS new file mode 100644 index 0000000000..21680739e5 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10008.ERS @@ -0,0 +1,26 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/Source/EditorAssets/Projects/NewProject/10009.ERS b/Source/EditorAssets/Projects/NewProject/10009.ERS new file mode 100644 index 0000000000..1ba6fb99be --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10009.ERS @@ -0,0 +1,35 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_diffuse1, TexCoords); +} diff --git a/Source/EditorAssets/Projects/NewProject/10010.ERS b/Source/EditorAssets/Projects/NewProject/10010.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10010.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10011.ERS b/Source/EditorAssets/Projects/NewProject/10011.ERS new file mode 100644 index 0000000000..88c573de27 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10011.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_diffuse_roughness1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10012.ERS b/Source/EditorAssets/Projects/NewProject/10012.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10012.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10013.ERS b/Source/EditorAssets/Projects/NewProject/10013.ERS new file mode 100644 index 0000000000..df7a189cdc --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10013.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_displacement1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10014.ERS b/Source/EditorAssets/Projects/NewProject/10014.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10014.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10015.ERS b/Source/EditorAssets/Projects/NewProject/10015.ERS new file mode 100644 index 0000000000..14a708d442 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10015.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_emission_color1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10016.ERS b/Source/EditorAssets/Projects/NewProject/10016.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10016.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10017.ERS b/Source/EditorAssets/Projects/NewProject/10017.ERS new file mode 100644 index 0000000000..e531bfbd11 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10017.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_emissive1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10018.ERS b/Source/EditorAssets/Projects/NewProject/10018.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10018.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10019.ERS b/Source/EditorAssets/Projects/NewProject/10019.ERS new file mode 100644 index 0000000000..7e0674f47f --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10019.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_height1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10020.ERS b/Source/EditorAssets/Projects/NewProject/10020.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10020.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10021.ERS b/Source/EditorAssets/Projects/NewProject/10021.ERS new file mode 100644 index 0000000000..150353560c --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10021.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_lightmap1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10022.ERS b/Source/EditorAssets/Projects/NewProject/10022.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10022.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10023.ERS b/Source/EditorAssets/Projects/NewProject/10023.ERS new file mode 100644 index 0000000000..4e06d4a571 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10023.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_metalness1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10024.ERS b/Source/EditorAssets/Projects/NewProject/10024.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10024.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10025.ERS b/Source/EditorAssets/Projects/NewProject/10025.ERS new file mode 100644 index 0000000000..8d5eb1e5a1 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10025.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_normal_camera1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10026.ERS b/Source/EditorAssets/Projects/NewProject/10026.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10026.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10027.ERS b/Source/EditorAssets/Projects/NewProject/10027.ERS new file mode 100644 index 0000000000..740ffc6dbd --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10027.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_normals1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10028.ERS b/Source/EditorAssets/Projects/NewProject/10028.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10028.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10029.ERS b/Source/EditorAssets/Projects/NewProject/10029.ERS new file mode 100644 index 0000000000..7626b94cde --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10029.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_opacity1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10030.ERS b/Source/EditorAssets/Projects/NewProject/10030.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10030.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10031.ERS b/Source/EditorAssets/Projects/NewProject/10031.ERS new file mode 100644 index 0000000000..490f46962c --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10031.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_reflection1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10032.ERS b/Source/EditorAssets/Projects/NewProject/10032.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10032.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10033.ERS b/Source/EditorAssets/Projects/NewProject/10033.ERS new file mode 100644 index 0000000000..310c8a0dc8 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10033.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_shininess1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10034.ERS b/Source/EditorAssets/Projects/NewProject/10034.ERS new file mode 100644 index 0000000000..8b1244da41 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10034.ERS @@ -0,0 +1,27 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + + +// Set Model Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10035.ERS b/Source/EditorAssets/Projects/NewProject/10035.ERS new file mode 100644 index 0000000000..4747929d75 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10035.ERS @@ -0,0 +1,38 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +// Get Texture Sampler And Lighting Info +uniform sampler2D texture_ambient1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2D texture_base_color1; +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_diffuse_roughness1; +uniform sampler2D texture_displacement1; +uniform sampler2D texture_emission_color1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_height1; +uniform sampler2D texture_lightmap1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_normal_camera1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_opacity1; +uniform sampler2D texture_reflection1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_specular1; + + + +// Get Input Vars +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + + +void main() +{ + FragColor = texture(texture_specular1, TexCoords); +} + diff --git a/Source/EditorAssets/Projects/NewProject/10038.ERS b/Source/EditorAssets/Projects/NewProject/10038.ERS new file mode 100644 index 0000000000..48860e51a5 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10038.ERS @@ -0,0 +1,50 @@ +#version 400 + +layout (location = 0) in vec4 aPos; +layout (location = 2) in vec3 aTexCoords; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; +uniform vec3 BillboardPosition; +uniform float BillboardSize; + +out vec3 UV; +out vec3 OriginalPosition; + + +void main() +{ + + vec3 CameraRight = vec3(view[0][0], view[1][0], view[2][0]); + vec3 CameraUp = vec3(view[0][1], view[1][1], view[2][1]); + + vec3 VP = BillboardPosition + + CameraRight * aPos.x * BillboardSize + + CameraUp * aPos.y * BillboardSize; + + gl_Position = projection * view * vec4(VP, 1.0f); + + UV = aTexCoords; + OriginalPosition = vec3(aPos.xyz); +} + + + + + + + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10039.ERS b/Source/EditorAssets/Projects/NewProject/10039.ERS new file mode 100644 index 0000000000..8b040acba1 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10039.ERS @@ -0,0 +1,25 @@ +#version 400 + +// Set IO +out vec4 FragColor; +in vec3 UV; +in vec3 OriginalPosition; + +// Get Configuration Params +uniform sampler2D IconTexture; +uniform vec3 CameraPosition; + + + + +void main(void) +{ + + + FragColor = texture(IconTexture, vec2(UV)); + +} + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10040.ERS b/Source/EditorAssets/Projects/NewProject/10040.ERS new file mode 100644 index 0000000000..c9a828ea14 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10040.ERS @@ -0,0 +1,86 @@ +#version 330 core + +// Set Inputs +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; +layout (location = 3) in vec3 aTangent; +layout (location = 4) in vec3 aBitangent; + +// Set Outputs +out VS_OUT { + vec3 FragPos; + vec2 TexCoords; + mat3 TBN; + vec3 WorldPos; + vec3 TangentViewPos; + vec3 TangentFragPos; + vec3 Normal; // Used when no normal map is available; +} Object; + + + +// Get Metadata Params +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + +// Get Mesh Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Camera Info +uniform vec3 CameraPosition; + +// Get Normal Info +uniform bool HasNormals; + +void main() +{ + Object.FragPos = vec3(model * vec4(aPos, 1.0)); + Object.TexCoords = aTexCoords; + + mat3 NormalMatrix = transpose(inverse(mat3(model))); + vec3 T = normalize(NormalMatrix * aTangent); + vec3 N = normalize(NormalMatrix * aNormal); + T = normalize(T - dot(T, N) * N); + vec3 B = cross(N, T); + + mat3 TBN = transpose(mat3(T, B, N)); + Object.TBN = TBN; + Object.TangentViewPos = TBN * CameraPosition; + Object.TangentFragPos = TBN * Object.FragPos; + Object.Normal = mat3(model) * aNormal; // mat3(transpose(inverse(model))) * aNormal; + Object.WorldPos = vec3(model*vec4(aPos, 1.0f)); + + gl_Position = projection * view * vec4(Object.WorldPos, 1.0f); + +} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10041.ERS b/Source/EditorAssets/Projects/NewProject/10041.ERS new file mode 100644 index 0000000000..1f5739ee00 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10041.ERS @@ -0,0 +1,464 @@ +#version 330 core + +// Set Outputs +out vec4 FragColor; + +// Set Inputs +in VS_OUT { + vec3 FragPos; + vec2 TexCoords; + mat3 TBN; + vec3 WorldPos; + vec3 TangentViewPos; + vec3 TangentFragPos; + vec3 Normal; // Used when normal texture not present +} Object; + + + + +// Define Structs +struct STRUCT_DirectionalLight { + + vec3 Direction; + + // Light Color Parameters + vec3 Color; + float Intensity; + +}; + +struct STRUCT_PointLight { + + // Physical Parameters + vec3 Position; + + // Light Color Parameters + vec3 Color; + + // Light Rolloff Parameters + float Intensity; +}; + +struct STRUCT_SpotLight { + + // Physical Parameters + vec3 Position; + vec3 Direction; + + // Light Color Parameters + vec3 Color; + + // Light Rolloff Parameters + float Intensity; + + // Spotlight Parameters + float CutOff; + float OuterCutOff; + +}; + +struct STRUCT_SampledData { + + vec4 Albedo; + vec3 Normal; + vec3 Emissive; + float Metallic; + float Roughness; + float AO; + +}; + + + + + +// Get Metadata Params +uniform int FrameNumber; // Number of the frame, counts up from zero + +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame + +uniform vec2 ViewportRes; // XY Resolution of the viewport +uniform vec3 CameraPosition; // Get Camera XYZ Position + + + +// Get Texture Info +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_shininess1; +uniform sampler2D texture_emissive1; +uniform sampler2D texture_metalness1; +uniform sampler2D texture_ambientocclusion1; + + + +uniform bool HasAmbient; +uniform bool HasAmbientOcclusion; +uniform bool HasBaseColor; +uniform bool HasDiffuse; +uniform bool HasDiffuseRoughness; +uniform bool HasDisplacement; +uniform bool HasEmissionColor; +uniform bool HasEmissive; +uniform bool HasHeight; +uniform bool HasLightmap; +uniform bool HasMetalness; +uniform bool HasNormalCamera; +uniform bool HasNormals; +uniform bool HasOpacity; +uniform bool HasReflection; +uniform bool HasShininess; +uniform bool HasSpecular; + + +// Get Lighting Info +uniform int NumberDirectionalLights; +uniform int NumberPointLights; +uniform int NumberSpotLights; +uniform STRUCT_DirectionalLight DirectionalLights[1]; +uniform STRUCT_PointLight PointLights[128]; +uniform STRUCT_SpotLight SpotLights[96]; + + +// Gamma Correction Info +uniform bool GammaCorrectionEnabled_; +uniform bool HDREnabled_; +uniform float Exposure_; +uniform float Gamma_; + +const float PI = 3.14159265358979; + +vec3 GetNormalFromMap(sampler2D Normal) { + + // Ensure That Textures Are Present/Valid, If Not, Provide Fallback + vec3 SampledColor = texture(Normal, Object.TexCoords).xyz; + if (!HasNormals || (SampledColor == vec3(0.0f))) { + SampledColor = vec3(0.5f, 0.5f, 1.0f); + } + + // Use Texture Data To Calculate Normal Data + vec3 TangentNormal = SampledColor * 2.0f - 1.0f; + + vec3 Q1 = dFdx(Object.WorldPos); + vec3 Q2 = dFdy(Object.WorldPos); + vec2 st1 = dFdx(Object.TexCoords); + vec2 st2 = dFdy(Object.TexCoords); + + vec3 N = normalize(Object.Normal); + vec3 T = normalize(Q1*st2.t - Q2*st1.t); + vec3 B = -normalize(cross(N, T)); + mat3 TBN = mat3(T,B,N); + + return normalize(TBN * TangentNormal); +} + + +float DistributionGGX(vec3 N, vec3 H, float Roughness) { + + float a = Roughness*Roughness; + float a2 = a*a; + float NdotH = max(dot(N,H), 0.0f); + float NdotH2 = NdotH*NdotH; + + float nom = a2; + float denom = (NdotH2 * (a2 - 1.0f) + 1.0f); + + return nom / denom; + +} +// ---------------------------------------------------------------------------- +float GeometrySchlickGGX(float NdotV, float roughness) +{ + float r = (roughness + 1.0); + float k = (r*r) / 8.0; + + float nom = NdotV; + float denom = NdotV * (1.0 - k) + k; + + return nom / denom; +} +// ---------------------------------------------------------------------------- +float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness) +{ + float NdotV = max(dot(N, V), 0.0); + float NdotL = max(dot(N, L), 0.0); + float ggx2 = GeometrySchlickGGX(NdotV, roughness); + float ggx1 = GeometrySchlickGGX(NdotL, roughness); + + return ggx1 * ggx2; +} +// ---------------------------------------------------------------------------- +vec3 FresnelSchlick(float cosTheta, vec3 F0) +{ + return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0); +} +// ---------------------------------------------------------------------------- + + + + + + +// Used To Enable Gamma Correction On The Output +vec4 GammaCorrectResult(vec4 Input, bool GammaEnabled) { + if (GammaEnabled) { + Input.rgb = pow(Input.rgb, vec3(1.0/Gamma_)); + } + return Input; +} + + +// Used To Make Sure Textures Aren't Too Bright +vec4 GammaCorrectTexture(sampler2D Texture, bool GammaEnabled) { + vec4 Color = texture(Texture, Object.TexCoords); + if (GammaEnabled) { + Color.rgb = pow(Color.rgb, vec3(Gamma_)); + } + return Color; +} + + + + +STRUCT_SampledData SetSampledData() { + STRUCT_SampledData SampledData; + + // Handle Albedo/Diffuse Textures + SampledData.Albedo = GammaCorrectTexture(texture_diffuse1, GammaCorrectionEnabled_); + + // Handle Metalness Textures + if (HasMetalness) { + SampledData.Metallic = texture(texture_metalness1, Object.TexCoords).r; + } else { + SampledData.Metallic = 0.0f; + } + + // Handle Normal Textures + if (HasNormals) { + SampledData.Normal = GetNormalFromMap(texture_normals1); + } else { + SampledData.Normal = vec3(0.5f, 0.5f, 1.0f); + } + + // Handle Shininess (Inverse Of Roughness) + if (HasShininess) { + SampledData.Roughness = texture(texture_shininess1, Object.TexCoords).r; + + } else { + SampledData.Roughness = 0.5f; + } + + // Handle Emissive Textures + if (HasEmissive) { + SampledData.Emissive = GammaCorrectTexture(texture_emissive1, GammaCorrectionEnabled_).rgb; + } else { + SampledData.Emissive = vec3(0.0f); + } + + + return SampledData; + +} + + + +vec3 PBRPointLight(STRUCT_PointLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT_SampledData Model) { + + // calculate per-light radiance + vec3 L = normalize(Light.Position - Object.WorldPos); + vec3 H = normalize(ViewDir + L); + float distance = length(Light.Position - Object.WorldPos); + float attenuation = 1.0 / (distance * distance); + vec3 radiance = Light.Color * Light.Intensity * attenuation; + + // Cook-Torrance BRDF + float NDF = DistributionGGX(Model.Normal, H, Model.Roughness); + float G = GeometrySmith(Model.Normal, ViewDir, L, Model.Roughness); + vec3 F = FresnelSchlick(max(dot(H, ViewDir), 0.0), Reflectance); + + vec3 numerator = NDF * G * F; + float denominator = 4.0 * max(dot(Model.Normal, ViewDir), 0.0) * max(dot(Model.Normal, L), 0.0) + 0.0001; // + 0.0001 to prevent divide by zero + vec3 specular = numerator / denominator; + + // kS is equal to Fresnel + vec3 kS = F; + // for energy conservation, the diffuse and specular light can't + // be above 1.0 (unless the surface emits light); to preserve this + // relationship the diffuse component (kD) should equal 1.0 - kS. + vec3 kD = vec3(1.0) - kS; + // multiply kD by the inverse metalness such that only non-metals + // have diffuse lighting, or a linear blend if partly metal (pure metals + // have no diffuse light). + kD *= 1.0 - Model.Metallic; + + // scale light by NdotL + float NdotL = max(dot(Model.Normal, L), 0.0); + + // add to outgoing radiance Lo + return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + + +} + + +vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT_SampledData Model) { + + vec3 LightDirectionVector ; + if (HasNormals) { + LightDirectionVector = normalize(Object.TBN * Light.Position - Object.TangentFragPos); + } else { + LightDirectionVector = normalize(Light.Position - Object.FragPos); + } + vec3 ReflectionDirectionVector = reflect(-LightDirectionVector, Object.Normal); + + // Calculate Spot Intensity + float Theta = dot(normalize(Light.Position - Object.FragPos), normalize(-Light.Direction)); + float Epsilon = Light.CutOff - Light.OuterCutOff; + float Intensity = clamp((Theta - Light.OuterCutOff) / Epsilon, 0.0f, 1.0f); + + if (GammaCorrectionEnabled_) { + Intensity = pow(Intensity, Gamma_*Gamma_); + } + + // calculate per-light radiance + vec3 L = normalize(Light.Position - Object.WorldPos); + vec3 H = normalize(ViewDir + L); + float distance = length(Light.Position - Object.WorldPos); + float attenuation = 1.0 / (distance * distance); + vec3 radiance = Light.Color * Light.Intensity * attenuation; + + // Cook-Torrance BRDF + float NDF = DistributionGGX(Model.Normal, H, Model.Roughness); + float G = GeometrySmith(Model.Normal, ViewDir, L, Model.Roughness); + vec3 F = FresnelSchlick(max(dot(H, ViewDir), 0.0), Reflectance); + + vec3 numerator = NDF * G * F; + float denominator = 4.0 * max(dot(Model.Normal, ViewDir), 0.0) * max(dot(Model.Normal, L), 0.0) + 0.0001; // + 0.0001 to prevent divide by zero + vec3 specular = numerator / denominator; + + // kS is equal to Fresnel + vec3 kS = F; + // for energy conservation, the diffuse and specular light can't + // be above 1.0 (unless the surface emits light); to preserve this + // relationship the diffuse component (kD) should equal 1.0 - kS. + vec3 kD = vec3(1.0) - kS; + // multiply kD by the inverse metalness such that only non-metals + // have diffuse lighting, or a linear blend if partly metal (pure metals + // have no diffuse light). + kD *= 1.0 - Model.Metallic; + + // scale light by NdotL + float NdotL = max(dot(Model.Normal, L), 0.0); + + // add to outgoing radiance Lo + return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL * Intensity; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + +} + + +vec3 PBRDirectionalLight(STRUCT_DirectionalLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT_SampledData Model) { + + vec3 LightDirectionVector = normalize(-Light.Direction); + vec3 ReflectionDirectionVector = reflect(-LightDirectionVector, Model.Normal); + + // Diffuse/Specular Components + float Diffuse = max(dot(Model.Normal, LightDirectionVector), 0.0f); + float Specular = pow(max(dot(ViewDir, ReflectionDirectionVector), 0.0f), Model.Roughness); + + // calculate per-light radiance + vec3 L = normalize(Light.Direction); + vec3 H = normalize(ViewDir + L); + vec3 radiance = Light.Color * Light.Intensity; + + // Cook-Torrance BRDF + float NDF = DistributionGGX(Model.Normal, H, Model.Roughness); + float G = GeometrySmith(Model.Normal, ViewDir, L, Model.Roughness); + vec3 F = FresnelSchlick(max(dot(H, ViewDir), 0.0), Reflectance); + + vec3 numerator = NDF * G * F; + float denominator = 4.0 * max(dot(Model.Normal, ViewDir), 0.0) * max(dot(Model.Normal, L), 0.0) + 0.0001; // + 0.0001 to prevent divide by zero + vec3 specular = numerator / denominator; + + // kS is equal to Fresnel + vec3 kS = F; + // for energy conservation, the diffuse and specular light can't + // be above 1.0 (unless the surface emits light); to preserve this + // relationship the diffuse component (kD) should equal 1.0 - kS. + vec3 kD = vec3(1.0) - kS; + // multiply kD by the inverse metalness such that only non-metals + // have diffuse lighting, or a linear blend if partly metal (pure metals + // have no diffuse light). + kD *= 1.0 - Model.Metallic; + + // scale light by NdotL + float NdotL = max(dot(Model.Normal, L), 0.0); + + // add to outgoing radiance Lo + return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + + +} + + +void main() { + + // Get Model Parameters + STRUCT_SampledData Model = SetSampledData(); + vec3 ViewDir = normalize(CameraPosition - Object.WorldPos); + + // calculate reflectance at normal incidence; if dia-electric (like plastic) use F0 + // of 0.04 and if it's a metal, use the albedo color as F0 (metallic workflow) + vec3 Reflectance = vec3(0.04); + Reflectance = mix(Reflectance, Model.Albedo.rgb, Model.Metallic); + + + // ---- Calculate Lighting Contributions ---- // + vec4 Lo = vec4(0.0f); + + // Calculate Directional Lights + for (int i = 0; i < NumberDirectionalLights; i++) { + Lo += vec4(PBRDirectionalLight(DirectionalLights[i], ViewDir, Reflectance, Model), 1.0f); + } + + // Calculate Point Lights + for (int i = 0; i < NumberPointLights; i++) { + Lo += vec4(PBRPointLight(PointLights[i], ViewDir, Reflectance, Model), 1.0f); + } + + // Calculate Spot Lights + for(int i = 0; i < NumberSpotLights; ++i) { + Lo += vec4(PBRSpotLight(SpotLights[i], ViewDir, Reflectance, Model), 1.0f); + } + + // ambient lighting (note that the next IBL tutorial will replace + // this ambient lighting with environment lighting). + vec4 Ambient = vec4(0.03) * Model.Albedo * Model.AO; + vec4 Color = Ambient + Lo; + + + // Add Emissive Texture + if (HasEmissive) { + Color.rgb += Model.Emissive; + } + + // Apply Gamma Correction + if (HDREnabled_) { + vec3 Mapped = vec3(1.0f) - exp(-Color.xyz * Exposure_); + FragColor = GammaCorrectResult(vec4(Mapped, 1.0f), GammaCorrectionEnabled_); + } else { + FragColor = GammaCorrectResult(Color, GammaCorrectionEnabled_); + } +} + + + + + + + + + + + From d16cad9ef245731c6bbc0c93592520103cb03f8d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:44:07 +0000 Subject: [PATCH 33/60] Implement Option To Create New Project (#271) --- .../Projects/NewProject/10036.ERS | 74 +++ .../Projects/NewProject/10037.ERS | 345 +++++++++++++ .../Projects/NewProject/10040.ERS | 19 +- .../Projects/NewProject/10041.ERS | 485 ++++++++++++++++-- .../Projects/NewProject/10042.ERS | 10 + .../Projects/NewProject/10043.ERS | 6 + .../Projects/NewProject/10044.ERS | 36 ++ .../Projects/NewProject/10045.ERS | 55 ++ .../Projects/NewProject/10046.ERS | 62 +++ 9 files changed, 1040 insertions(+), 52 deletions(-) create mode 100644 Source/EditorAssets/Projects/NewProject/10036.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10037.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10042.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10043.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10044.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10045.ERS create mode 100644 Source/EditorAssets/Projects/NewProject/10046.ERS diff --git a/Source/EditorAssets/Projects/NewProject/10036.ERS b/Source/EditorAssets/Projects/NewProject/10036.ERS new file mode 100644 index 0000000000..00a043f3cb --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10036.ERS @@ -0,0 +1,74 @@ +#version 330 core + +// Set Inputs +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; +layout (location = 3) in vec3 aTangent; +layout (location = 4) in vec3 aBitangent; + +// Set Outputs +out VS_OUT { + vec3 FragPos; + vec2 TexCoords; + mat3 TBN; + vec3 TangentViewPos; + vec3 TangentFragPos; + vec3 Normal; // Used when no normal map is available; +} Object; + + + +// Get Metadata Params +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame +uniform int FrameNumber; // Number of the frame, counts up from zero +uniform vec2 ViewportRes; // XY Resolution of the viewport + +// Get Mesh Info +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +// Get Camera Info +uniform vec3 CameraPosition; + +// Get Normal Info +uniform bool HasNormals; + +void main() +{ + Object.FragPos = vec3(model * vec4(aPos, 1.0)); + Object.TexCoords = aTexCoords; + + mat3 NormalMatrix = transpose(inverse(mat3(model))); + vec3 T = normalize(NormalMatrix * aTangent); + vec3 N = normalize(NormalMatrix * aNormal); + T = normalize(T - dot(T, N) * N); + vec3 B = cross(N, T); + + mat3 TBN = transpose(mat3(T, B, N)); + Object.TBN = TBN; + Object.TangentViewPos = TBN * CameraPosition; + Object.TangentFragPos = TBN * Object.FragPos; + Object.Normal = mat3(transpose(inverse(model))) * aNormal; + + gl_Position = projection * view * model * vec4(aPos, 1.0f); + +} + + + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10037.ERS b/Source/EditorAssets/Projects/NewProject/10037.ERS new file mode 100644 index 0000000000..77659be4d1 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10037.ERS @@ -0,0 +1,345 @@ +#version 330 core + +// Set Outputs +out vec4 FragColor; + +// Set Inputs +in VS_OUT { + vec3 FragPos; + vec2 TexCoords; + mat3 TBN; + vec3 TangentViewPos; + vec3 TangentFragPos; + vec3 Normal; // Used when normal texture not present +} Object; + + + + +// Define Structs +struct STRUCT_DirectionalLight { + + vec3 Direction; + + // Light Color Parameters + vec3 Ambient; + vec3 Diffuse; + vec3 Specular; + +}; + +struct STRUCT_PointLight { + + // Physical Parameters + vec3 Position; + + // Light Color Parameters + vec3 Ambient; + vec3 Diffuse; + vec3 Specular; + + // Light Rolloff Parameters + float ConstantRolloff; + float LinearRolloff; + float QuadraticRolloff; + +}; + +struct STRUCT_SpotLight { + + // Physical Parameters + vec3 Position; + vec3 Direction; + + // Light Color Parameters + vec3 Ambient; + vec3 Diffuse; + vec3 Specular; + + // Light Rolloff Parameters + float ConstantRolloff; + float LinearRolloff; + float QuadraticRolloff; + + // Spotlight Parameters + float CutOff; + float OuterCutOff; + +}; + +struct STRUCT_SampledData { + + vec4 DiffuseTextureColor; + vec4 SpecularTextureColor; + vec4 NormalTextureColor; + vec4 HeightTextureColor; + vec4 EmissiveTextureColor; + +}; + + + + + +// Get Metadata Params +uniform int FrameNumber; // Number of the frame, counts up from zero + +uniform float Time; // Time since program started in seconds +uniform float FrameTime; // Render Time Of The Frame + +uniform vec2 ViewportRes; // XY Resolution of the viewport +uniform vec3 CameraPosition; // Get Camera XYZ Position + + + +// Get Texture Info +uniform sampler2D texture_diffuse1; +uniform sampler2D texture_specular1; +uniform sampler2D texture_normals1; +uniform sampler2D texture_height1; +uniform sampler2D texture_emissive1; +uniform float Shinyness; + + +uniform bool HasAmbient; +uniform bool HasAmbientOcclusion; +uniform bool HasBaseColor; +uniform bool HasDiffuse; +uniform bool HasDiffuseRoughness; +uniform bool HasDisplacement; +uniform bool HasEmissionColor; +uniform bool HasEmissive; +uniform bool HasHeight; +uniform bool HasLightmap; +uniform bool HasMetalness; +uniform bool HasNormalCamera; +uniform bool HasNormals; +uniform bool HasOpacity; +uniform bool HasReflection; +uniform bool HasShininess; +uniform bool HasSpecular; + + +// Get Lighting Info +uniform int NumberDirectionalLights; +uniform int NumberPointLights; +uniform int NumberSpotLights; +uniform STRUCT_DirectionalLight DirectionalLights[4]; +uniform STRUCT_PointLight PointLights[32]; +uniform STRUCT_SpotLight SpotLights[16]; + + +// Gamma Correction Info +uniform bool GammaCorrectionEnabled_; +float Gamma = 2.2f; + + +// Declare Functions +vec4 CalculateDirectionalLight(STRUCT_DirectionalLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 ViewDirection); +vec4 CalculatePointLight(STRUCT_PointLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 FragPos, vec3 ViewDirection); +vec4 CalculateSpotLight(STRUCT_SpotLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 FragPos, vec3 ViewDirection); + +vec4 GammaCorrectResult(vec4 Input, bool GammaEnabled); +vec4 GammaCorrectTexture(sampler2D Texture, bool GammaEnabled); + +STRUCT_SampledData SetSampledData(); + +void main() +{ + + // Lighting Sanity Check + if ((NumberDirectionalLights == 0) && (NumberPointLights == 0) && (NumberSpotLights == 0)) { + FragColor = vec4(0.8f); + return; + } + + // ---- Extract Texture Vectors, Create SampledData Struct ---- // + STRUCT_SampledData SampledData = SetSampledData(); + + vec3 Norm; + vec3 ViewDirection; + if (HasNormals) { + Norm = texture(texture_normals1, Object.TexCoords).rgb; + Norm = normalize(Norm * 2.0f - 1.0f); + ViewDirection = normalize(Object.TangentViewPos - Object.TangentFragPos); + } else { + Norm = normalize(Object.Normal); + ViewDirection = normalize(CameraPosition - Object.FragPos); + } + + + // ---- Calculate Lighting Contributions ---- // + vec4 Result = vec4(0.0f); + + // Calculate Directional Lights + for (int i = 0; i < NumberDirectionalLights; i++) { + Result += CalculateDirectionalLight(DirectionalLights[i], SampledData, Norm, ViewDirection); + } + + // Calculate Point Lights + for (int i = 0; i < NumberPointLights; i++) { + Result += CalculatePointLight(PointLights[i], SampledData, Norm, Object.FragPos, ViewDirection); + } + + // Calculate Spot Lights + for (int i = 0; i < NumberSpotLights; i++) { + Result += CalculateSpotLight(SpotLights[i], SampledData, Norm, Object.FragPos, ViewDirection); + } + + // Add Emissive Texture + if (HasEmissive) { + Result += SampledData.EmissiveTextureColor; + } + + // Apply Gamma Correction + FragColor = GammaCorrectResult(Result, GammaCorrectionEnabled_); + + +} + + + +STRUCT_SampledData SetSampledData() { + STRUCT_SampledData SampledData; + + SampledData.DiffuseTextureColor = GammaCorrectTexture(texture_diffuse1, GammaCorrectionEnabled_); + + // Handle Specular Textures + if (HasSpecular) { + SampledData.SpecularTextureColor = GammaCorrectTexture(texture_specular1, GammaCorrectionEnabled_); + } else { + SampledData.SpecularTextureColor = SampledData.DiffuseTextureColor; + } + + // Handle Normal Textures + if (HasNormals) { + SampledData.NormalTextureColor = texture(texture_normals1, Object.TexCoords); + } else { + SampledData.NormalTextureColor = vec4(0.0f); + } + + + SampledData.HeightTextureColor = texture(texture_height1, Object.TexCoords); + + // Handle Emissive Textures + if (HasEmissive) { + SampledData.EmissiveTextureColor = GammaCorrectTexture(texture_emissive1, GammaCorrectionEnabled_); + } else { + SampledData.EmissiveTextureColor = vec4(0.0f); + } + + return SampledData; + +} + + +// Used To Enable Gamma Correction On The Output +vec4 GammaCorrectResult(vec4 Input, bool GammaEnabled) { + if (GammaEnabled) { + Input.rgb = pow(Input.rgb, vec3(1.0/Gamma)); + } + return Input; +} + + +// Used To Make Sure Textures Aren't Too Bright +vec4 GammaCorrectTexture(sampler2D Texture, bool GammaEnabled) { + vec4 Color = texture(Texture, Object.TexCoords); + if (GammaEnabled) { + Color.rgb = pow(Color.rgb, vec3(Gamma)); + } + return Color; +} + + +vec4 CalculateDirectionalLight(STRUCT_DirectionalLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 ViewDirection) { + + vec3 LightDirectionVector = normalize(-Light.Direction); + vec3 ReflectionDirectionVector = reflect(-LightDirectionVector, Normal); + + // Diffuse/Specular Components + float Diffuse = max(dot(Normal, LightDirectionVector), 0.0f); + float Specular = pow(max(dot(ViewDirection, ReflectionDirectionVector), 0.0f), Shinyness); + + // Calculate Total Contribution From Components + vec4 AmbientComponent = vec4(Light.Ambient, 1.0f) * SampledData.DiffuseTextureColor; + vec4 DiffuseComponent = vec4(Light.Diffuse, 1.0f) * Diffuse * SampledData.DiffuseTextureColor; + vec4 SpecularComponent = vec4(Light.Specular, 1.0f) * Specular * SampledData.SpecularTextureColor; + + return (AmbientComponent + DiffuseComponent + SpecularComponent); + +} + +vec4 CalculatePointLight(STRUCT_PointLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 FragPos, vec3 ViewDirection) { + + vec3 LightDirectionVector ; + if (HasNormals) { + LightDirectionVector = normalize(Object.TBN * Light.Position - Object.TangentFragPos); + } else { + LightDirectionVector = normalize(Light.Position - FragPos); + } + + vec3 ReflectionDirectionVector = reflect(-LightDirectionVector, Normal); + + // Diffuse/Specular Components + float Diffuse = max(dot(Normal, LightDirectionVector), 0.0f); + float Specular = pow(max(dot(ViewDirection, ReflectionDirectionVector), 0.0f), Shinyness); + + // Attenuate + float Distance = length(Light.Position - FragPos); + float Attenuation = 1.0f / (Light.ConstantRolloff + Light.LinearRolloff * Distance + Light.QuadraticRolloff * (Distance * Diffuse)); + + // Calculate Total Contribution From Components + vec4 AmbientComponent = vec4(Light.Ambient * Attenuation, 1.0f) * SampledData.DiffuseTextureColor; + vec4 DiffuseComponent = vec4(Light.Diffuse * Attenuation, 1.0f) * Diffuse * SampledData.DiffuseTextureColor; + vec4 SpecularComponent = vec4(Light.Specular * Attenuation, 1.0f) * Specular * SampledData.SpecularTextureColor; + + return (AmbientComponent + DiffuseComponent + SpecularComponent); + +} + +vec4 CalculateSpotLight(STRUCT_SpotLight Light, STRUCT_SampledData SampledData, vec3 Normal, vec3 FragPos, vec3 ViewDirection) { + + vec3 LightDirectionVector ; + if (HasNormals) { + LightDirectionVector = normalize(Object.TBN * Light.Position - Object.TangentFragPos); + } else { + LightDirectionVector = normalize(Light.Position - FragPos); + } + vec3 ReflectionDirectionVector = reflect(-LightDirectionVector, Normal); + + // Diffuse/Specular Components + float Diffuse = max(dot(Normal, LightDirectionVector), 0.0f); + float Specular = pow(max(dot(ViewDirection, ReflectionDirectionVector), 0.0f), Shinyness); + + // Calculate Attenuation + float Distance = length(Light.Position - FragPos); + float Attenuation = 1.0f / (Light.ConstantRolloff + Light.LinearRolloff * Distance + Light.QuadraticRolloff * (Distance * Diffuse)); + + // Calculate Spot Intensity + float Theta = dot(normalize(Light.Position - FragPos), normalize(-Light.Direction)); + float Epsilon = Light.CutOff - Light.OuterCutOff; + float Intensity = clamp((Theta - Light.OuterCutOff) / Epsilon, 0.0f, 1.0f); + + // Calculate Total Contribution From Components + vec4 AmbientComponent = vec4(Light.Ambient * Attenuation * Intensity, 1.0f) * SampledData.DiffuseTextureColor; + vec4 DiffuseComponent = vec4(Light.Diffuse * Attenuation * Intensity, 1.0f) * Diffuse * SampledData.DiffuseTextureColor; + vec4 SpecularComponent = vec4(Light.Specular * Attenuation * Intensity, 1.0f) * Specular * SampledData.SpecularTextureColor; + + return (AmbientComponent + DiffuseComponent + SpecularComponent); + +} + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10040.ERS b/Source/EditorAssets/Projects/NewProject/10040.ERS index c9a828ea14..a7604b2c1f 100644 --- a/Source/EditorAssets/Projects/NewProject/10040.ERS +++ b/Source/EditorAssets/Projects/NewProject/10040.ERS @@ -16,6 +16,8 @@ out VS_OUT { vec3 TangentViewPos; vec3 TangentFragPos; vec3 Normal; // Used when no normal map is available; + + //vec4 FragPosLightSpace; } Object; @@ -31,6 +33,8 @@ uniform mat4 model; uniform mat4 view; uniform mat4 projection; +uniform mat4 LightSpaceMatrix; + // Get Camera Info uniform vec3 CameraPosition; @@ -54,7 +58,7 @@ void main() Object.TangentFragPos = TBN * Object.FragPos; Object.Normal = mat3(model) * aNormal; // mat3(transpose(inverse(model))) * aNormal; Object.WorldPos = vec3(model*vec4(aPos, 1.0f)); - + //Object.FragPosLightSpace = LightSpaceMatrix * vec4(Object.FragPos, 1.0f); gl_Position = projection * view * vec4(Object.WorldPos, 1.0f); } @@ -65,19 +69,6 @@ void main() - - - - - - - - - - - - - diff --git a/Source/EditorAssets/Projects/NewProject/10041.ERS b/Source/EditorAssets/Projects/NewProject/10041.ERS index 1f5739ee00..cbf6a209ef 100644 --- a/Source/EditorAssets/Projects/NewProject/10041.ERS +++ b/Source/EditorAssets/Projects/NewProject/10041.ERS @@ -1,4 +1,4 @@ -#version 330 core +#version 420 core // Set Outputs out vec4 FragColor; @@ -12,10 +12,9 @@ in VS_OUT { vec3 TangentViewPos; vec3 TangentFragPos; vec3 Normal; // Used when normal texture not present -} Object; - - + //vec4 FragPosLightSpace; +} Object; // Define Structs struct STRUCT_DirectionalLight { @@ -25,6 +24,11 @@ struct STRUCT_DirectionalLight { // Light Color Parameters vec3 Color; float Intensity; + float MaxDistance; + int DepthMapIndex; + mat4 LightSpaceMatrix; + + bool CastsShadows; }; @@ -38,6 +42,12 @@ struct STRUCT_PointLight { // Light Rolloff Parameters float Intensity; + float MaxDistance; + + int DepthCubemapIndex; + + bool CastsShadows; + }; struct STRUCT_SpotLight { @@ -51,10 +61,16 @@ struct STRUCT_SpotLight { // Light Rolloff Parameters float Intensity; + float MaxDistance; // Spotlight Parameters float CutOff; - float OuterCutOff; + float RollOff; + + int DepthMapIndex; + mat4 LightSpaceMatrix; + + bool CastsShadows; }; @@ -90,37 +106,31 @@ uniform sampler2D texture_normals1; uniform sampler2D texture_shininess1; uniform sampler2D texture_emissive1; uniform sampler2D texture_metalness1; -uniform sampler2D texture_ambientocclusion1; +uniform sampler2D texture_ambient_occlusion1; +uniform sampler2DArray DepthMapArray; +uniform samplerCubeArray DepthMapCubeArray; - - -uniform bool HasAmbient; uniform bool HasAmbientOcclusion; -uniform bool HasBaseColor; uniform bool HasDiffuse; -uniform bool HasDiffuseRoughness; uniform bool HasDisplacement; -uniform bool HasEmissionColor; uniform bool HasEmissive; -uniform bool HasHeight; -uniform bool HasLightmap; uniform bool HasMetalness; -uniform bool HasNormalCamera; uniform bool HasNormals; -uniform bool HasOpacity; -uniform bool HasReflection; uniform bool HasShininess; -uniform bool HasSpecular; +// Get Shadow Configuration Information +uniform bool ReceiveShadows_; +uniform int ShadowFilterType_; +uniform int ShadowFilterKernelSize_; + // Get Lighting Info uniform int NumberDirectionalLights; uniform int NumberPointLights; uniform int NumberSpotLights; -uniform STRUCT_DirectionalLight DirectionalLights[1]; -uniform STRUCT_PointLight PointLights[128]; -uniform STRUCT_SpotLight SpotLights[96]; - +uniform STRUCT_DirectionalLight DirectionalLights[2]; +uniform STRUCT_PointLight PointLights[42]; +uniform STRUCT_SpotLight SpotLights[56]; // Gamma Correction Info uniform bool GammaCorrectionEnabled_; @@ -130,12 +140,375 @@ uniform float Gamma_; const float PI = 3.14159265358979; +vec2 PoissonDisk[16] = vec2[]( +vec2( -0.94201624, -0.39906216 ), +vec2( 0.94558609, -0.76890725 ), +vec2( -0.094184101, -0.92938870 ), +vec2( 0.34495938, 0.29387760 ), +vec2( -0.91588581, 0.45771432 ), +vec2( -0.81544232, -0.87912464 ), +vec2( -0.38277543, 0.27676845 ), +vec2( 0.97484398, 0.75648379 ), +vec2( 0.44323325, -0.97511554 ), +vec2( 0.53742981, -0.47373420 ), +vec2( -0.26496911, -0.41893023 ), +vec2( 0.79197514, 0.19090188 ), +vec2( -0.24188840, 0.99706507 ), +vec2( -0.81409955, 0.91437590 ), +vec2( 0.19984126, 0.78641367 ), +vec2( 0.14383161, -0.14100790 ) +); + +vec3 Poisson3D[16] = vec3[] ( +vec3(0.7439873218536399, -0.541186283808202, 0.17664264608175007), +vec3(-0.275775456801057, -0.32272001542150996, 0.68133261147887), +vec3(0.44897621078416994, -0.467917730100453, -0.659653108566999), +vec3(-0.847784673329443, 0.028283810708670032, -0.400656977668405), +vec3(-0.727825771085918, -0.283869738690555, 0.08675202075392008), +vec3(-0.452855029609054, 0.66060589626431, 0.7711005629971599), +vec3(0.61847387859598, -0.33074145298451196, 0.51381932664663), +vec3(0.35371939232573, 0.3825031747110199, -0.18291005725040999), +vec3(0.08679201826453009, 0.61422011069953, -0.5682788607664411), +vec3(-0.733357671182603, 0.78749090107158, 0.42277105059474995), +vec3(0.58986698603258, -0.422245749272406, 0.42315440950914995), +vec3(-0.081056734547019, -0.26176304789259996, 0.33600588003173004), +vec3(-0.158656360581517, -0.436631633434445, 0.09938938915729989), +vec3(-0.534419173840433, 0.81530744861811, 0.26251380564645), +vec3(0.7347787003964199, -0.17376213055103995, -0.05371918901801098), +vec3(0.59472335595638, 0.43984056729822996, -0.564682560041547) +); + +vec3 SampleOffsetDirections[20] = vec3[] +( + vec3( 1, 1, 1), vec3( 1, -1, 1), vec3(-1, -1, 1), vec3(-1, 1, 1), + vec3( 1, 1, -1), vec3( 1, -1, -1), vec3(-1, -1, -1), vec3(-1, 1, -1), + vec3( 1, 1, 0), vec3( 1, -1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), + vec3( 1, 0, 1), vec3(-1, 0, 1), vec3( 1, 0, -1), vec3(-1, 0, -1), + vec3( 0, 1, 1), vec3( 0, -1, 1), vec3( 0, -1, -1), vec3( 0, 1, -1) +); + +float random(vec3 seed, int i){ + vec4 seed4 = vec4(seed,i); + float dot_product = dot(seed4, vec4(1.9898,7.233,4.164,9.673)); + return fract(sin(dot_product) * 43758.5453); +} + + +float PCFSampler(float Bias, vec3 ProjCoords, int Index, float CurrentDepth, int SampleSize) { + + float shadow = 0.0; + vec2 texelSize = 1.0 / textureSize(DepthMapArray, 0).xy; + for(int x = -SampleSize; x <= SampleSize; ++x) + { + for(int y = -SampleSize; y <= SampleSize; ++y) + { + vec2 TexCoords2D = ProjCoords.xy + (vec2(x, y) * texelSize); + float pcfDepth = texture(DepthMapArray, vec3(TexCoords2D, Index)).r; + shadow += CurrentDepth - Bias > pcfDepth ? 1.0 : 0.0; + } + } + shadow /= (SampleSize*2)*(SampleSize*2); + + return shadow; + +} + +float PCFSamplerCubemap(float BiasedCurrentDepth, vec3 TexCoords3D, int Index, float ViewDistance, int SampleSize) { + + float shadow = 0.0; + + int samples = SampleSize*SampleSize; + float diskRadius = 0.01f;//(1.0 + (viewDistance / far_plane)) / 25.0; + for(int i = 0; i < samples; ++i) + { + float closestDepth = texture(DepthMapCubeArray, vec4(TexCoords3D + SampleOffsetDirections[i] * diskRadius, Index)).r; + closestDepth *= ViewDistance; // undo mapping [0;1] + if(BiasedCurrentDepth > closestDepth) + shadow += 1.0; + } + shadow /= float(samples); + + return shadow; +} + + +float PoissonSampler(float Bias, vec3 ProjCoords, int Index, float CurrentDepth, int SampleSize) { + + float shadow = 0.0f; + vec2 texelSize = 1.0f / textureSize(DepthMapArray, 0).xy; + + for(int x = -SampleSize; x <= SampleSize; ++x) + { + for(int y = -SampleSize; y <= SampleSize; ++y) + { + vec2 TexCoords2D = ProjCoords.xy + (vec2(x, y) * texelSize); + int index = int(x*y)%16; + float pcfDepth = texture(DepthMapArray, vec3(TexCoords2D + PoissonDisk[index]/700.0f, Index)).r; + shadow += CurrentDepth - Bias > pcfDepth ? 1.0f : 0.0f; + } + } + shadow /= (SampleSize*2)*(SampleSize*2); + return shadow; + +} + +float PoissonSamplerCube(float BiasedCurrentDepth, vec3 TexCoords3D, int Index, float ViewDistance, int SampleSize) { + + float shadow = 0.0; + + int samples = SampleSize*SampleSize; + + + for(int i = 0; i < samples; ++i) + { + + vec3 PoissonOffset = vec3(Poisson3D[i%16]/150.0f); + float closestDepth = texture(DepthMapCubeArray, vec4(TexCoords3D + PoissonOffset, Index)).r; + closestDepth *= ViewDistance; // undo mapping [0;1] + if(BiasedCurrentDepth > closestDepth) + shadow += 1.0; + } + shadow /= float(samples); + + + return shadow; + +} + + +float StratifiedPoissonSampler(float Bias, vec3 ProjCoords, int Index, float CurrentDepth, int SampleSize) { + float shadow = 0.0f; + vec2 texelSize = 1.0f / textureSize(DepthMapArray, 0).xy; + + for(int x = -SampleSize; x <= SampleSize; ++x) + { + for(int y = -SampleSize; y <= SampleSize; ++y) + { + + vec2 TexCoords2D = ProjCoords.xy + (vec2(x, y) * texelSize); + + int index = int(6.0f*random(floor(gl_FragCoord.yxz*1000.0f), int(ProjCoords.x*ProjCoords.y))); + float pcfDepth = texture(DepthMapArray, vec3(TexCoords2D + PoissonDisk[index]/1000.0f, Index)).r; + //pcfDepth = texture(DepthMapArray, vec3(TexCoords2D, Index)).r; + shadow += CurrentDepth - Bias > pcfDepth ? 1.0f : 0.0f; + } + } + shadow /= (SampleSize*2)*(SampleSize*2); + return shadow; +} + + +float StratifiedPoissonSamplerCube(float BiasedCurrentDepth, vec3 TexCoords3D, int Index, float ViewDistance, int SampleSize) { + + float shadow = 0.0; + + int samples = SampleSize*SampleSize; + for(int i = 0; i < samples; ++i) + { + int PoissonIndex = int(6.0f*random(floor(gl_FragCoord.yxz*1000.0f), int(i)))%16; + vec3 PoissonOffset = vec3(Poisson3D[PoissonIndex]/250.0f); + float closestDepth = texture(DepthMapCubeArray, vec4(TexCoords3D + PoissonOffset, Index)).r; + closestDepth *= ViewDistance; // undo mapping [0;1] + if(BiasedCurrentDepth > closestDepth) + shadow += 1.0; + } + shadow /= float(samples); + + + return shadow; + + +} + + +float ShadowCalculation(STRUCT_PointLight Light) +{ + + // If Shadows Are Not Enabled, Exit Early + if (!ReceiveShadows_ || !Light.CastsShadows) { + return 1.0f; + } + + // get vector between fragment position and light position + vec3 fragToLight = Object.FragPos - Light.Position; + + // ise the fragment to light vector to sample from the depth map + float closestDepth = texture(DepthMapCubeArray, vec4(fragToLight, Light.DepthCubemapIndex)).r; + // it is currently in linear range between [0,1], let's re-transform it back to original depth value + closestDepth *= Light.MaxDistance; + // now get current linear depth as the length between the fragment and light position + float currentDepth = length(fragToLight); + // test for shadows + + // Generate Shadow Map Bias + int TextureSize = textureSize(DepthMapCubeArray, 0).x; + float BiasMax = 0.005f; + if (TextureSize <= 512) { + BiasMax = 0.075; + } else if (TextureSize <= 1024) { + BiasMax = 0.05; + } else if (TextureSize <= 2048) { + BiasMax = 0.03; + } else if (TextureSize <= 4096) { + BiasMax = 0.02; + } else if (TextureSize <= 8192) { + BiasMax = 0.015; + } else if (TextureSize <= 16384) { + BiasMax = 0.01; + } + + float Bias = max(0.00 * (1.0 - dot(Object.Normal, normalize(fragToLight))), BiasMax); + + + // Select Correct Filter Based On Selection Uniform + float Shadow; + if (ShadowFilterType_ == 0) { // No Filtering + Shadow = currentDepth - Bias > closestDepth ? 1.0 : 0.0; + } else if (ShadowFilterType_ == 1) { // PCF Filtering + Shadow = PCFSamplerCubemap(currentDepth-Bias, fragToLight, Light.DepthCubemapIndex, Light.MaxDistance, ShadowFilterKernelSize_); + } else if (ShadowFilterType_ == 2) { // Poisson Filtering + Shadow = PoissonSamplerCube(currentDepth-Bias, fragToLight, Light.DepthCubemapIndex, Light.MaxDistance, ShadowFilterKernelSize_); + } else if (ShadowFilterType_ == 3) { + Shadow = StratifiedPoissonSamplerCube(currentDepth-Bias, fragToLight, Light.DepthCubemapIndex, Light.MaxDistance, ShadowFilterKernelSize_); + } else { + return 0.0f; // Return Failure, All Black) + } + + // display closestDepth as debug (to visualize depth cubemap) + // FragColor = vec4(vec3(closestDepth / Light.MaxDistance), 1.0); + + return 1.0f - Shadow; +} + +float ShadowCalculation(STRUCT_DirectionalLight Light) +{ + + // ., Light.Direction, Light.DepthMapIndex + + // If Shadows Are Not Enabled, Exit Early + if (!ReceiveShadows_ || !Light.CastsShadows) { + return 1.0f; + } + + + vec4 fragPosLightSpace = Light.LightSpaceMatrix * vec4(Object.FragPos, 1.0f); + + // perform perspective divide + vec3 projCoords = fragPosLightSpace.xyz / fragPosLightSpace.w; + // transform to [0,1] range + projCoords = projCoords * 0.5f + 0.5; + + // get closest depth value from light's perspective (using [0,1] range fragPosLight as coords) + float closestDepth = texture(DepthMapArray, vec3(projCoords.xy, Light.DepthMapIndex)).r; + // get depth of current fragment from light's perspective + float currentDepth = projCoords.z; + // check whether current frag pos is in shadow + //vec3 LightDir = normalize(L - Object.FragPos); + + float Bias = max(0.00 * (1.0 - dot(Object.Normal, Light.Direction)), 0.0025); + + //float Shadow = currentDepth - Bias > closestDepth ? 1.0 : 0.0; + float Shadow = PCFSampler(Bias, projCoords, Light.DepthMapIndex, currentDepth, 2); + //float Shadow = ShadowPCFRandom(Bias, projCoords, Index, currentDepth, 1); + + if (projCoords.z > 1.0) { + Shadow = 0.0f; + } + + if (Shadow > 1.0f) { + Shadow = 1.0f; + } else if (Shadow < 0.0f) { + Shadow = 0.0f; + } + + + return 1.0f - Shadow; +} + + +float ShadowCalculation(STRUCT_SpotLight Light) +{ + + // If Shadows Are Not Enabled, Exit Early + if (!ReceiveShadows_ || !Light.CastsShadows) { + return 1.0f; + } + + + vec4 fragPosLightSpace = Light.LightSpaceMatrix * vec4(Object.FragPos, 1.0f); + + // perform perspective divide + vec3 projCoords = fragPosLightSpace.xyz / fragPosLightSpace.w; + // transform to [0,1] range + projCoords = projCoords * 0.5f + 0.5; + + // get closest depth value from light's perspective (using [0,1] range fragPosLight as coords) + float closestDepth = texture(DepthMapArray, vec3(projCoords.xy, Light.DepthMapIndex)).r; + // get depth of current fragment from light's perspective + float currentDepth = projCoords.z; + // check whether current frag pos is in shadow + vec3 LightDir = normalize(Light.Position - Object.FragPos); + + + // Generate Shadow Map Bias + int TextureSize = textureSize(DepthMapArray, 0).x; + float BiasMax = 0.0005f; + if (TextureSize <= 512) { + BiasMax = 0.003; + } else if (TextureSize <= 1024) { + BiasMax = 0.0015; + } else if (TextureSize <= 2048) { + BiasMax = 0.001; + } else if (TextureSize <= 4096) { + BiasMax = 0.00075; + } else if (TextureSize <= 8192) { + BiasMax = 0.00045; + } else if (TextureSize <= 16384) { + BiasMax = 0.00025; + } + + float Bias = max(0.00 * (1.0 - dot(Object.Normal, LightDir)), BiasMax);//0.00225); + + + // Select Correct Filter Based On Selection Uniform + float Shadow; + if (ShadowFilterType_ == 0) { // No Filtering + Shadow = currentDepth - Bias > closestDepth ? 1.0 : 0.0; + } else if (ShadowFilterType_ == 1) { // PCF Filtering + Shadow = PCFSampler(Bias, projCoords, Light.DepthMapIndex, currentDepth, ShadowFilterKernelSize_); + } else if (ShadowFilterType_ == 2) { // Poisson Filtering + Shadow = PoissonSampler(Bias, projCoords, Light.DepthMapIndex, currentDepth, ShadowFilterKernelSize_); + } else if (ShadowFilterType_ == 3) { + Shadow = StratifiedPoissonSampler(Bias, projCoords, Light.DepthMapIndex, currentDepth, ShadowFilterKernelSize_); + } else { + return 0.0f; // Return Failure, All Black) + } + + if (projCoords.z > 1.0) { + Shadow = 0.0f; + } + + if (Shadow > 1.0f) { + Shadow = 1.0f; + } else if (Shadow < 0.0f) { + Shadow = 0.0f; + } + + + return 1.0f - Shadow; +} + + + + + + vec3 GetNormalFromMap(sampler2D Normal) { // Ensure That Textures Are Present/Valid, If Not, Provide Fallback vec3 SampledColor = texture(Normal, Object.TexCoords).xyz; if (!HasNormals || (SampledColor == vec3(0.0f))) { - SampledColor = vec3(0.5f, 0.5f, 1.0f); + SampledColor = vec3(0.5f, 0.5f, 1.0f); } // Use Texture Data To Calculate Normal Data @@ -264,6 +637,9 @@ STRUCT_SampledData SetSampledData() { + + + vec3 PBRPointLight(STRUCT_PointLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT_SampledData Model) { // calculate per-light radiance @@ -294,10 +670,10 @@ vec3 PBRPointLight(STRUCT_PointLight Light, vec3 ViewDir, vec3 Reflectance, STRU kD *= 1.0 - Model.Metallic; // scale light by NdotL - float NdotL = max(dot(Model.Normal, L), 0.0); - + float NdotL = max(dot(Model.Normal, L), 0.0); + // add to outgoing radiance Lo - return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + return ((kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL) * ShadowCalculation(Light); // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again } @@ -315,8 +691,8 @@ vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT // Calculate Spot Intensity float Theta = dot(normalize(Light.Position - Object.FragPos), normalize(-Light.Direction)); - float Epsilon = Light.CutOff - Light.OuterCutOff; - float Intensity = clamp((Theta - Light.OuterCutOff) / Epsilon, 0.0f, 1.0f); + float Epsilon = (Light.RollOff); + float Intensity = clamp((Theta - Light.CutOff) / Epsilon, 0.0f, 1.0f); if (GammaCorrectionEnabled_) { Intensity = pow(Intensity, Gamma_*Gamma_); @@ -325,8 +701,8 @@ vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT // calculate per-light radiance vec3 L = normalize(Light.Position - Object.WorldPos); vec3 H = normalize(ViewDir + L); - float distance = length(Light.Position - Object.WorldPos); - float attenuation = 1.0 / (distance * distance); + float LightDistance = length(Light.Position - Object.WorldPos); + float attenuation = 1.0 / (LightDistance * LightDistance); vec3 radiance = Light.Color * Light.Intensity * attenuation; // Cook-Torrance BRDF @@ -351,9 +727,15 @@ vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT // scale light by NdotL float NdotL = max(dot(Model.Normal, L), 0.0); + + // Check Distance, And Roll Off According To Max Distance + float DistanceToEnd = Light.MaxDistance - LightDistance; + if (DistanceToEnd < 1.0f) { + Intensity = clamp(Intensity * (DistanceToEnd), 0.0f, 1.0f); + } // add to outgoing radiance Lo - return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL * Intensity; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + return ((kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL * Intensity) * ShadowCalculation(Light); // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again } @@ -396,7 +778,7 @@ vec3 PBRDirectionalLight(STRUCT_DirectionalLight Light, vec3 ViewDir, vec3 Refle float NdotL = max(dot(Model.Normal, L), 0.0); // add to outgoing radiance Lo - return (kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again + return ((kD * Model.Albedo.rgb / PI + specular) * radiance * NdotL) * ShadowCalculation(Light); // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again } @@ -415,30 +797,30 @@ void main() { // ---- Calculate Lighting Contributions ---- // - vec4 Lo = vec4(0.0f); + vec3 Lo = vec3(0.0f); // Calculate Directional Lights for (int i = 0; i < NumberDirectionalLights; i++) { - Lo += vec4(PBRDirectionalLight(DirectionalLights[i], ViewDir, Reflectance, Model), 1.0f); + Lo += PBRDirectionalLight(DirectionalLights[i], ViewDir, Reflectance, Model); } // Calculate Point Lights for (int i = 0; i < NumberPointLights; i++) { - Lo += vec4(PBRPointLight(PointLights[i], ViewDir, Reflectance, Model), 1.0f); + Lo += PBRPointLight(PointLights[i], ViewDir, Reflectance, Model);// * ShadowCalculation(PointLights[i].LightSpaceMatrix, PointLights[i].Position, PointLights[i].DepthMapIndex); } // Calculate Spot Lights for(int i = 0; i < NumberSpotLights; ++i) { - Lo += vec4(PBRSpotLight(SpotLights[i], ViewDir, Reflectance, Model), 1.0f); + Lo += PBRSpotLight(SpotLights[i], ViewDir, Reflectance, Model); } // ambient lighting (note that the next IBL tutorial will replace // this ambient lighting with environment lighting). vec4 Ambient = vec4(0.03) * Model.Albedo * Model.AO; - vec4 Color = Ambient + Lo; + vec4 Color = Ambient + vec4(Lo, Model.Albedo.a); - // Add Emissive Texture + // Add Emissive Texture if (HasEmissive) { Color.rgb += Model.Emissive; } @@ -450,6 +832,10 @@ void main() { } else { FragColor = GammaCorrectResult(Color, GammaCorrectionEnabled_); } + + + + //FragColor = vec4(vec3(1.0f - ShadowCalculation(Object.FragPosLightSpace, DirectionalLights[0].Direction)), 1.0f); } @@ -462,3 +848,26 @@ void main() { + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/EditorAssets/Projects/NewProject/10042.ERS b/Source/EditorAssets/Projects/NewProject/10042.ERS new file mode 100644 index 0000000000..5bd2733cc9 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10042.ERS @@ -0,0 +1,10 @@ +#version 330 core +layout (location = 0) in vec3 aPos; + +uniform mat4 LightSpaceMatrix; +uniform mat4 model; + +void main() +{ + gl_Position = LightSpaceMatrix * model * vec4(aPos, 1.0); +} diff --git a/Source/EditorAssets/Projects/NewProject/10043.ERS b/Source/EditorAssets/Projects/NewProject/10043.ERS new file mode 100644 index 0000000000..0ba553608d --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10043.ERS @@ -0,0 +1,6 @@ +#version 330 core + +void main() +{ + // gl_FragDepth = gl_FragCoord.z; +} diff --git a/Source/EditorAssets/Projects/NewProject/10044.ERS b/Source/EditorAssets/Projects/NewProject/10044.ERS new file mode 100644 index 0000000000..75faf93587 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10044.ERS @@ -0,0 +1,36 @@ +#version 330 core +layout (location = 0) in vec3 aPos; + +uniform mat4 model; + +void main() +{ + gl_Position = model * vec4(aPos, 1.0); +} + + + +/** + +Fix For Transparency (Andrei Despinoiu) + + + +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 2) in vec2 aTexCoords; + + +out vec2 TexCoordsInitial; + + +uniform mat4 model; + + +void main() +{ + TexCoordsInitial = aTexCoords; + gl_Position = model * vec4(aPos, 1.0); +} +**/ + diff --git a/Source/EditorAssets/Projects/NewProject/10045.ERS b/Source/EditorAssets/Projects/NewProject/10045.ERS new file mode 100644 index 0000000000..26961a2d68 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10045.ERS @@ -0,0 +1,55 @@ +#version 330 core +in vec4 FragPos; + +uniform vec3 LightPos; +uniform float FarPlane; + +void main() +{ + float lightDistance = length(FragPos.xyz - LightPos); + + // map to [0;1] range by dividing by far_plane + lightDistance = lightDistance / FarPlane; + + // write this as modified depth + gl_FragDepth = lightDistance; + +} + + + +/** + +Fix For Transparency (Andrei Despinoiu) + +#version 330 core + + +in vec4 FragPos; +in vec2 TexCoords; + + +uniform vec3 lightPos; +uniform float farPlane; +uniform sampler2D texture1; + + +void main() +{ + // Opacity check + vec4 textureColour = texture(texture1, TexCoords); + if (textureColour.a < 0.5) { + discard; + } + + + // get distance between fragment and light source + float lightDistance = length(FragPos.xyz - lightPos); + // map to [0-1] range by dividing by farPlane + lightDistance = lightDistance / farPlane; + // write this as modified depth + gl_FragDepth = lightDistance; +} + +**/ + diff --git a/Source/EditorAssets/Projects/NewProject/10046.ERS b/Source/EditorAssets/Projects/NewProject/10046.ERS new file mode 100644 index 0000000000..c91e28fb92 --- /dev/null +++ b/Source/EditorAssets/Projects/NewProject/10046.ERS @@ -0,0 +1,62 @@ +#version 330 core +layout (triangles) in; +layout (triangle_strip, max_vertices=18) out; + +uniform mat4 ShadowMatrices[6]; +uniform int ShadowMapLayer; + +out vec4 FragPos; // FragPos from GS (output per emitvertex) + +void main() +{ + for(int face = 0; face < 6; ++face) + { + gl_Layer = (ShadowMapLayer*6) + face; // built-in variable that specifies to which face we render. + for(int i = 0; i < 3; ++i) // for each triangle's vertices + { + FragPos = gl_in[i].gl_Position; + gl_Position = ShadowMatrices[face] * FragPos; + EmitVertex(); + } + EndPrimitive(); + } +} + + + + +/** + +Fix For Transparency (Andrei Despinoiu) + + +#version 330 core +layout (triangles) in; +layout (triangle_strip, max_vertices=18) out; + + +in vec2 TexCoordsInitial[]; // Needs to be declared as an array +out vec2 TexCoords; +out vec4 FragPos; // FragPos from GS (output per emitvertex) + + +uniform mat4 shadowMatrices[6]; + + +void main() +{ + for(int face = 0; face < 6; ++face) + { + gl_Layer = face; // built-in variable that specifies to which face we render + for(int i = 0; i < 3; ++i) // for each triangle's vertices + { + TexCoords = TexCoordsInitial[i]; + FragPos = gl_in[i].gl_Position; + gl_Position = shadowMatrices[face] * FragPos; + EmitVertex(); + } + EndPrimitive(); + } +} + +**/ From 352133e6b9b5328df355a99d81fc5dcb6d710882 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:47:38 +0000 Subject: [PATCH 34/60] Implement Option To Create New Project (#271) --- .../GUI_Window_NewProject.cpp | 4 +++ Source/EditorAssets/Projects/NewProject/0.ERS | 4 +-- Source/EditorAssets/Projects/NewProject/1.ERS | 32 ++++++++++++------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index a92a040b6b..76e9cbfe24 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -41,6 +41,10 @@ void GUI_Window_NewProject::Draw() { SystemUtils_->Logger_->Log(std::string("Creating New Project In Target Directory '") + Path + "'", 5); + std::filesystem::directory_iterator DirIterator = std::filesystem::directory_iterator(Path); + + for (stdit) + std::string Command; #if defined(_WIN32) diff --git a/Source/EditorAssets/Projects/NewProject/0.ERS b/Source/EditorAssets/Projects/NewProject/0.ERS index ec7e4d770d..1ab0b248f2 100644 --- a/Source/EditorAssets/Projects/NewProject/0.ERS +++ b/Source/EditorAssets/Projects/NewProject/0.ERS @@ -209,8 +209,8 @@ 10040: AssetType: Undefined AssetCreationDate: 1970-01-01-00-00-01 - AssetModificationDate: 2022-04-17-01-28-56 + AssetModificationDate: 2022-04-28-06-24-53 10041: AssetType: Undefined AssetCreationDate: 1970-01-01-00-00-01 - AssetModificationDate: 2022-04-17-01-28-56 \ No newline at end of file + AssetModificationDate: 2022-04-28-06-24-53 \ No newline at end of file diff --git a/Source/EditorAssets/Projects/NewProject/1.ERS b/Source/EditorAssets/Projects/NewProject/1.ERS index 54c27f3d05..bb23477b67 100644 --- a/Source/EditorAssets/Projects/NewProject/1.ERS +++ b/Source/EditorAssets/Projects/NewProject/1.ERS @@ -1,9 +1,9 @@ -ProjectName: Untitled -ProjectDescription: The default project. +ProjectName: ERS Test Project +ProjectDescription: Test development scene for EGSC. ProjectVersion: 1.0.0 ProjectCreationDate: 0000-00-00 00-00-00 ProjectModificationDate: 2022-04-03 02-53-58 -ProjectCreator: "" +ProjectCreator: BrainGenix-ERS Development Team ProjectLicense: AGPL-V3.0 Or Higher IsLicenseProprietary: false SceneIDs: @@ -11,7 +11,7 @@ DefaultScene: 0 EditorLayouts: 0: 2 DefaultLayout: 0 -DefaultShaderProgram: 9 +DefaultShaderProgram: 11 ShaderPrograms: 0: Name: _Grid @@ -22,35 +22,43 @@ ShaderPrograms: VertexID: 10038 FragmentID: 10039 2: + Name: _DepthMap + VertexID: 10042 + FragmentID: 10043 + 3: + Name: _DepthCubeMap + VertexID: 10044 + FragmentID: 10045 + GeometryID: 10046 + 4: Name: Ambient Occlusion Texture Map VertexID: 10004 FragmentID: 10005 - 3: + 5: Name: Diffuse Texture Map VertexID: 10008 FragmentID: 10009 - 4: + 6: Name: Emissive Texture Map VertexID: 10016 FragmentID: 10017 - 5: + 7: Name: Height Texture Map VertexID: 10018 FragmentID: 10019 - 6: + 8: Name: Metalic Texture Map VertexID: 10022 FragmentID: 10023 - 7: + 9: Name: Normals Texture Map VertexID: 10026 FragmentID: 10027 - 8: + 10: Name: Shininess Texture Map VertexID: 10032 FragmentID: 10033 - 9: + 11: Name: Viewport VertexID: 10040 FragmentID: 10041 - From 2f0da3154f829e5530990249bd610705a6476843 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:48:25 +0000 Subject: [PATCH 35/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 76e9cbfe24..9741e13ec9 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -40,6 +40,10 @@ void GUI_Window_NewProject::Draw() { Path += "/"; SystemUtils_->Logger_->Log(std::string("Creating New Project In Target Directory '") + Path + "'", 5); + // TodO add system to get project dir from config file, + // then have it iterate over all files, copying them to the new selected path + // finally, have the system load that + // check for bugs and edge-cases std::filesystem::directory_iterator DirIterator = std::filesystem::directory_iterator(Path); From 91516023784aaeea826d07857e6e08253e7137f8 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:49:19 +0000 Subject: [PATCH 36/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 9741e13ec9..5334f093ec 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -47,7 +47,7 @@ void GUI_Window_NewProject::Draw() { std::filesystem::directory_iterator DirIterator = std::filesystem::directory_iterator(Path); - for (stdit) + //for (stdit) std::string Command; From ae925b916a1f6ad763485d87d03f6065e8956397 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:56:19 +0000 Subject: [PATCH 37/60] Implement Option To Create New Project (#271) --- .../GUI_Window_NewProject/GUI_Window_NewProject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index 5334f093ec..fb2087f7d3 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -45,9 +45,14 @@ void GUI_Window_NewProject::Draw() { // finally, have the system load that // check for bugs and edge-cases - std::filesystem::directory_iterator DirIterator = std::filesystem::directory_iterator(Path); + std::string DefualtProjectPath = "EditorAssets/Projects/NewProject/" + for (const auto &Entry : std::filesystem::recursive_directory_iterator(DefualtProjectPath)) { - //for (stdit) + std::string File{Entry.path().u8string()}; + + std::filesystem::copy() + + } std::string Command; From 21d831490bf0ec595f2082e57f753fa59733c40e Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 6 Jul 2022 05:57:56 +0000 Subject: [PATCH 38/60] Implement Option To Create New Project (#271) --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index fb2087f7d3..bb64343c8a 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -45,12 +45,12 @@ void GUI_Window_NewProject::Draw() { // finally, have the system load that // check for bugs and edge-cases - std::string DefualtProjectPath = "EditorAssets/Projects/NewProject/" + std::string DefualtProjectPath = "EditorAssets/Projects/NewProject/"; for (const auto &Entry : std::filesystem::recursive_directory_iterator(DefualtProjectPath)) { std::string File{Entry.path().u8string()}; - - std::filesystem::copy() + SystemUtils_->Logger_->Log(std::string("Copying File '") + File + "' To New Project Directory", 4); + std::filesystem::copy_file(File, Path); } From 35a329a7ae388757178809bd6c85356e3e98eaf1 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:35:00 +0000 Subject: [PATCH 39/60] Fix Broken FilePath --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index bb64343c8a..d6628c7568 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -46,9 +46,12 @@ void GUI_Window_NewProject::Draw() { // check for bugs and edge-cases std::string DefualtProjectPath = "EditorAssets/Projects/NewProject/"; + std::string CurrentExecutablePath = std::filesystem::current_path(); + for (const auto &Entry : std::filesystem::recursive_directory_iterator(DefualtProjectPath)) { - std::string File{Entry.path().u8string()}; + std::string FileName{Entry.path().u8string()}; + std::string File = CurrentExecutablePath + FileName; SystemUtils_->Logger_->Log(std::string("Copying File '") + File + "' To New Project Directory", 4); std::filesystem::copy_file(File, Path); From 8d713fe8bce7c0fa3d51834b0e6a6625cc8442b5 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:36:27 +0000 Subject: [PATCH 40/60] Fix Broken FilePath --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index d6628c7568..fffe8986aa 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -51,7 +51,7 @@ void GUI_Window_NewProject::Draw() { for (const auto &Entry : std::filesystem::recursive_directory_iterator(DefualtProjectPath)) { std::string FileName{Entry.path().u8string()}; - std::string File = CurrentExecutablePath + FileName; + std::string File = CurrentExecutablePath + "/" + FileName; SystemUtils_->Logger_->Log(std::string("Copying File '") + File + "' To New Project Directory", 4); std::filesystem::copy_file(File, Path); From b1d4279d23486850dee9cb616a965dad0f6cc212 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:39:53 +0000 Subject: [PATCH 41/60] Fix Broken FilePath --- .../GUI_Window_NewProject/GUI_Window_NewProject.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index fffe8986aa..ae4d6a34b4 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -50,10 +50,13 @@ void GUI_Window_NewProject::Draw() { for (const auto &Entry : std::filesystem::recursive_directory_iterator(DefualtProjectPath)) { - std::string FileName{Entry.path().u8string()}; - std::string File = CurrentExecutablePath + "/" + FileName; + // Get The Current Absolute Path To File, As Well As It's Filename + std::string PathRelativeName{Entry.path().u8string()}; + std::string File = CurrentExecutablePath + "/" + PathRelativeName; + std::string FileName = PathRelativeName.substr(PathRelativeName.find_last_of("/"), sizeof(PathRelativeName)); + SystemUtils_->Logger_->Log(std::string("Copying File '") + File + "' To New Project Directory", 4); - std::filesystem::copy_file(File, Path); + std::filesystem::copy_file(File, Path + PathRelativeName); } From c2970e3ad335da222a9a1c002db411ee2767f776 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:41:39 +0000 Subject: [PATCH 42/60] Fix Broken FilePath --- .../Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp index ae4d6a34b4..5c777f9f36 100644 --- a/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_NewProject/GUI_Window_NewProject.cpp @@ -56,7 +56,7 @@ void GUI_Window_NewProject::Draw() { std::string FileName = PathRelativeName.substr(PathRelativeName.find_last_of("/"), sizeof(PathRelativeName)); SystemUtils_->Logger_->Log(std::string("Copying File '") + File + "' To New Project Directory", 4); - std::filesystem::copy_file(File, Path + PathRelativeName); + std::filesystem::copy_file(File, Path + FileName); } From 8f98d2ecb47802eb5399ca39ce25fd56b622c782 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:45:57 +0000 Subject: [PATCH 43/60] Fix Issues Caused By No Scene Existing In Project File --- .../Manager/ERS_ProjectManager/ERS_ProjectManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp b/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp index 5543ecffb8..726a13f6e8 100644 --- a/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp +++ b/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp @@ -51,11 +51,13 @@ void ERS_CLASS_ProjectManager::LoadProject(long AssetID) { } // Load Default Scene - SystemUtils_->Logger_->Log(std::string(std::string("Loading Project Default Scene With ID ") + std::to_string(Project_.SceneIDs[Project_.DefaultScene])).c_str(), 5); - for (unsigned int i = 0; i < Project_.SceneIDs.size(); i++) { - SceneManager_->AddScene(SceneLoader_->ProcessScene(Project_.SceneIDs[i])); + if (Project_.SceneIDs.size() > 0) { + SystemUtils_->Logger_->Log(std::string(std::string("Loading Project Default Scene With ID ") + std::to_string(Project_.SceneIDs[Project_.DefaultScene])).c_str(), 5); + for (unsigned int i = 0; i < Project_.SceneIDs.size(); i++) { + SceneManager_->AddScene(SceneLoader_->ProcessScene(Project_.SceneIDs[i])); + } + SceneManager_->SetActiveScene(Project_.DefaultScene); } - SceneManager_->SetActiveScene(Project_.DefaultScene); } From bc8965a9c4502c58642f747d3497e736a2c99297 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 18:50:05 +0000 Subject: [PATCH 44/60] Fix Issues Caused By No Scene Existing In Project File --- .../ERS_ProjectManager/ERS_ProjectManager.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp b/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp index 726a13f6e8..e2fd31452d 100644 --- a/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp +++ b/Source/Core/Manager/ERS_ProjectManager/ERS_ProjectManager.cpp @@ -50,13 +50,28 @@ void ERS_CLASS_ProjectManager::LoadProject(long AssetID) { Project_.ControllerSettings->push_back(Settings); } - // Load Default Scene + // Handle The Defaut Scene if (Project_.SceneIDs.size() > 0) { + + // Load Default Scene If Applicable SystemUtils_->Logger_->Log(std::string(std::string("Loading Project Default Scene With ID ") + std::to_string(Project_.SceneIDs[Project_.DefaultScene])).c_str(), 5); for (unsigned int i = 0; i < Project_.SceneIDs.size(); i++) { SceneManager_->AddScene(SceneLoader_->ProcessScene(Project_.SceneIDs[i])); } SceneManager_->SetActiveScene(Project_.DefaultScene); + + } else { + + // Create Blank Scene For The System + ERS_STRUCT_Scene NewScene; + NewScene.ScenePath = SystemUtils_->ERS_IOSubsystem_->AllocateAssetID(); + NewScene.SceneName = "Untitled Scene"; + NewScene.IsSceneLoaded = true; + NewScene.SceneFormatVersion = 1; + + Project_.SceneIDs.push_back(NewScene.ScenePath); + SceneManager_->AddScene(NewScene); + } } From 6264317f9f8260a8f6949ef660bad2ed440916e2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 21:12:26 +0000 Subject: [PATCH 45/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index 276ea1f1b3..b145c3324a 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -157,6 +157,7 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText // Handle The Creation Of A New Texture Array SystemUtils_->Logger_->Log("Setting Up Cubemap Texture Array Metadata", 3, LogEnabled); DepthTextureCubemapNumTextures_ = NumberOfTextures; + std::cout<Logger_->Log("Setting Up Cubemap Texture Array OpenGL Parameters", 4, LogEnabled); glGenTextures(1, &DepthTextureCubemapArrayID_); glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, DepthTextureCubemapArrayID_); + std::cout<Logger_->Log("Cubemap Depth Map Texture Array Initialization Complete", 4, LogEnabled); + std::cout<Logger_->Log("Checking Cubemap Depth Map Texture Array Allocation Array", 3, LogEnabled); unsigned long SizeOfAllocationArray = DepthMapTexturesCubemapAlreadyAllocated_.size(); From 55ecf00e560938943e111cd16b07f508eea6503b Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 21:13:53 +0000 Subject: [PATCH 46/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index b145c3324a..4e08618877 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -157,7 +157,6 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText // Handle The Creation Of A New Texture Array SystemUtils_->Logger_->Log("Setting Up Cubemap Texture Array Metadata", 3, LogEnabled); DepthTextureCubemapNumTextures_ = NumberOfTextures; - std::cout<Logger_->Log("Setting Up Cubemap Texture Array OpenGL Parameters", 4, LogEnabled); glGenTextures(1, &DepthTextureCubemapArrayID_); glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, DepthTextureCubemapArrayID_); - std::cout<Logger_->Log("Cubemap Depth Map Texture Array Initialization Complete", 4, LogEnabled); - std::cout<Logger_->Log("Checking Cubemap Depth Map Texture Array Allocation Array", 3, LogEnabled); @@ -401,6 +396,9 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_PointLight* Light, ERS_STRUC // Only Update If Instructed To Do SO if (Light->DepthMap.ToBeUpdated) { + std::cout<SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); float NearPlane, FarPlane; @@ -438,6 +438,7 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_PointLight* Light, ERS_STRUC DepthShader->SetFloat("FarPlane", Light->MaxDistance); DepthShader->SetInt("ShadowMapLayer", Light->DepthMap.DepthMapTextureIndex); Renderer_->RenderSceneNoTextures(TargetScene, DepthShader); + std::cout<DepthMap.ToBeUpdated = false; From 5e7c749778e2e95d11d0510150018bcfcbeb520a Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 21:15:17 +0000 Subject: [PATCH 47/60] Debug OpenGL Errors --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index 4e08618877..e72035a092 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -525,6 +525,9 @@ void ERS_CLASS_DepthMaps::UpdateDepthMaps(ERS_STRUCT_Shader* DepthShader, ERS_S } + std::cout<<"FDSAFDSA"<PointLights.size(); i++) { From 669c6673b077aade3cd12f56cf557a7b60f48cc2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 21:19:49 +0000 Subject: [PATCH 48/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index e72035a092..994a29ae54 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -496,6 +496,9 @@ void ERS_CLASS_DepthMaps::UpdateDepthMaps(ERS_STRUCT_Shader* DepthShader, ERS_S // Fix Offset (Peter Panning) glCullFace(GL_FRONT); + std::cout<SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); @@ -512,6 +515,9 @@ void ERS_CLASS_DepthMaps::UpdateDepthMaps(ERS_STRUCT_Shader* DepthShader, ERS_S } + std::cout<SpotLights.size(); i++) { From 7d0a03b905787722d02bda67bb17ec049edf373c Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 21:22:01 +0000 Subject: [PATCH 49/60] Debug OpenGL Errors --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index 994a29ae54..7d57015c44 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -496,8 +496,6 @@ void ERS_CLASS_DepthMaps::UpdateDepthMaps(ERS_STRUCT_Shader* DepthShader, ERS_S // Fix Offset (Peter Panning) glCullFace(GL_FRONT); - std::cout<SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); @@ -515,7 +513,6 @@ void ERS_CLASS_DepthMaps::UpdateDepthMaps(ERS_STRUCT_Shader* DepthShader, ERS_S } - std::cout< Date: Fri, 15 Jul 2022 21:22:54 +0000 Subject: [PATCH 50/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp index dd6bb7ec71..1be0671ba8 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp @@ -63,6 +63,9 @@ void ERS_CLASS_VisualRenderer::SetOpenGLDefaults(ERS_STRUCT_OpenGLDefaults* Defa void ERS_CLASS_VisualRenderer::UpdateViewports(float DeltaTime, ERS_CLASS_SceneManager* SceneManager) { + std::cout< Date: Fri, 15 Jul 2022 21:23:26 +0000 Subject: [PATCH 51/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp index 1be0671ba8..334fdcfa9a 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp @@ -63,7 +63,7 @@ void ERS_CLASS_VisualRenderer::SetOpenGLDefaults(ERS_STRUCT_OpenGLDefaults* Defa void ERS_CLASS_VisualRenderer::UpdateViewports(float DeltaTime, ERS_CLASS_SceneManager* SceneManager) { - std::cout< Date: Fri, 15 Jul 2022 21:24:52 +0000 Subject: [PATCH 52/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp index 334fdcfa9a..60d047ebf7 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp @@ -81,6 +81,8 @@ void ERS_CLASS_VisualRenderer::UpdateViewports(float DeltaTime, ERS_CLASS_SceneM DeleteViewport(ViewportsToClose); } + std::cout<<"============================================"< Date: Fri, 15 Jul 2022 21:31:32 +0000 Subject: [PATCH 53/60] Debug OpenGL Errors --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 3 +++ .../ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index 72e6f8a866..3867074df4 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -199,15 +199,18 @@ void ERS_CLASS_ShadowMaps::PrioritizeDepthMaps(std::vector } void ERS_CLASS_ShadowMaps::UpdateShadowMaps(ERS_STRUCT_Shader* DepthMapShader, ERS_STRUCT_Shader* CubemapDepthShader, glm::vec3 CameraPosition) { + std::cout<<"============================================"<CheckSettings(); + std::cout<<"============================================"< DepthMaps; std::vector LightPositions; GetDepthMaps(&DepthMaps, &LightPositions); PrioritizeDepthMaps(DepthMaps, LightPositions, CameraPosition); + std::cout<<"============================================"<UpdateDepthMaps(DepthMapShader, CubemapDepthShader); diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp index 60d047ebf7..93fe84b621 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp @@ -63,7 +63,6 @@ void ERS_CLASS_VisualRenderer::SetOpenGLDefaults(ERS_STRUCT_OpenGLDefaults* Defa void ERS_CLASS_VisualRenderer::UpdateViewports(float DeltaTime, ERS_CLASS_SceneManager* SceneManager) { - std::cout<<"============================================"< Date: Fri, 15 Jul 2022 21:32:36 +0000 Subject: [PATCH 54/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index 3867074df4..9925ff04fa 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -199,16 +199,18 @@ void ERS_CLASS_ShadowMaps::PrioritizeDepthMaps(std::vector } void ERS_CLASS_ShadowMaps::UpdateShadowMaps(ERS_STRUCT_Shader* DepthMapShader, ERS_STRUCT_Shader* CubemapDepthShader, glm::vec3 CameraPosition) { - std::cout<<"============================================"<CheckSettings(); - std::cout<<"============================================"< DepthMaps; std::vector LightPositions; + std::cout<<"============================================"< Date: Fri, 15 Jul 2022 21:35:00 +0000 Subject: [PATCH 55/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index 9925ff04fa..fb80333068 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -63,6 +63,7 @@ void ERS_CLASS_ShadowMaps::DeallocateLightMaps() { void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* DepthMaps, std::vector* LightPositions) { ERS_STRUCT_Scene* ActiveScene = ProjectUtils_->SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); + std::cout<<"============================================"<PointLights.size(); i++) { if (ActiveScene->PointLights[i]->CastsShadows_) { @@ -73,6 +74,7 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ActiveScene->PointLights[i]->DepthMap.Initialized = true; } + std::cout<<"============================================"<push_back(&ActiveScene->PointLights[i]->DepthMap); @@ -84,6 +86,8 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ERS_CLASS_DepthMaps_->FreeDepthMapIndexCubemap(ActiveScene->PointLights[i]->DepthMap.DepthMapTextureIndex); ActiveScene->PointLights[i]->DepthMap.Initialized = false; } + std::cout<<"============================================"<SpotLights.size(); i++) { if (ActiveScene->SpotLights[i]->CastsShadows_) { From efa0fc8cf2cd5c13d21e9b1a6b181230f58e6a97 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 23:24:15 +0000 Subject: [PATCH 56/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index fb80333068..5eddf9d6ff 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -210,13 +210,13 @@ void ERS_CLASS_ShadowMaps::UpdateShadowMaps(ERS_STRUCT_Shader* DepthMapShader, E // Handle Updating Depth Maps std::vector DepthMaps; std::vector LightPositions; - std::cout<<"============================================"<UpdateDepthMaps(DepthMapShader, CubemapDepthShader); From 92cfa911b57150e17f2a6f8d8284762a5f68e8cb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 23:24:34 +0000 Subject: [PATCH 57/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index 5eddf9d6ff..5cc22a5914 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -63,7 +63,7 @@ void ERS_CLASS_ShadowMaps::DeallocateLightMaps() { void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* DepthMaps, std::vector* LightPositions) { ERS_STRUCT_Scene* ActiveScene = ProjectUtils_->SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); - std::cout<<"============================================"<PointLights.size(); i++) { if (ActiveScene->PointLights[i]->CastsShadows_) { @@ -74,7 +74,7 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ActiveScene->PointLights[i]->DepthMap.Initialized = true; } - std::cout<<"============================================"<push_back(&ActiveScene->PointLights[i]->DepthMap); @@ -86,7 +86,7 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ERS_CLASS_DepthMaps_->FreeDepthMapIndexCubemap(ActiveScene->PointLights[i]->DepthMap.DepthMapTextureIndex); ActiveScene->PointLights[i]->DepthMap.Initialized = false; } - std::cout<<"============================================"<SpotLights.size(); i++) { From c20c0ce7389ea63a6dc1284c4084eda1452b6ebe Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 23:33:32 +0000 Subject: [PATCH 58/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 6 ++++++ .../ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index 7d57015c44..52923f445d 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -143,6 +143,7 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText + std::string(" Pixels, And Height Of ") + std::to_string(DepthTextureArrayHeight_) + std::string(" Pixels") , 5, LogEnabled); + std::cout<<"===========================================R2="<Logger_->Log("Checking If Texture Cubemap Array Already Exists", 4, LogEnabled); @@ -153,6 +154,7 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText } else { SystemUtils_->Logger_->Log("Cubemap Array ID Not Already In Use", 3, LogEnabled); } + std::cout<<"===========================================R2="<Logger_->Log("Setting Up Cubemap Texture Array Metadata", 3, LogEnabled); @@ -165,6 +167,7 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText SystemUtils_->Logger_->Log("Setting Up Cubemap Texture Array OpenGL Parameters", 4, LogEnabled); glGenTextures(1, &DepthTextureCubemapArrayID_); glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, DepthTextureCubemapArrayID_); + std::cout<<"===========================================R2="<Logger_->Log("Cubemap Depth Map Texture Array Initialization Complete", 4, LogEnabled); + std::cout<<"===========================================R2="<Logger_->Log("Checking Cubemap Depth Map Texture Array Allocation Array", 3, LogEnabled); diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp index 5cc22a5914..e512e10c20 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ShadowMaps.cpp @@ -63,7 +63,6 @@ void ERS_CLASS_ShadowMaps::DeallocateLightMaps() { void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* DepthMaps, std::vector* LightPositions) { ERS_STRUCT_Scene* ActiveScene = ProjectUtils_->SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(); - std::cout<<"===========================================ONCE="<PointLights.size(); i++) { if (ActiveScene->PointLights[i]->CastsShadows_) { @@ -74,7 +73,6 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ActiveScene->PointLights[i]->DepthMap.Initialized = true; } - std::cout<<"===========================================R!="<push_back(&ActiveScene->PointLights[i]->DepthMap); @@ -86,7 +84,6 @@ void ERS_CLASS_ShadowMaps::GetDepthMaps(std::vector* Depth ERS_CLASS_DepthMaps_->FreeDepthMapIndexCubemap(ActiveScene->PointLights[i]->DepthMap.DepthMapTextureIndex); ActiveScene->PointLights[i]->DepthMap.Initialized = false; } - std::cout<<"===========================================R2="<SpotLights.size(); i++) { From 9ee8b447cb207a238bc1130c84bbebc585cf16e5 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 23:40:54 +0000 Subject: [PATCH 59/60] Debug OpenGL Errors --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index 52923f445d..ab6e91a5b3 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -136,14 +136,12 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArray2D(int NumberOfTextures, bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfTextures, bool LogEnabled) { - SystemUtils_->Logger_->Log( std::string("Generating Depth Map Texture Cube Map Array Of ") + std::to_string(NumberOfTextures) + std::string(" Textures, With Width Of ") + std::to_string(DepthTextureArrayWidth_) + std::string(" Pixels, And Height Of ") + std::to_string(DepthTextureArrayHeight_) + std::string(" Pixels") , 5, LogEnabled); - std::cout<<"===========================================R2="<Logger_->Log("Checking If Texture Cubemap Array Already Exists", 4, LogEnabled); @@ -154,7 +152,6 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText } else { SystemUtils_->Logger_->Log("Cubemap Array ID Not Already In Use", 3, LogEnabled); } - std::cout<<"===========================================R2="<Logger_->Log("Setting Up Cubemap Texture Array Metadata", 3, LogEnabled); @@ -188,14 +185,12 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); SystemUtils_->Logger_->Log("Cubemap Depth Map Texture Array Initialization Complete", 4, LogEnabled); - std::cout<<"===========================================R2="<Logger_->Log("Checking Cubemap Depth Map Texture Array Allocation Array", 3, LogEnabled); From 16abebc38736ae9d41c31d0c87ed842f46b158f5 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 15 Jul 2022 23:42:00 +0000 Subject: [PATCH 60/60] Debug OpenGL Errors --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp index ab6e91a5b3..a89466e170 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_DepthMaps.cpp @@ -168,7 +168,7 @@ bool ERS_CLASS_DepthMaps::RegenerateDepthMapTextureArrayCubemap(int NumberOfText glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, // Current 'mipmap level', We're not using these so 0 is fine - GL_DEPTH_COMPONENT24, // Storage Format, Using Depth Format Here As We're Setting Up A Depth Map + GL_DEPTH_COMPONENT, // Storage Format, Using Depth Format Here As We're Setting Up A Depth Map DepthTextureArrayWidth_, // Cubemap Width DepthTextureArrayHeight_, // Cubemap Height NumberOfTextures * 6, // Total Number Of Textures In The Array