Click on the Orthographic Camera in the Objects Panel, then in the Inspector Panel click on the "Mask Texture" box and select the segmentation texture. Now that our background image is filling the screen, let's make sure we can see the person! Remember that Portrait Background Segmentation we added earlier? Segmentation is a fancy word for outlining, and the Portrait Background type lets us separate people from the background. As an added bonus, it will work on any screen size, so even if someone uses this lens in Snap Camera on the desktop, our virtual background will look good and have no distortion. The Fill mode will scale the image without causing any stretching. We are going to change it to "Fill" so that the entire screen is filled. The default stretch mode is "Fit" which ensures our entire image is visible without stretching it in any direction. A few rows beneath where we set the screen image texture you'll see a dropdown for the stretch mode. You'll notice that the image doesn't fill the whole screen, nor is the person fully visible. You should now see your image overlaid in the preview. Go ahead and click on the Screen Image, and then over in the Inspector Panel, click on the Texture box and choose one of the images you added. A screen image is 2D only, there is no concept of depth, so it has to be added to an Orthographic Camera which is essentially a 2D only camera. You'll notice that it is nested under a Full Frame Region which itself is nested under an Orthographic Camera. In the Objects Panel, click on the Screen Image that we added earlier. Now that we have our images downloaded and our scene elements added, let's get the green screen effect created. Once you have your images, import them using the Resources Panel. This strikes a good balance between image quality and file size. Fortunately Pixabay provides each image in several different resolutions, so when you download each image, try to find a size around 1280x720. Keep in mind that our lens has an overall size limit of 4 MB, so we need to be conscious of image size. Head on over and download 3-4 images that you like. Pixabay is a great place to find free-to-use images. For this lens I am going to use space backgrounds, but feel free to use whatever you want. When we add a screen image, Snapchat adds a placeholder image to let us know it is there and ready for us to edit. Things are going to look a little weird now over in the preview panel. Start by adding a Screen Image in the Objects panel and then a Portrait Background Segmentation Texture in the Resources Panel. We don't need too much to create this effect. Setting up the sceneįor this effect we are going to start with a blank project. You can preview this effect by clicking here or by scanning the snapcode below. In this Lens Studio tutorial we'll go over how to create a virtual background or green screen effect for your Snapchat lenses.
0 Comments
Leave a Reply. |