Fix normalizeHDRColor with vec4 (#9528)

This commit is contained in:
jk20012001
2021-10-22 18:37:43 +08:00
committed by GitHub
parent a5a5ff9d38
commit 8dc0fee925
+4 -4
View File
@@ -43,11 +43,11 @@ const _qt = new Quat();
// Normalize HDR color
const normalizeHDRColor = (color : Vec4) => {
const intensity = 1.0 / Math.max(Math.max(color[0], color[1]), color[2]);
const intensity = 1.0 / Math.max(Math.max(Math.max(color.x, color.y), color.z), 0.0001);
if (intensity < 1.0) {
for (let i = 0; i < 3; ++i) {
color[i] *= intensity;
}
color.x *= intensity;
color.y *= intensity;
color.z *= intensity;
}
};
/**