private VFXExpression BuildRandomUIntPerParticle(VFXExpression max, int id) { //TODO : Add support of proper integer random var rand = VFXOperatorUtility.BuildRandom(VFXSeedMode.PerParticle, false, new RandId(this, id)); VFXExpression r = new VFXExpressionCastFloatToUint(rand * new VFXExpressionCastUintToFloat(max)); r = VFXOperatorUtility.ApplyAddressingMode(r, max, VFXOperatorUtility.SequentialAddressingMode.Clamp); return(r); }
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { var rand = VFXOperatorUtility.BuildRandom(seed, constant, new RandId(this), inputExpression.Length > 2 ? inputExpression[2] : null); return(new[] { VFXOperatorUtility.Lerp(inputExpression[0], inputExpression[1], rand) }); }