-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1dcc87
commit 55f7984
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#include "PostProcessing.h" | ||
|
||
Spectrum Reinhard::ToneMapping(const Spectrum& color) { | ||
RGBSpectrum Reinhard::ToneMapping(const RGBSpectrum& color) { | ||
float luminance = Luminance(color); | ||
|
||
return color / (1.0f + luminance / limit); | ||
} | ||
|
||
Spectrum Uncharted2::ToneMapping(const Spectrum& color) { | ||
auto F = [](const Spectrum &x) noexcept { | ||
RGBSpectrum Uncharted2::ToneMapping(const RGBSpectrum& color) { | ||
auto F = [](const RGBSpectrum &x) noexcept { | ||
return (x * (a * x + c * b) + d * e) / (x * (a * x + b) + d * f) - e / f; | ||
}; | ||
|
||
return F(1.6f * color) / F(white); | ||
} | ||
|
||
Spectrum ACES::ToneMapping(const Spectrum& color) { | ||
RGBSpectrum ACES::ToneMapping(const RGBSpectrum& color) { | ||
return (color * (a * color + b)) / (color * (c * color + d) + e); | ||
} | ||
|
||
Spectrum PostProcessing::GetScreenColor(const Spectrum& color) { | ||
Spectrum screenColor = LinearToSRGB(toneMapper->ToneMapping(color * std::exp2(exposure))); | ||
RGBSpectrum PostProcessing::GetScreenColor(const RGBSpectrum& color) { | ||
RGBSpectrum screenColor = LinearToSRGB(toneMapper->ToneMapping(color * std::exp2(exposure))); | ||
|
||
return screenColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters