| 863 | } |
| 864 | |
| 865 | [[nodiscard]] glm::vec3 safeNormalize(const glm::vec3& value, |
| 866 | const glm::vec3& fallback) { |
| 867 | const float length = glm::length(value); |
| 868 | return length > 1.0e-8f ? value / length : fallback; |
| 869 | } |
| 870 | |
| 871 | [[nodiscard]] glm::vec3 srgbToLinear(const glm::vec3& value) { |
| 872 | return glm::pow(glm::clamp(value, glm::vec3(0.0f), glm::vec3(1.0f)), glm::vec3(2.2f)); |
no test coverage detected