mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
feat: deferred lighting (WIP)
This commit is contained in:
parent
2ad076bec3
commit
e849d5e9b7
10 changed files with 105 additions and 12 deletions
|
|
@ -17,7 +17,10 @@ static int l_set_effect(lua::State* L) {
|
|||
size_t index = static_cast<size_t>(lua::tointeger(L, 1));
|
||||
auto name = lua::require_string(L, 2);
|
||||
auto& assets = *engine->getAssets();
|
||||
auto effect = std::make_shared<PostEffect>(assets.require<PostEffect>(name));
|
||||
auto effect = assets.getShared<PostEffect>(name);
|
||||
if (effect == nullptr) {
|
||||
throw std::runtime_error(std::string("post-effect '") + name + "' not found");
|
||||
}
|
||||
post_processing->setEffect(index, std::move(effect));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue