Change softness mode switch statement to expression
This commit is contained in:
parent
f6bcce9778
commit
fe100bb938
|
@ -528,38 +528,17 @@ public class LightMapper
|
||||||
return hit;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
strength = 0f;
|
return mode switch {
|
||||||
var hit = false;
|
SoftnessMode.Standard when light.QuadLit => FourPoint(4f, out strength),
|
||||||
switch (mode)
|
SoftnessMode.HighFourPoint => FourPoint(4f, out strength),
|
||||||
{
|
SoftnessMode.HighFivePoint => FivePoint(4f, out strength),
|
||||||
case SoftnessMode.Standard when light.QuadLit:
|
SoftnessMode.HighNinePoint => NinePoint(4f, out strength),
|
||||||
case SoftnessMode.HighFourPoint:
|
SoftnessMode.MediumFourPoint => FourPoint(8f, out strength),
|
||||||
hit = FourPoint(4f, out strength);
|
SoftnessMode.MediumFivePoint => FivePoint(8f, out strength),
|
||||||
break;
|
SoftnessMode.MediumNinePoint => NinePoint(8f, out strength),
|
||||||
case SoftnessMode.HighFivePoint:
|
SoftnessMode.LowFourPoint => FourPoint(16f, out strength),
|
||||||
hit = FivePoint(4f, out strength);
|
_ => TracePixel(light, pos, polyCenter, plane, planeMapper, v2ds, out strength)
|
||||||
break;
|
};
|
||||||
case SoftnessMode.HighNinePoint:
|
|
||||||
hit = NinePoint(4f, out strength);
|
|
||||||
break;
|
|
||||||
case SoftnessMode.MediumFourPoint:
|
|
||||||
hit = FourPoint(8f, out strength);
|
|
||||||
break;
|
|
||||||
case SoftnessMode.MediumFivePoint:
|
|
||||||
hit = FivePoint(8f, out strength);
|
|
||||||
break;
|
|
||||||
case SoftnessMode.MediumNinePoint:
|
|
||||||
hit = NinePoint(8f, out strength);
|
|
||||||
break;
|
|
||||||
case SoftnessMode.LowFourPoint:
|
|
||||||
hit = FourPoint(16f, out strength);
|
|
||||||
break;
|
|
||||||
case SoftnessMode.Standard:
|
|
||||||
hit = TracePixel(light, pos, polyCenter, plane, planeMapper, v2ds, out strength);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TracePixel(
|
private bool TracePixel(
|
||||||
|
|
Loading…
Reference in New Issue