mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:53:32 +02:00
Remove toLinearVec3 from ColorUtils
toGamma22Vec3 should probably stay since that is a valid conversion from linear to a gamma space of 2.2.
This commit is contained in:
parent
a1171a33fd
commit
ae5ef6d948
1 changed files with 1 additions and 8 deletions
|
@ -21,8 +21,7 @@ class ColorUtils {
|
|||
public:
|
||||
inline static glm::vec3 toVec3(const xColor& color);
|
||||
|
||||
// Convert from gamma 2.2 space to linear
|
||||
inline static glm::vec3 toLinearVec3(const glm::vec3& srgb);
|
||||
// Convert to gamma 2.2 space from linear
|
||||
inline static glm::vec3 toGamma22Vec3(const glm::vec3& linear);
|
||||
|
||||
// Convert from sRGB gamma space to linear.
|
||||
|
@ -42,12 +41,6 @@ inline glm::vec3 ColorUtils::toVec3(const xColor& color) {
|
|||
return glm::vec3(color.red * ONE_OVER_255, color.green * ONE_OVER_255, color.blue * ONE_OVER_255);
|
||||
}
|
||||
|
||||
inline glm::vec3 ColorUtils::toLinearVec3(const glm::vec3& srgb) {
|
||||
const float GAMMA_22 = 2.2f;
|
||||
// Couldn't find glm::pow(vec3, vec3) ? so did it myself...
|
||||
return glm::vec3(glm::pow(srgb.x, GAMMA_22), glm::pow(srgb.y, GAMMA_22), glm::pow(srgb.z, GAMMA_22));
|
||||
}
|
||||
|
||||
inline glm::vec3 ColorUtils::toGamma22Vec3(const glm::vec3& linear) {
|
||||
const float INV_GAMMA_22 = 1.0f / 2.2f;
|
||||
// Couldn't find glm::pow(vec3, vec3) ? so did it myself...
|
||||
|
|
Loading…
Reference in a new issue