fix: fixed shader compilation in some platforms

The overload abs(float4x4, float4x4) is not present in some platforms
supported by Unity
Decomposing the operation fixes the problem
pull/122/head
jnncoutinho 2021-04-27 16:06:27 +02:00
parent 7aec93c09c
commit 32c11b6529
1 changed files with 8 additions and 1 deletions

View File

@ -9,7 +9,14 @@ half4 _MaskInteraction;
fixed Approximately(float4x4 a, float4x4 b) fixed Approximately(float4x4 a, float4x4 b)
{ {
float4x4 d = abs(a - b); float4x4 d = a - b;
d = float4x4(
abs(d[0]),
abs(d[1]),
abs(d[2]),
abs(d[3])
);
return step( return step(
max(d._m00,max(d._m01,max(d._m02,max(d._m03, max(d._m00,max(d._m01,max(d._m02,max(d._m03,
max(d._m10,max(d._m11,max(d._m12,max(d._m13, max(d._m10,max(d._m11,max(d._m12,max(d._m13,