Skip to content

Commit

Permalink
fix: use correct sRGB to linear conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Latios96 committed Oct 15, 2024
1 parent dffda2a commit 633ba1d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "FileTexture.h"
#include "Logger.h"
#include "image/ColorConversion.h"

namespace crayg {
Color FileTexture::evaluateColor(const SurfaceInteraction &surfaceInteraction) {
Expand All @@ -18,11 +19,13 @@ Color FileTexture::evaluateColor(const SurfaceInteraction &surfaceInteraction) {
return fallbackColor;
}

const Color color(result);

if (colorSpace == ColorSpace::RAW) {
return Color(result);
return color;
}

return Color(result).pow(2.2f);
return ColorConversion::sRGBToLinear(color);
}

std::string FileTexture::getType() const {
Expand Down

0 comments on commit 633ba1d

Please sign in to comment.