Replaced noise fade with soft fade

This commit is contained in:
Maximilian Giller 2023-01-23 02:26:36 +01:00
parent 36174e353e
commit 43b5afe164

View file

@ -121,20 +121,22 @@ Color ToneShader::shade(const Scene &scene, const Ray &ray) const
{
float transition =
(brightness - MIDTONE_HIGHLIGHT_THRESHOLD) / (HIGHLIGHT_THRESHOLD - MIDTONE_HIGHLIGHT_THRESHOLD);
if (randomDistribution(dev) < transition)
tone = highlightColor;
else
tone = midtoneColor;
tone = highlightColor * transition + midtoneColor * (1 - transition);
// if (randomDistribution(dev) < transition)
// tone = highlightColor;
// else
// tone = midtoneColor;
} else if (brightness > MIDTONE_THRESHOLD)
{
tone = midtoneColor;
} else if (brightness > SHADOW_MIDTONE_THRESHOLD)
{
float transition = (brightness - SHADOW_MIDTONE_THRESHOLD) / (MIDTONE_THRESHOLD - SHADOW_MIDTONE_THRESHOLD);
if (randomDistribution(dev) < transition)
tone = midtoneColor;
else
tone = shadowColor;
tone = midtoneColor * transition + shadowColor * (1 - transition);
// if (randomDistribution(dev) < transition)
// tone = midtoneColor;
// else
// tone = shadowColor;
} else
{
tone = shadowColor;