Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit a56d4b3

Browse files
authored
Merge pull request #61 from keijiro/cgt-ios-metal-fix
(Color Grading) Fix for division-by-zero cases on iOS/Metal
2 parents 26abb19 + 252c021 commit a56d4b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PostProcessing/Resources/Shaders/ACES.cginc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,13 @@ half3 Y_2_linCV(half3 Y, half Ymax, half Ymin)
620620

621621
half3 XYZ_2_xyY(half3 XYZ)
622622
{
623-
half divisor = max(dot(XYZ, (1.0).xxx), 1e-10);
623+
half divisor = max(dot(XYZ, (1.0).xxx), 1e-4);
624624
return half3(XYZ.xy / divisor, XYZ.y);
625625
}
626626

627627
half3 xyY_2_XYZ(half3 xyY)
628628
{
629-
half m = xyY.z / max(xyY.y, 1e-10);
629+
half m = xyY.z / max(xyY.y, 1e-4);
630630
half3 XYZ = half3(xyY.xz, (1.0 - xyY.x - xyY.y));
631631
XYZ.xz *= m;
632632
return XYZ;

0 commit comments

Comments
 (0)