Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

362 fix texture loader missing some assets #363

Merged
merged 66 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
691470b
Debug Texture Loader Missing Assets
datacrystals Sep 1, 2022
f13f79f
Fix Out Of Range Error
datacrystals Sep 1, 2022
902f5ef
Debug Texture Level Target System
datacrystals Sep 1, 2022
71185b8
Debug Texture Level Target System
datacrystals Sep 1, 2022
5c36444
Debug Texture Level Target System
datacrystals Sep 1, 2022
d908a3a
Debug Texture Level Target System
datacrystals Sep 1, 2022
1926e82
Debug Texture Level Target System
datacrystals Sep 1, 2022
4921f65
Fix Model Name Metadata Loader
datacrystals Sep 1, 2022
83d2d0e
Fix Model Name Metadata Loader
datacrystals Sep 1, 2022
bdeb920
Fix Model Name Metadata Loader
datacrystals Sep 1, 2022
28bc3f1
Fix Model Name Metadata Loader
datacrystals Sep 1, 2022
56b6e13
Debug Texture Level Target System
datacrystals Sep 1, 2022
044a2fd
Debug Texture Level Target System
datacrystals Sep 1, 2022
bd660b8
Debug Texture Level Target System
datacrystals Sep 1, 2022
176bbac
Debug Texture Level Target System
datacrystals Sep 1, 2022
8d9a71c
Debug Texture Level Target System
datacrystals Sep 1, 2022
c164a89
Debug Texture Level Target System
datacrystals Sep 1, 2022
e1be1c9
Debug Texture Level Target System
datacrystals Sep 1, 2022
bbed65c
Debug Texture Level Target System
datacrystals Sep 1, 2022
51bc50c
Debug Texture Level Target System
datacrystals Sep 1, 2022
7b5831c
Debug Texture Level Target System
datacrystals Sep 1, 2022
674f1c7
Debug Texture Level Target System
datacrystals Sep 1, 2022
de64646
Debug Texture Level Target System
datacrystals Sep 1, 2022
7f6ab6b
Debug Texture Level Target System
datacrystals Sep 1, 2022
bf25d83
Debug Texture Level Target System
datacrystals Sep 1, 2022
7e5367c
Debug Texture Level Target System
datacrystals Sep 1, 2022
f9d4e19
Debug Texture Level Target System
datacrystals Sep 1, 2022
1bef92c
Debug Texture Level Target System
datacrystals Sep 1, 2022
819e9b4
Debug Texture Level Target System
datacrystals Sep 1, 2022
61d4c3d
Debug Texture Level Target System
datacrystals Sep 1, 2022
5d6fe8c
Debug Texture Level Target System
datacrystals Sep 1, 2022
726785c
Debug Texture Level Target System
datacrystals Sep 1, 2022
e12c604
Debug Texture Level Target System
datacrystals Sep 1, 2022
89b97e3
Debug Texture Level Target System
datacrystals Sep 1, 2022
29078a4
Fix Texture LOD Bugs
datacrystals Sep 1, 2022
42854e1
Fix Texture LOD Bugs
datacrystals Sep 1, 2022
db2ebfa
Fix Texture LOD Bugs
datacrystals Sep 1, 2022
1cbb9d9
Fix Texture LOD Bugs
datacrystals Sep 1, 2022
eba5b2a
Debug Texture LOD Issues
datacrystals Sep 1, 2022
2b19584
Debug Texture LOD Issues
datacrystals Sep 1, 2022
c4a537a
Debug Texture LOD Issues
datacrystals Sep 1, 2022
8357beb
Debug Texture LOD Issues
datacrystals Sep 2, 2022
06bb6d3
Debug Texture LOD Issues
datacrystals Sep 2, 2022
65157bf
Fix Thread Safety Issue In AssetIndexIOM
datacrystals Sep 2, 2022
7406723
Fix Thread Safety Issue In AssetIndexIOM
datacrystals Sep 2, 2022
a8cee0c
Fix Thread Safety Issue In AssetIndexIOM
datacrystals Sep 2, 2022
61aa5d6
Fix Thread Safety Issue In AssetIndexIOM
datacrystals Sep 2, 2022
d52ca27
Fix Thread Safety Issue In AssetIndexIOM
datacrystals Sep 2, 2022
b7b2036
Debug Texture LOD Issues
datacrystals Sep 2, 2022
9a22682
Debug Texture LOD Issues
datacrystals Sep 2, 2022
3d49fd7
Debug Texture LOD Issues
datacrystals Sep 2, 2022
394091f
Debug Texture LOD Issues
datacrystals Sep 2, 2022
51cf47f
Debug Texture LOD Issues
datacrystals Sep 2, 2022
41836bb
Debug Texture LOD Issues
datacrystals Sep 2, 2022
163bff5
Debug Texture LOD Issues
datacrystals Sep 2, 2022
828f196
Debug Texture LOD Issues
datacrystals Sep 2, 2022
840dc05
Debug Texture LOD Issues
datacrystals Sep 2, 2022
9f3384a
Debug Texture LOD Issues
datacrystals Sep 2, 2022
0ed48e3
Debug Texture LOD Issues
datacrystals Sep 2, 2022
0616506
Debug Texture LOD Issues
datacrystals Sep 2, 2022
c762530
Debug Texture LOD Issues
datacrystals Sep 2, 2022
d9fd409
Debug Texture LOD Issues
datacrystals Sep 2, 2022
869f7aa
Debug Texture LOD Issues
datacrystals Sep 2, 2022
42df477
Debug Texture LOD Issues
datacrystals Sep 2, 2022
ffabe4e
Debug Texture LOD Issues
datacrystals Sep 2, 2022
32874a7
Debug Texture LOD Issues
datacrystals Sep 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,14 @@ void ERS_CLASS_AssetStreamingManager::UpdateSceneStreamingQueue(ERS_STRUCT_Scene
}

// Sort All Models Based On Distance From Each Camera
std::vector<std::map<float, unsigned int>> DistancesFromCamera = SortModelsByDistanceFromCameras(Scene, Cameras);
std::vector<std::vector<std::pair<float, unsigned int>>> DistancesFromCamera = SortModelsByDistanceFromCameras(Scene, Cameras);

std::map<unsigned int, int> CameraUpdateQuota = CalculateCameraMaxUpdates(100, Cameras);
std::map<unsigned int, int> CameraUpdateQuota = CalculateCameraMaxUpdates(10, Cameras);
SortSceneModels(CameraUpdateQuota, DistancesFromCamera, Scene);

}

void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int> CameraUpdatesQuota, std::vector<std::map<float, unsigned int>> DistancesFromCamera, ERS_STRUCT_Scene* Scene) {

// Reset All Target Distances
// for (unsigned int i = 0; i < Scene->Models.size(); i++) {
// Scene->Models[i]->TargetTextureLevelVRAM = 0;
// Scene->Models[i]->TargetTextureLevelRAM = 0;
// }
void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int> CameraUpdatesQuota, std::vector<std::vector<std::pair<float, unsigned int>>> DistancesFromCamera, ERS_STRUCT_Scene* Scene) {

// Iterate Over All Cameras, Make Recomendations From There
for (unsigned int CameraIndex = 0; CameraIndex < CameraUpdatesQuota.size(); CameraIndex++) {
Expand Down Expand Up @@ -107,16 +101,9 @@ void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int
TargetTextureLevelRAM = std::min(MaxLOD_, TargetTextureLevelRAM);
TargetTextureLevelVRAM = std::min(MaxLOD_, TargetTextureLevelVRAM);
}
if (TargetTextureLevelVRAM > NumberTextureLevels - 1) {
TargetTextureLevelVRAM = NumberTextureLevels - 1;
} else if (TargetTextureLevelVRAM < 0) {
TargetTextureLevelVRAM = 0;
}
if (TargetTextureLevelRAM > NumberTextureLevels - 1) {
TargetTextureLevelRAM = NumberTextureLevels - 1;
} else if (TargetTextureLevelRAM < 0) {
TargetTextureLevelRAM = 0;
}
TargetTextureLevelVRAM = std::min(TargetTextureLevelVRAM, Model->TargetTextureLevelRAM);


if (MaxTextureResolution_ > 0 && Model->Textures_.size() > 0) {
while (Model->Textures_[0].TextureLevels[TargetTextureLevelRAM].LevelResolution.first > MaxTextureResolution_) {
TargetTextureLevelRAM -=1;
Expand All @@ -128,10 +115,12 @@ void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int
} else if (MaxTextureResolution_ < 0) {
MaxTextureResolution_ = 0;
}
TargetTextureLevelVRAM = std::min(TargetTextureLevelVRAM, Model->TargetTextureLevelRAM);



TargetTextureLevelRAM = std::min(NumberTextureLevels - 1, TargetTextureLevelRAM);
TargetTextureLevelVRAM = std::min(NumberTextureLevels - 1, TargetTextureLevelVRAM);
TargetTextureLevelRAM = std::max(0, TargetTextureLevelRAM);
TargetTextureLevelVRAM = std::max(0, TargetTextureLevelVRAM);

// Calculate Texture Size
int TextureSizeVRAM = 0;
int TextureSizeRAM = 0;
Expand All @@ -149,7 +138,9 @@ void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int
if (!AlreadyHasVRAMLevel && !VRAMUpdateQuotaExceeded && TextureFitsInVRAM) {
if (Model->TargetTextureLevelVRAM < TargetTextureLevelVRAM) {
Model->TargetTextureLevelVRAM = TargetTextureLevelVRAM;
CameraVRAMUpdates++;
if (Model->TargetTextureLevelVRAM > 0) {
CameraVRAMUpdates++;
}
}
} else if (Model->TextureLevelInVRAM_ > TargetTextureLevelVRAM) {
Model->TargetTextureLevelVRAM = TargetTextureLevelVRAM;
Expand All @@ -164,7 +155,9 @@ void ERS_CLASS_AssetStreamingManager::SortSceneModels(std::map<unsigned int, int
if (!AlreadyHasRAMLevel && !RAMUpdateQuotaExceeded && TextureFitsInRAM) {
if (Model->TargetTextureLevelRAM < TargetTextureLevelRAM) {
Model->TargetTextureLevelRAM = TargetTextureLevelRAM;
CameraRAMUpdates++;
if (Model->TargetTextureLevelRAM > 0) {
CameraRAMUpdates++;
}
}
} else if (Model->TextureLevelInRAM_ > TargetTextureLevelRAM) {
Model->TargetTextureLevelRAM = TargetTextureLevelRAM;
Expand Down Expand Up @@ -303,25 +296,29 @@ std::map<unsigned int, int> ERS_CLASS_AssetStreamingManager::CalculateCameraMaxU

}

std::vector<std::map<float, unsigned int>> ERS_CLASS_AssetStreamingManager::SortModelsByDistanceFromCameras(ERS_STRUCT_Scene* Scene, std::vector<ERS_STRUCT_Camera*> Cameras) {
std::vector<std::vector<std::pair<float, unsigned int>>> ERS_CLASS_AssetStreamingManager::SortModelsByDistanceFromCameras(ERS_STRUCT_Scene* Scene, std::vector<ERS_STRUCT_Camera*> Cameras) {

std::vector<std::map<float, unsigned int>> DistancesFromCamera;
std::vector<std::vector<std::pair<float, unsigned int>>> DistancesFromCamera;
for (unsigned int i = 0; i < Cameras.size(); i++) {
DistancesFromCamera.push_back(SortModelsByDistanceFromCamera(Scene, Cameras[i]));
}
return DistancesFromCamera;

}

std::map<float, unsigned int> ERS_CLASS_AssetStreamingManager::SortModelsByDistanceFromCamera(ERS_STRUCT_Scene* Scene, ERS_STRUCT_Camera* Camera) {
std::vector<std::pair<float, unsigned int>> ERS_CLASS_AssetStreamingManager::SortModelsByDistanceFromCamera(ERS_STRUCT_Scene* Scene, ERS_STRUCT_Camera* Camera) {

// Create Sorted List Of Distances Based On Position
std::map<float, unsigned int> Distances;
std::vector<std::pair<float, unsigned int>> Distances;
for (unsigned int i = 0; i < Scene->Models.size(); i++) {


float TotalDistance = glm::distance(Camera->GetPosition(), Scene->Models[i]->ModelPosition);

// if (Scene->Models[i]->Name == "ApartmentCeiling") {
// std::cout<<"DistSort: "<<TotalDistance<<" Index: "<<i<<std::endl;
// }

// glm::vec3 UnscaledAngle = Camera->GetPosition() - Scene->Models[i]->ModelPosition;
// float MaxSide = UnscaledAngle.x;
// if (UnscaledAngle.y > MaxSide) {
Expand All @@ -344,16 +341,17 @@ std::map<float, unsigned int> ERS_CLASS_AssetStreamingManager::SortModelsByDista
} else if (ApproxCubeBoundryDistance < CubeBoundryBox.z) {
ApproxCubeBoundryDistance = CubeBoundryBox.z;
}


float Distance = TotalDistance - ApproxCubeBoundryDistance;

// Cap Distance At 0 - We don't want negative distance, (thats happens if the camera is inside the bounding box of the model)
Distance = std::max(0.0f, Distance);

Distances.insert(std::make_pair(Distance, i));
Distances.push_back(std::make_pair(Distance, i));
}
std::map<float, unsigned int> SortedDistances;
for (auto const& Entry : Distances) {
SortedDistances.insert(std::make_pair(Entry.first, Entry.second));


std::vector<std::pair<float, unsigned int>> SortedDistances;
for (std::pair<float, unsigned int> Entry : Distances) {
SortedDistances.push_back(std::make_pair(Entry.first, Entry.second));
}

return SortedDistances;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ERS_CLASS_AssetStreamingManager {
* @param Camera
* @return std::map<float, unsigned int>
*/
std::map<float, unsigned int> SortModelsByDistanceFromCamera(ERS_STRUCT_Scene* Scene, ERS_STRUCT_Camera* Camera);
std::vector<std::pair<float, unsigned int>> SortModelsByDistanceFromCamera(ERS_STRUCT_Scene* Scene, ERS_STRUCT_Camera* Camera);

/**
* @brief Sorts all models in the scene for every camera.
Expand All @@ -100,7 +100,7 @@ class ERS_CLASS_AssetStreamingManager {
* @param Cameras
* @return std::vector<std::map<float, unsigned int>>
*/
std::vector<std::map<float, unsigned int>> SortModelsByDistanceFromCameras(ERS_STRUCT_Scene* Scene, std::vector<ERS_STRUCT_Camera*> Cameras);
std::vector<std::vector<std::pair<float, unsigned int>>> SortModelsByDistanceFromCameras(ERS_STRUCT_Scene* Scene, std::vector<ERS_STRUCT_Camera*> Cameras);

/**
* @brief Generates a dictionary based on the camera's pointer indicating how many loads/unloads should be allowed for every camera
Expand Down Expand Up @@ -143,7 +143,7 @@ class ERS_CLASS_AssetStreamingManager {
* @param DistancesFromCamera
* @param Scene
*/
void SortSceneModels(std::map<unsigned int, int> CameraUpdatesQuota, std::vector<std::map<float, unsigned int>> DistancesFromCamera, ERS_STRUCT_Scene* Scene);
void SortSceneModels(std::map<unsigned int, int> CameraUpdatesQuota, std::vector<std::vector<std::pair<float, unsigned int>>> DistancesFromCamera, ERS_STRUCT_Scene* Scene);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelRAM(ERS_STRUCT_Model* Model, bool Lo
// Also apparenly I don't know how to spell...
// Load New Levels Into Memory
if (Model->TextureLevelInRAM_ < Model->TargetTextureLevelRAM) {
for (unsigned int LevelToLoad = (unsigned int)Model->TextureLevelInRAM_; LevelToLoad <= (unsigned int)Model->TargetTextureLevelRAM; LevelToLoad++) {
for (int LevelToLoad = Model->TextureLevelInRAM_; LevelToLoad <= Model->TargetTextureLevelRAM; LevelToLoad++) {
for (unsigned int TextureIndex = 0; TextureIndex < Model->Textures_.size(); TextureIndex++) {
LoadImageDataRAM(&Model->Textures_[TextureIndex], LevelToLoad, LogEnable);
}
Expand All @@ -383,7 +383,7 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelRAM(ERS_STRUCT_Model* Model, bool Lo

// Unload Old
else if (Model->TextureLevelInRAM_ > Model->TargetTextureLevelRAM) {
for (unsigned int LevelToUnload = (unsigned int)Model->TextureLevelInRAM_; LevelToUnload > (unsigned int)Model->TargetTextureLevelRAM; LevelToUnload--) {
for (int LevelToUnload = Model->TextureLevelInRAM_; LevelToUnload > Model->TargetTextureLevelRAM; LevelToUnload--) {
for (unsigned int TextureIndex = 0; TextureIndex < Model->Textures_.size(); TextureIndex++) {
UnloadImageDataRAM(&Model->Textures_[TextureIndex], LevelToUnload, LogEnable);
}
Expand All @@ -405,12 +405,7 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelVRAM(ERS_STRUCT_Model* Model, bool L
// Requested Level
LoadImageDataVRAM(&Model->Textures_[TextureIndex], LevelToLoad, LogEnable);
Model->Textures_[TextureIndex].BestAvailableOpenGLID = Model->Textures_[TextureIndex].TextureLevels[LevelToLoad].LevelTextureOpenGLID;

// Ensure That Level 0 Is Always Loaded
if (!Model->Textures_[TextureIndex].TextureLevels[0].LevelLoadedInVRAM) {
LoadImageDataVRAM(&Model->Textures_[TextureIndex], 0, LogEnable);
Model->Textures_[TextureIndex].HasAnyLevelReady = true;
}
Model->Textures_[TextureIndex].HasAnyLevelReady = true;

}
Model->TextureLevelInVRAM_ = LevelToLoad;
Expand All @@ -419,36 +414,41 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelVRAM(ERS_STRUCT_Model* Model, bool L
else if (Model->TextureLevelInVRAM_ > Model->TargetTextureLevelVRAM) {

// Here, we unload *all* levels that are above the target (if they're loaded)
for (unsigned int LevelToUnload = (unsigned int)Model->TextureLevelInVRAM_; LevelToUnload > (unsigned int)Model->TargetTextureLevelVRAM; LevelToUnload--) {
for (int LevelToUnload = Model->TextureLevelInVRAM_; LevelToUnload > Model->TargetTextureLevelVRAM; LevelToUnload--) {
for (unsigned int TextureIndex = 0; TextureIndex < Model->Textures_.size(); TextureIndex++) {

// Ensure That The Level Prior Is Loaded
// Make Sure We Don't Unload Level 0
int PriorLevel = LevelToUnload - 1;
if (PriorLevel > 0) {
if (PriorLevel >= 0) {

// Ensure Prior Level Is Loaded
if (!Model->Textures_[TextureIndex].TextureLevels[PriorLevel].LevelLoadedInVRAM) {
LoadImageDataVRAM(&Model->Textures_[TextureIndex], PriorLevel, LogEnable);
}
}

// Check If Level Already Loaded, Otherwise, Don't Try To Unload It
if (Model->Textures_[TextureIndex].TextureLevels[LevelToUnload].LevelLoadedInVRAM) {
UnloadImageDataVRAM(&Model->Textures_[TextureIndex], LevelToUnload, LogEnable);
}
// Check If Level Already Loaded, Otherwise, Don't Try To Unload It
if (Model->Textures_[TextureIndex].TextureLevels[LevelToUnload].LevelLoadedInVRAM) {
UnloadImageDataVRAM(&Model->Textures_[TextureIndex], LevelToUnload, LogEnable);
}

// Find New Best OpenGL ID
for (unsigned int i = 0; i < Model->Textures_[TextureIndex].TextureLevels.size(); i++) {
if (Model->Textures_[TextureIndex].TextureLevels[i].LevelLoadedInVRAM) {
Model->Textures_[TextureIndex].BestAvailableOpenGLID = Model->Textures_[TextureIndex].TextureLevels[i].LevelTextureOpenGLID;
// Find New Best OpenGL ID
for (unsigned int i = 0; i < Model->Textures_[TextureIndex].TextureLevels.size(); i++) {
if (Model->Textures_[TextureIndex].TextureLevels[i].LevelLoadedInVRAM) {
Model->Textures_[TextureIndex].BestAvailableOpenGLID = Model->Textures_[TextureIndex].TextureLevels[i].LevelTextureOpenGLID;
Model->Textures_[TextureIndex].HasAnyLevelReady = true;
}
}

}


}

}

// Detect New Level Loaded In Memory
if (Model->Textures_.size() > 0) {
for (int i = 0; i < Model->Textures_[0].TextureLevels.size(); i++) {
for (unsigned int i = 0; i < Model->Textures_[0].TextureLevels.size(); i++) {
if (Model->Textures_[0].TextureLevels[i].LevelLoadedInVRAM) {
Model->TextureLevelInVRAM_ = i;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ bool ERS_FUNCTION_DecodeModelMetadataV000(YAML::Node Metadata, ERS_STRUCT_Model*
// Attempt To Decode, Handle Errors
try {


if (Metadata["Name"]) {
std::string Name = Metadata["Name"].as<std::string>();
Model->Name = Name.substr(Name.find_last_of("/") + 1, Name.length()-1);
} else {
Model->Name = "_Error_";
SystemUtils->Logger_->Log(std::string("Error Loading Name From Model Metadata '") + std::to_string(AssetID) + "'", 7);
DecodeStatus = false;
if (Model->Name == "Loading...") {
if (Metadata["Name"]) {
std::string Name = Metadata["Name"].as<std::string>();
Model->Name = Name.substr(Name.find_last_of("/") + 1, Name.length()-1);
} else {
Model->Name = "_Error_";
SystemUtils->Logger_->Log(std::string("Error Loading Name From Model Metadata '") + std::to_string(AssetID) + "'", 7);
DecodeStatus = false;
}
}

if (Metadata["ModelID"]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is part of the BrainGenix-ERS Environment Rendering System //
//======================================================================//

#include <ERS_FUNCTION_ModelMetadataDecoderV0.0.0.h>
#include <ERS_FUNCTION_ModelMetadataDecoderV0.0.1.h>


bool ERS_FUNCTION_DecodeModelMetadataV001(YAML::Node Metadata, ERS_STRUCT_Model* Model, ERS_STRUCT_SystemUtils* SystemUtils, long AssetID, bool LogEnable) {
Expand All @@ -16,13 +16,15 @@ bool ERS_FUNCTION_DecodeModelMetadataV001(YAML::Node Metadata, ERS_STRUCT_Model*

SystemUtils->Logger_->Log("Decoding Model Metadata", 3, LogEnable);

if (Metadata["Name"]) {
std::string Name = Metadata["Name"].as<std::string>();
Model->Name = Name.substr(Name.find_last_of("/") + 1, Name.length()-1);
} else {
Model->Name = "_Error_";
SystemUtils->Logger_->Log(std::string("Error Loading Name From Model Metadata '") + std::to_string(AssetID) + "'", 7);
DecodeStatus = false;
if (Model->Name == "Loading...") {
if (Metadata["Name"]) {
std::string Name = Metadata["Name"].as<std::string>();
Model->Name = Name.substr(Name.find_last_of("/") + 1, Name.length()-1);
} else {
Model->Name = "_Error_";
SystemUtils->Logger_->Log(std::string("Error Loading Name From Model Metadata '") + std::to_string(AssetID) + "'", 7);
DecodeStatus = false;
}
}

if (Metadata["ModelID"]) {
Expand Down
11 changes: 11 additions & 0 deletions Source/Core/Renderer/ERS_CLASS_RendererManager/RendererManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,20 @@ void RendererManager::UpdateLoop(float DeltaTime) {
// Log Any Issues
ReportOpenGLErrors();



ERS_STRUCT_Scene* TargetScene = ProjectUtils_->SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get();
ProjectUtils_->ModelLoader_->AssetStreamingManager_->AsyncTextureUpdater_->SortModels(TargetScene);

std::vector<ERS_STRUCT_Camera*> Cameras;
for (unsigned int i = 0; i < VisualRenderer_->Viewports_.size(); i++) {
Cameras.push_back(VisualRenderer_->Viewports_[i]->Camera.get());
}
ProjectUtils_->ModelLoader_->AssetStreamingManager_->UpdateSceneStreamingQueue(ProjectUtils_->SceneManager_->Scenes_[ProjectUtils_->SceneManager_->ActiveScene_].get(), Cameras);




// Update Window Title
std::string SceneTitle = ProjectUtils_->ProjectManager_->Project_.ProjectName + std::string(" - BrainGenix-ERS");
glfwSetWindowTitle(Window_, SceneTitle.c_str());
Expand Down
Loading