MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / safeNormalize

Function safeNormalize

src/rendering/raster_rendering_engine.cpp:865–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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));

Callers 5

meshVertexNormalFunction · 0.70
computeSoftwareLightVPFunction · 0.70
shadeMeshPixelFunction · 0.70
rasterizeMeshTriangleFunction · 0.70

Calls 1

lengthFunction · 0.50

Tested by

no test coverage detected