mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-13 07:33:35 +00:00
adding post process and AO
This commit is contained in:
@@ -9,13 +9,13 @@ namespace Scop
|
||||
{
|
||||
if(path.extension() != ".bmp")
|
||||
{
|
||||
Error("BMP loader : not a BMP file, %", path);
|
||||
Error("BMP loader: not a BMP file, %", path);
|
||||
return {};
|
||||
}
|
||||
std::ifstream file(path, std::ios::binary);
|
||||
if(!file.is_open())
|
||||
{
|
||||
Error("BMP loader : could not open %", path);
|
||||
Error("BMP loader: could not open %", path);
|
||||
return {};
|
||||
}
|
||||
std::int16_t bpp;
|
||||
@@ -26,7 +26,7 @@ namespace Scop
|
||||
file.read(reinterpret_cast<char*>(&bpp), sizeof(bpp));
|
||||
file.seekg(54, std::ios_base::beg);
|
||||
if(bpp != 24)
|
||||
Warning("BMP loader : warning while loadeing %, cannot handle yet different color palette sizes", path);
|
||||
Warning("BMP loader: warning while loadeing %, cannot handle yet different color palette sizes", path);
|
||||
CPUBuffer buffer{ dimensions.x * dimensions.y * 4 };
|
||||
for(std::size_t i = 0; i <= buffer.GetSize(); i += 4)
|
||||
{
|
||||
|
||||
@@ -35,15 +35,19 @@ namespace Scop
|
||||
m_forward.Pass(scene, renderer, m_main_render_texture);
|
||||
if(scene.GetDescription().render_skybox_enabled)
|
||||
m_skybox.Pass(scene, renderer, m_main_render_texture);
|
||||
if(scene.GetDescription().render_2D_enabled)
|
||||
m_2Dpass.Pass(scene, renderer, m_main_render_texture);
|
||||
if(scene.GetDescription().render_post_process_enabled && scene.GetDescription().post_process_shader)
|
||||
{
|
||||
m_post_process.Pass(scene, renderer, m_main_render_texture);
|
||||
if(scene.GetDescription().render_2D_enabled)
|
||||
m_2Dpass.Pass(scene, renderer, m_post_process.GetProcessTexture());
|
||||
m_final.Pass(scene, renderer, m_post_process.GetProcessTexture());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(scene.GetDescription().render_2D_enabled)
|
||||
m_2Dpass.Pass(scene, renderer, m_main_render_texture);
|
||||
m_final.Pass(scene, renderer, m_main_render_texture);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPasses::Destroy()
|
||||
|
||||
Reference in New Issue
Block a user