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);