Skip to content

Commit

Permalink
Suppress division by zero warning in Math.hlsl
Browse files Browse the repository at this point in the history
  • Loading branch information
Delt06 committed Jun 9, 2023
1 parent a60078a commit 7d905d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Packages/com.deltation.toon-rp/ShaderLibrary/Math.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

float InverseLerpUnclamped(const float a, const float b, const float v)
{
#pragma warning (disable : 4008) // Suppress the division by zero warning
return (v - a) / (b - a);
#pragma warning (restore : 4008)
}

float InverseLerpClamped(const float a, const float b, const float v)
Expand Down

0 comments on commit 7d905d9

Please sign in to comment.