Fixed bloom effect not being properly applied

Added support for userparameter on the clearcolor of the scene
Scenes should draw into the full framebuffer

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2022-11-05 10:50:55 +01:00
parent 56ebb78287
commit fa67fa5b00
3 changed files with 6 additions and 6 deletions

View File

@ -216,11 +216,11 @@ CVirtualContainer* buildVirtualContainer ()
"\t\t}," "\t\t},"
"\t\t{" "\t\t{"
"\t\t\t\"material\": \"materials/util/combine.json\"," "\t\t\t\"material\": \"materials/util/combine.json\","
"\t\t\t\"target\": \"_rt_imageLayerComposite_-1_b\"," "\t\t\t\"target\": \"_rt_FullFrameBuffer\","
"\t\t\t\"bind\":" "\t\t\t\"bind\":"
"\t\t\t[" "\t\t\t["
"\t\t\t\t{" "\t\t\t\t{"
"\t\t\t\t\t\"name\": \"_rt_FullFrameBuffer\"," "\t\t\t\t\t\"name\": \"_rt_imageLayerComposite_-1_a\","
"\t\t\t\t\t\"index\": 0" "\t\t\t\t\t\"index\": 0"
"\t\t\t\t}," "\t\t\t\t},"
"\t\t\t\t{" "\t\t\t\t{"

View File

@ -74,7 +74,7 @@ CScene* CScene::fromFile (const std::string& filename, CContainer* container)
auto camerashakeamplitude = jsonFindDefault <double> (*general_it, "camerashakeamplitude", 0.0f); auto camerashakeamplitude = jsonFindDefault <double> (*general_it, "camerashakeamplitude", 0.0f);
auto camerashakeroughness = jsonFindDefault <double> (*general_it, "camerashakeroughness", 0.0f); auto camerashakeroughness = jsonFindDefault <double> (*general_it, "camerashakeroughness", 0.0f);
auto camerashakespeed = jsonFindDefault <double> (*general_it, "camerashakespeed", 0.0f); auto camerashakespeed = jsonFindDefault <double> (*general_it, "camerashakespeed", 0.0f);
auto clearcolor_it = jsonFindRequired (*general_it, "clearcolor", "General section must have clear color"); auto clearcolor = jsonFindUserConfig <std::string> (*general_it, "clearcolor", "1 1 1");
auto orthogonalprojection_it = jsonFindRequired (*general_it, "orthogonalprojection", "General section must have orthogonal projection info"); auto orthogonalprojection_it = jsonFindRequired (*general_it, "orthogonalprojection", "General section must have orthogonal projection info");
auto skylightcolor = jsonFindDefault <std::string> (*general_it, "skylightcolor", "0 0 0"); auto skylightcolor = jsonFindDefault <std::string> (*general_it, "skylightcolor", "0 0 0");
@ -95,7 +95,7 @@ CScene* CScene::fromFile (const std::string& filename, CContainer* container)
camerashakeamplitude, camerashakeamplitude,
camerashakeroughness, camerashakeroughness,
camerashakespeed, camerashakespeed,
WallpaperEngine::Core::aToColorf(*clearcolor_it), WallpaperEngine::Core::aToColorf(clearcolor),
Scenes::CProjection::fromJSON (*orthogonalprojection_it), Scenes::CProjection::fromJSON (*orthogonalprojection_it),
WallpaperEngine::Core::aToColorf(skylightcolor) WallpaperEngine::Core::aToColorf(skylightcolor)
); );

View File

@ -247,8 +247,8 @@ void CScene::renderFrame (glm::ivec4 viewport)
// use the scene's framebuffer by default // use the scene's framebuffer by default
glBindFramebuffer (GL_FRAMEBUFFER, this->getWallpaperFramebuffer()); glBindFramebuffer (GL_FRAMEBUFFER, this->getWallpaperFramebuffer());
// ensure we render over the whole screen // ensure we render over the whole framebuffer
glViewport (0, 0, projection->getWidth (), projection->getHeight ()); glViewport (0, 0, this->m_sceneFBO->getRealWidth (), this->m_sceneFBO->getRealHeight ());
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);