Lots of people have asked me to make a tutorial on how i made my "camera roll upload" lens.
In this tutorial, i will be using Render Targets & scene config.
First step is to get another Render Target, that we can use in Live Target.
Right click, and rename it to Live Target, rename the other one to Capture Target.
After that, go to scene config, and set it like this:
When both is set, we need to make a Orthographic Camera.
Because i am lazy, I will make Lens Studio make one for me by a simple trick.
Click "Add new" and find "Screen Image"
Click on Orthographic Camera, and you will see Inspector for Orthographic Camera on right side of lens studio.
We want to change "Render Target" in Orthographic Camera to Live Target.
Now we need to import "From Image Picker"
Now we need to connect Image Picker to the Screen image lens studio made for us under Orthographic Camera.
You can choose what kind of Strech mode you want, but i like to pick "Fill and cut" for these kind of lenses.
Now we want to make the Screen Image smaller so it dont take up the whole screen.
Now we want to make another Camera with Screen Image, We will do this with a quick trick.
Go to add new and find screen image. Lens Studio will create one for you.
You should now have 2 camera that is called Orthographic Camera.
We want to edit the new one, and change the layer to Default layer.
Click on the Green dot to edit, change the layer to Default Layer in screen image as well.
It should now look like this:
Click on Screen Image 2 under the newest camera, and change the texture to Image Picker and change Strech Mode to Fill. You can play around with these modes to find your favourite.
It should look like this:
It's ready to get published.
If you want to make sure it passes the review, add behavior script to enable the images when face is detected.
Go to add new and look for "Helper script", you will find behavior script there,
Create a scene object by right clicking under Objects.
Find Behavior script, and drag it to Inspector in Scene Object that got made by Lens studio.
this will disable the screen images if it cant find a face.
You only need to select Full Frame Region in the First Camera with a green dot next to it.