fix opacity conversion when 0.0, remove extraneous clamp
The opacity value ranges from NEGATIVE_INFINITY to POSITIVE_INFINITY and at opacity === 0.0 the sigmoid will return 0.5. The original code would convert this to an alpha of 255 instead of 128. It is possible that the condition is intended to catch an undefined opacity, so I have made that explicit. If this is not the case, then the ternary condition can be removed entirely. However if there is a possibility of opacity === null, that should be handled as well. The sigmoid function cannot return < 0 or > 1 so the clamp is not needed.
Fixes # I don't think there's bug report, but I've been having problems with opacity and went into the engine to find out why.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.
sorry about the lint fail, it appears my editor inserted spaces on an empty line
Hi @pjbaron,
What problems have you been having with opacity?
Can you provide us a repo we can test with?
Thanks!
@slimbuck it was the separate clones of 'center' which were making my morph targets appear transparent, not opacity as I had previously thought. I commented with more details about that on a separate issue about optimisation/redesign of the splatting system.
Closing this as the solution does not seem needed. Please update the description / change the PR based on the feedback if this is not correct.