The gallery picker lets people add an image from their phone’s camera roll to an effect in Instagram, like a green screen.
To create an effect with the gallery picker, all you need to do is add the gallery texture to a material in your scene. The material can be applied to any object, for example a 3D object or a rectangle to create a segmentation effect.
You can also download and adapt this template project. The project is similar to Instagram's Green Screen effect. It lets someone add a photo or video from their device to the background of an effect. The project includes a script and patch graph that detects the width and height of the photo or video and resizes it in-line with the size of the device screen.
The gallery picker can't be used with effects on Facebook. You'll need to publish any effects that include the gallery texture to Instagram.
First create the gallery texture:
A texture labeled galleryTexture0 will be listed in the Assets panel.
To render the texture in the scene, add it to the Texture property of a material:
The material can then be added to a scene object, depending on the type of effect you want to create.
The gallery texture won’t be visible in the Simulator. To see your effect on a device, use the Send to App option instead.
By default, the gallery texture renders as a blank white color. You can add a texture or color to the gallery texture, to be replaced with the image selected by the person using your effect.
To do this:
To send the effect to the Instagram app:
If an effect includes the gallery texture, an add media button will appear at the bottom of the effect:
People can then browse and add images from their media library.
Edit the gallery texture’s properties to change how it appears in the effect.
Checking this box lets you select an initial texture to show in the effect. This texture will be replaced with the image selected by the person using your effect.
Choose a color or texture:
Any materials the texture is applied to will be listed here.
When planning effects that use the gallery texture, it’s worth considering: