Lens Studio - Virtual Background (and some basic scripting)

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Add a virtual background or green screen effect to your Snapchat filters using segmentation in Lens Studio! You'll learn how to use some basic scripting to cycle through different background images when the user taps the screen. Don't worry if you have zero coding experience, we'll walk through the whole process step-by-step.
    Read the text version of this tutorial and view the completed script -- learn.arbootca...

КОМЕНТАРІ • 40

  • @pranaxr
    @pranaxr Рік тому +1

    thank you so much for this tutorial, I finally feel confident with using scripts in my lenses!! thanks

  • @CliffordManthey
    @CliffordManthey 2 роки тому

    That was Awesome you are the best I ever watched on UA-cam! I have watched 1000's and you ROCK! Thanks, Clifford Manthey

  • @NT-sd6mf
    @NT-sd6mf 3 роки тому +1

    Thank you so much bro
    Here you crown 👑

  • @JAustria04
    @JAustria04 3 роки тому +1

    this worked. Thanks so much!!

  • @metubeismine
    @metubeismine Рік тому +1

    Tysm 🎉

  • @JDavinoM
    @JDavinoM 3 роки тому +2

    This is exactly what I needed. Thank you man

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому

      Glad to hear!

    • @JDavinoM
      @JDavinoM 3 роки тому

      @@ModelsbyMike3d Thanks alot. I have a question if you don't mind. Would you happen to know how I'd go about adding a filter to the entire lens ? I have a gif in the background and Ive scripted a song and the gif to both play when you lower your eyebrows. I'd also want the lens to get a dark grainy filter at the same time but it only ever adds the filter to the background. I can get it on both if I mess with the masks, but for some reason the background gif is brought forward.

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому +1

      Hi David, I'll describe a couple methods that work for me.
      Create a new camera at the bottom of your scene hierarchy. Create a new render target and a new layer. Set the camera to be on just the new layer and set its render target to your new render target. Check the "Clear Color" box and choose the original render target for the input. In your scene config, set the capture and live targets to your new render target. If you place your effects under the new camera and set the layer to your new layer, you can apply effects to the whole thing. Example screenshot -> drive.google.com/file/d/1FJ8tyKP3dO5T_BgS_kMvtSX0JN_K8p3N/view?usp=sharing
      More info on render targets and layers -> lensstudio.snapchat.com/guides/general/camera/
      Alternatively, take the mask off of the orthographic camera. Create a new screen image and an Unlit material. Apply your unlit material to the new screen image, set the texture as the device camera texture and set the opacity texture as the segmentation texture (you might need to go into the segmentation texture settings and invert it, and change the blend mode of the material to Normal to be able to choose an opacity texture). If your grain is just an image/video overlay, you can create a new screen image for that. Example screenshot -> drive.google.com/file/d/1zUl3p870mS2nJmmmFy9mTB9gHfNN8kLp/view?usp=sharing
      Hopefully that isn't too cryptic. A little tricky to explain here. I think it's a good enough topic to make its own standalone tutorial, but I can't guarantee when I would make it.

    • @JDavinoM
      @JDavinoM 3 роки тому +1

      @@ModelsbyMike3d Thanks a lot for the input, I appreciate it. I think I understand, I'll give it a shot and let you know how it goes. Again, thank you !

    • @JDavinoM
      @JDavinoM 3 роки тому

      @@ModelsbyMike3d The first method worked perfectly. It's great. Thank you so much. I made a filter of Punished/Venom Snake from Metal Gear Solid V if you're familiar.

  • @dwiatmokopurbosakti1193
    @dwiatmokopurbosakti1193 3 роки тому +1

    really helpfull thanks man

  • @theprideofthenorthsports
    @theprideofthenorthsports 3 роки тому

    thank you, for this tutorial on the background. my request is if you could show me how to do a beard and glass to what you already did with this tutorial.

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому

      Check out this tutorial: ua-cam.com/video/7ShD5Y9N3dw/v-deo.html

  • @MrCaveyDavey
    @MrCaveyDavey 4 роки тому +1

    Just what I was looking for and at exactly the right time, thank you! Do you know if there is any way of creating a simple transition or fade between each image on clicking?

    • @ModelsbyMike3d
      @ModelsbyMike3d  4 роки тому +2

      Glad I could help! A transition is possible, but it would take quite a bit more setup and probably more scripting. There are a few recommendations on how to do that on the forum, but not complete examples: support.lensstudio.snapchat.com/hc/en-us/community/posts/360058560171-transitions
      I’ll look into making a tutorial for that sort of effect though, it’s a great idea!

    • @MrCaveyDavey
      @MrCaveyDavey 4 роки тому

      @@ModelsbyMike3d Awsome, thanks for your help :-)

  • @footballdiaries6793
    @footballdiaries6793 2 роки тому

    Collage type lens Tutorial please

  • @thuyduongtran1114
    @thuyduongtran1114 11 місяців тому

    Thank you for the tutorial! however I got this error while doing the script as it said "TypeError: cannot read property 'mainPass' of undefined". Can you help me with this error?

    • @ModelsbyMike3d
      @ModelsbyMike3d  7 місяців тому

      It sounds like you need to choose the material input for the script.

  • @Binahmid07
    @Binahmid07 2 роки тому

    How can take the file

  • @AlanFehr
    @AlanFehr 3 роки тому

    This is great, except I'm also using a 2D face object, and the segementer cuts that out too. Can't find any documentation on having a 2D object that can sit on top of a background.

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому +1

      This tutorial from Brandon will help: ua-cam.com/video/7ShD5Y9N3dw/v-deo.html

  • @johanmalmberg180
    @johanmalmberg180 2 роки тому

    Is it possible to put a screen image on top of everything. One that will not be segmented and with the script still working?

    • @ModelsbyMike3d
      @ModelsbyMike3d  2 роки тому

      It is! Just skip the segmentation part. The script will work regardless.

    • @johanmalmberg180
      @johanmalmberg180 2 роки тому

      @@ModelsbyMike3d Thanks but i still want the segmentation but a screen image over it

    • @ModelsbyMike3d
      @ModelsbyMike3d  2 роки тому

      @@johanmalmberg180 That will also work. The script will cycle through whichever images you give it. It's just a matter of setting up your lens.

  • @guinso
    @guinso 3 роки тому

    Hey man thanks for the tutorial! But i have a question. How do you make the background image move like as if you are moving the phone then the image background move as well? Cuz right now its all static. Thanks man!

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому +2

      If you have a 360 degree image then you can place a sphere around the camera and apply the image texture to that (rather than using a Screen Image). If you have a regular image, then you'll have to do some scripting to add the parallax effect as you move the phone.

    • @guinso
      @guinso 3 роки тому

      @@ModelsbyMike3d thanks man will try that. But no idea about scripting 😂. Anyways great tutorial.

  • @gentgoystein3461
    @gentgoystein3461 3 роки тому

    i need some help doing a cartoon image that blinks and mouth moves.. can you help

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому

      I have created a lens like that, but not sure yet if I'm going to make a tutorial for it. I'll take it under consideration. www.snapchat.com/unlock/?type=SNAPCODE&uuid=1c485f497d4e4cf7a9648f307319c067&metadata=01

  • @noaz3372
    @noaz3372 3 роки тому

    Hi! Thanks for the awesome video, but I copied the script directly from the link, and theres a problem at line 8 (second line it says script.background...).
    the problem is:
    "argument -1: value is not a native object at [anon] () native strict preventsyield at [anon] (script.js:8) preventsyield".
    what should i do?

    • @ModelsbyMike3d
      @ModelsbyMike3d  3 роки тому +1

      Hi Noa, glad you liked the video! If I select the screen image for the Background input but I do not add any values for the Images input, I do get the same error. Do you have all the inputs set on the script? Here's a reference image: learn.arbootcamp.com/snapchat-beginner/virtual_background/script_inputs.jpg

  • @Binahmid07
    @Binahmid07 2 роки тому

    Thanks for your job just do you have telegram because i take the file lenses 🌹

    • @ModelsbyMike3d
      @ModelsbyMike3d  2 роки тому

      I don’t give out the project files. The tutorial goes everything you need to create this type of lens.

  • @starryyangel
    @starryyangel 2 роки тому

    it will not change :(

    • @ModelsbyMike3d
      @ModelsbyMike3d  2 роки тому

      What exactly isn't working? Have you saved the script and added it to your scene?

  • @cupcake4345
    @cupcake4345 3 роки тому

    hi