From d90f7ca58caa6764e1846da53d2b8e5fdef712ec Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 23 Jun 2022 07:43:39 +0000 Subject: [PATCH] Implement Settings To Control Rendering (#220) --- .../Loader/ERS_SceneLoader/ERS_SceneLoader.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Source/Core/Loader/ERS_SceneLoader/ERS_SceneLoader.cpp b/Source/Core/Loader/ERS_SceneLoader/ERS_SceneLoader.cpp index 38e2d706b6..e1b34f7e8b 100644 --- a/Source/Core/Loader/ERS_SceneLoader/ERS_SceneLoader.cpp +++ b/Source/Core/Loader/ERS_SceneLoader/ERS_SceneLoader.cpp @@ -298,6 +298,23 @@ void ERS_CLASS_SceneLoader::AddModel(ERS_STRUCT_Scene* Scene, long AssetID) { Scene->Models[CurrentSize-1]->Name = std::string("Loading..."); Scene->Models[CurrentSize-1]->FlipTextures = true; + + // Process Texture References, Setup Meshes + ERS_STRUCT_Model* Model = Scene->Models[CurrentSize-1].get(); + for (unsigned long i = 0; i < Model->Meshes.size(); i++) { + for (unsigned long Index = 0; Index < Model->Meshes[i].TextureReferences_.size(); Index++) { // IF TEXTURES DONT WORK, CHECK HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + int TextureIndex = Model->Meshes[i].TextureReferences_[Index]; + + // Set Shadow Configuration Pointers + Model->Meshes[i].CastDynamicShadows_ = &Model->CastDynamicShadows_; + Model->Meshes[i].CastStaticShadows_ = &Model->CastStaticShadows_; + Model->Meshes[i].ReceiveShadows_ = &Model->ReceiveShadows_; + + } + } + + ModelLoader_->AddModelToLoadingQueue(AssetID, Scene->Models[CurrentSize-1], Scene->Models[CurrentSize-1]->FlipTextures);