I’ve been creating a “Camera” app that is able to capture a RawImage and then convert it to Texture2D so I can save it to a png. In other words, make a photo/video.
Now I want to make a Instagram Filter, where I would activate a Canvas with different sprites and shaders, each one according to a filter. For example: Canvas1 = Filter1, Canvas2 = Filter2, etc… and then control if they are active or not with buttons selections.
The question here is: if I can capture the RawImage, there is a way to capture the Webcam + the Filters/Canvas WITHOUT capturing the UI (buttons, texts, etc…) and then export it to Photo/Video?
Thanks!
Usually you just turn off (either disable or SetActive(false)) the items you don’t want to capture, then do the capture.
1 Like
As far as I recall, the process is a little more complicated. Does this still hold true today?
- SetActive(false) things you don’t want to capture
- wait for the next frame
- do a ScreenCapture or similar
- SetActive(true) the things you didn’t want to capture
This however causes the view to visibly flicker the mentioned things for a frame.
There’s also the option to use a second Camera with a mask to hide undesirable objects by their layer, and render that camera to a texture on demand. You may also need to sync the screenshot camera transform to the main camera’s transform if you want the exact same viewpoint, plus any lens settings (fov and so on).
The second camera approach used to be the solution to avoid the flickering plus any maintenance overhead of keeping track of what you set inactive. But you can’t use the built-in ScreenCapture I think because that always uses the MainCamera.
Everything recalled from memory. 
1 Like