Graphics: Add gamma correction
This commit is contained in:
committed by
Jérôme Leclercq
parent
041be74b9d
commit
d40b8af68d
@@ -48,7 +48,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
std::shared_ptr<Nz::MaterialInstance> materialInstance = Nz::MaterialInstance::Instantiate(Nz::MaterialType::PhysicallyBased);
|
||||
materialInstance->SetTextureProperty("AlphaMap", Nz::Texture::LoadFromFile(resourceDir / "alphatile.png", texParams));
|
||||
materialInstance->SetTextureProperty("BaseColorMap", Nz::Texture::LoadFromFile(resourceDir / "Rusty/rustediron2_basecolor.png", texParams));
|
||||
materialInstance->SetTextureProperty("BaseColorMap", Nz::Texture::LoadFromFile(resourceDir / "Rusty/rustediron2_basecolor.png", srgbTexParams));
|
||||
materialInstance->SetTextureProperty("MetallicMap", Nz::Texture::LoadFromFile(resourceDir / "Rusty/rustediron2_metallic.png", texParams));
|
||||
materialInstance->SetTextureProperty("RoughnessMap", Nz::Texture::LoadFromFile(resourceDir / "Rusty/rustediron2_roughness.png", texParams));
|
||||
|
||||
|
||||
@@ -338,8 +338,11 @@ int main(int argc, char* argv[])
|
||||
planeSampler.wrapModeU = Nz::SamplerWrap::Repeat;
|
||||
planeSampler.wrapModeV = Nz::SamplerWrap::Repeat;
|
||||
|
||||
Nz::TextureParams srgbTexParams;
|
||||
srgbTexParams.loadFormat = Nz::PixelFormat::RGBA8_SRGB;
|
||||
|
||||
std::shared_ptr<Nz::MaterialInstance> planeMat = Nz::MaterialInstance::Instantiate(Nz::MaterialType::Phong);
|
||||
planeMat->SetTextureProperty("BaseColorMap", fs.Load<Nz::Texture>("assets/dev_grey.png"), planeSampler);
|
||||
planeMat->SetTextureProperty("BaseColorMap", fs.Load<Nz::Texture>("assets/dev_grey.png", srgbTexParams), planeSampler);
|
||||
|
||||
std::shared_ptr<Nz::Model> planeModel = std::make_shared<Nz::Model>(std::move(planeMeshGfx));
|
||||
planeModel->SetMaterial(0, planeMat);
|
||||
|
||||
@@ -106,7 +106,7 @@ int main(int argc, char* argv[])
|
||||
viewer2D.emplace<Nz::NodeComponent>();
|
||||
|
||||
auto& cameraComponent = viewer2D.emplace<Nz::CameraComponent>(&windowSwapchain, Nz::ProjectionType::Orthographic);
|
||||
cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
|
||||
cameraComponent.UpdateClearColor(Nz::Color::sRGBToLinear(Nz::Color(0.46f, 0.48f, 0.84f, 1.f)));
|
||||
}
|
||||
|
||||
return app.Run();
|
||||
|
||||
Reference in New Issue
Block a user