Implemented scanline and silhouette effect #363

Merged
Xenosas1337 merged 12 commits from SP3-1-Rendering into main 2023-02-24 17:20:46 +08:00
2 changed files with 23 additions and 11 deletions
Showing only changes of commit 5d3e755b9b - Show all commits

View File

@ -41,7 +41,7 @@ namespace SHADE
std::vector<SHAssetLoader*> SHAssetManager::loaders(TYPE_COUNT);
std::unordered_map<AssetID, SHAsset> SHAssetManager::assetCollection;
std::unordered_map<AssetID, SHAssetData * const> SHAssetManager::assetData;
std::unordered_map<AssetID, SHAssetData *> SHAssetManager::assetData;
/****************************************************************************
@ -460,18 +460,30 @@ namespace SHADE
else
{
target = GetAssetIDFromPath(path);
// send compile asset event
SHCompileAssetEvent compileShaderEvent
//Reload data
auto result = GetAsset(target);
if (result.has_value())
{
.assetName = newPath.filename().stem().string(),
.assetID = target,
.assetType = AssetType::SHADER,
};
SHEventManager::BroadcastEvent<SHCompileAssetEvent>(compileShaderEvent, SH_ASSET_COMPILE_EVENT);
auto const& asset{ result.value() };
auto newData = loaders[static_cast<size_t>(asset.type)]->Load(asset.path);
delete assetData[target];
assetData[target] = newData;
}
else
{
SHLOG_ERROR("[Asset Manager] Critical: reload of existing compiled data failed");
}
}
//TODO SEND EVENT HERE
// send compile asset event
SHCompileAssetEvent compileShaderEvent
{
.assetName = newPath.filename().stem().string(),
.assetID = target,
.assetType = AssetType::SHADER,
};
SHEventManager::BroadcastEvent<SHCompileAssetEvent>(compileShaderEvent, SH_ASSET_COMPILE_EVENT);
}
FolderPointer SHAssetManager::GetRootFolder() noexcept

View File

@ -123,7 +123,7 @@ namespace SHADE
// For all resources
static std::unordered_map<AssetID, SHAsset> assetCollection;
static std::unordered_map<AssetID, SHAssetData * const> assetData;
static std::unordered_map<AssetID, SHAssetData *> assetData;
};
}