Replaced noise fade with soft fade
This commit is contained in:
parent
36174e353e
commit
43b5afe164
1 changed files with 10 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue