Skip to content

Commit

Permalink
Update cImageProcessing.fxh
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Jun 17, 2023
1 parent 802f051 commit 8250b36
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions shaders/cshade/shared/cImageProcessing.fxh
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,9 @@
const float IHalfPi = 1.0 / (Pi / 2.0);
const float2 White = float2(atan2(1.0, 1.0), asin(sqrt(2.0) / sqrt(3.0)));

float SumRG = length(Color.rg);
float SumRGB = length(Color.rgb);

float2 P = 0.0;
P.r = atan2(Color.g, Color.r);
P.g = (SumRGB == 0.0) ? 0.0 : asin(SumRG / SumRGB);
P.g = asin(length(Color.rg) / length(Color.rgb));
P = (isinf(P) || isnan(P)) ? White : P;
return saturate(P * IHalfPi);
}
Expand Down

0 comments on commit 8250b36

Please sign in to comment.