public void OnRenderImage(RenderTexture src, RenderTexture dest) { _auxDirector?.OnRenderImageInternal(src, dest); if (InteractionMode == MTestInteractionMode.Animation && _lastMeasurementFrame != _requestedTestFrame) { MeasurementUtils.SetAnimationToMeasurement(CameraDirector, OneTestConfiguration.SequenceFramesCount, _requestedTestFrame); if (OneTestConfiguration.LightTimelineAsset != null) { MeasurementUtils.SetAnimationToMeasurement(LightDirector, OneTestConfiguration.SequenceFramesCount, _requestedTestFrame); } _lastMeasurementFrame = _requestedTestFrame; } if (_forceMeasurement) { MakeMeasurement(); _forceMeasurement = false; } var dstIsSet = _runnerSupports.Select(c => c.MyOnRenderImage(src, dest)).ToList().Any(c => c); if (!dstIsSet) { Graphics.Blit(src, dest); } _runnerSupports.ForEach(c => c.MyLateOnRenderImage(src, dest)); }
public void Start() { Physics.autoSimulation = false; _requestedTestFrame = OneTestConfiguration.FirstTestFrame; _lineMeasuringModule = new LineMeasuringPpModule(); var cam = GetComponent <Camera>(); _lineMeasuringModule.Initialize(cam); if (_auxDirector == null) { _lineMeasuringModule.SetTargetBuffers(); } else { _auxDirector.SetMeasurementRenderTargets(_lineMeasuringModule.RenderTargets); _auxDirector.StartInternal(); } CameraDirector.playableAsset = OneTestConfiguration.CameraTimelineAsset; var ut = OneTestConfiguration.CameraTimelineAsset.GetOutputTracks().ToList(); CameraDirector.SetGenericBinding(ut[1], cam.GetComponent <Animator>()); MeasurementUtils.SetAnimationToMeasurement(CameraDirector, OneTestConfiguration.SequenceFramesCount, _requestedTestFrame); if (OneTestConfiguration.LightTimelineAsset != null) { LightDirector.playableAsset = OneTestConfiguration.LightTimelineAsset; var ut2 = OneTestConfiguration.LightTimelineAsset.GetOutputTracks().ToList(); LightDirector.SetGenericBinding(ut2[1], PointLightObject.GetComponent <Animator>()); MeasurementUtils.SetAnimationToMeasurement(LightDirector, OneTestConfiguration.SequenceFramesCount, _requestedTestFrame); } _runnerSupports.ForEach(c => c.MyStart(_lineMeasuringModule)); var requiredGauges = _runnerSupports.SelectMany(c => c.RequiredGauges()).Distinct().ToList(); _gauges = MeasurementUtils.CreateGauges(SkeletonizerMaterial, requiredGauges); }