Graphics: Add gamma correction

This commit is contained in:
SirLynix
2023-09-10 14:34:56 +02:00
committed by Jérôme Leclercq
parent 041be74b9d
commit d40b8af68d
12 changed files with 269 additions and 10 deletions

View File

@@ -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);