void Start() { if (FaceTrackErrorEffectMat == null) { Debug.LogError("FaceTrackErrorEffectMat is not set. You must set it."); return; } _srdManager = SRDSceneEnvironment.GetSRDManager(); var srdCameras = new SRDCameras(_srdManager); var camEvent = CameraEvent.BeforeImageEffects; var commandBufNameBase = "FaceTrackErrorEffect"; _cmdBufCtrlerL = new CommandBufferController(srdCameras.LeftEyeCamera, CreateFaceTrackErrorEffectCommand(commandBufNameBase + "L"), camEvent); _cmdBufCtrlerR = new CommandBufferController(srdCameras.RightEyeCamera, CreateFaceTrackErrorEffectCommand(commandBufNameBase + "R"), camEvent); _srdManager.OnFaceTrackStateEvent.AddListener(this.GetFaceTrackState); FaceTrackErrorObject.SetActive(false); _faceTrackErrorObjMat = FaceTrackErrorObject.GetComponent <MeshRenderer>().material; _defaultErrorObjAlpha = _currentErrorObjAlpha = _faceTrackErrorObjMat.GetFloat("_Alpha"); }
protected override void OnCreateSwapchainImage(VKImage image) { base.OnCreateSwapchainImage(image); CommandBufferController cb; CommandBuffer[image] = cb = new CommandBufferController(Graphics, image); cb.Begin(); cb.Clear(Color.CornflowerBlue); cb.BeginPass(Pipeline); cb.Draw(Graphics.Square, Instances, Billboards); cb.EndPass(); cb.End(); TextRenderer.AddImage(image); MeshRenderer.AddImage(image); ParticleRenderer.AddImage(image); }
public void AddImage(VKImage image) { var cb = new CommandBufferController(Graphics, image); CBuffer.Add(image, cb); }