Examples: Enable gamma correction pass

This commit is contained in:
SirLynix 2023-10-10 21:57:23 +02:00 committed by Jérôme Leclercq
parent 55b4e47582
commit 6323cb5372
3 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,7 @@ int main(int argc, char* argv[])
Nz::Vector2ui windowSize = window.GetSize(); Nz::Vector2ui windowSize = window.GetSize();
Nz::Camera camera(&windowSwapchain); Nz::Camera camera(&windowSwapchain);
camera.EnableFramePipelinePasses(Nz::FramePipelineExtraPass::GammaCorrection);
//camera.UpdateClearColor(Nz::Color::Gray); //camera.UpdateClearColor(Nz::Color::Gray);
Nz::ViewerInstance& viewerInstance = camera.GetViewerInstance(); Nz::ViewerInstance& viewerInstance = camera.GetViewerInstance();

View File

@ -106,6 +106,7 @@ int main(int argc, char* argv[])
//cameraNode.SetParent(playerRotNode); //cameraNode.SetParent(playerRotNode);
auto& cameraComponent = playerCamera.emplace<Nz::CameraComponent>(&windowSwapchain); auto& cameraComponent = playerCamera.emplace<Nz::CameraComponent>(&windowSwapchain);
cameraComponent.EnableFramePipelinePasses(Nz::FramePipelineExtraPass::GammaCorrection);
cameraComponent.UpdateZNear(0.2f); cameraComponent.UpdateZNear(0.2f);
cameraComponent.UpdateZFar(10000.f); cameraComponent.UpdateZFar(10000.f);
cameraComponent.UpdateRenderMask(1); cameraComponent.UpdateRenderMask(1);
@ -156,6 +157,7 @@ int main(int argc, char* argv[])
{ {
Nz::MaterialInstanceParams params; Nz::MaterialInstanceParams params;
params.materialType = Nz::MaterialType::Phong; params.materialType = Nz::MaterialType::Phong;
params.custom.SetParameter("sRGB", true);
if (alphaMaterials.test(i)) if (alphaMaterials.test(i))
params.custom.SetParameter("EnableAlphaBlending", true); params.custom.SetParameter("EnableAlphaBlending", true);

View File

@ -106,7 +106,7 @@ int main(int argc, char* argv[])
viewer2D.emplace<Nz::NodeComponent>(); viewer2D.emplace<Nz::NodeComponent>();
auto& cameraComponent = viewer2D.emplace<Nz::CameraComponent>(&windowSwapchain, Nz::ProjectionType::Orthographic); auto& cameraComponent = viewer2D.emplace<Nz::CameraComponent>(&windowSwapchain, Nz::ProjectionType::Orthographic);
cameraComponent.UpdateClearColor(Nz::Color::sRGBToLinear(Nz::Color(0.46f, 0.48f, 0.84f, 1.f))); cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
} }
return app.Run(); return app.Run();