combining segmentation with post effect and face sprite

  • Hi Image!

    You're right, you'll need to change the way the camera is chained. But you should be able to just redirect what the Segmentation template comes with. 

    By default the chain is Orthographic Camera Masked -> Camera Masked -> Camera -> Orthographic.

    Since we only want the Post Effect to render below the Segmentation we'll do: Camera -> Camera Masked -> Orthographic Camera Masked -> Orthographic. 

    (The result of this guide is linked at the bottom)

     

    So first we'll have the post effect apply over everything. To do this, in the Objects panel, drag the "Post Effect" object to under the Camera object. Then we'll set it's layer to the camera layer. Press the gray circle, and choose default layer.

    Then, what we want to do is render the Segmentation camera output AFTER the Camera output, so it is not affected by the Post effect. To do this, first select the Camera object. In the Inspector panel, set its input to Device Camera Texture by selecting the field and choosing Device Camera Texture inside the Default Texture folder in the pop up. Additionally set its render order to 0, since this is what we want to render first. 

    Then select Camera Masked, and set its Input to Camera Output with a Render Order of 1

    Then, select the Orthographic Camera Mask, and in its Inspector panel, set its Input to Camera Masked Output under the Default Texture folder. 

    Finally, select the Orthographic Camera, and set Orthographic Camera Masked as as its Input

     

    To add the Face Sprite, in the Objects panel, press Add New > Face Sprite. You'll notice that the Post Effect renders on everything again since the camera is set to the Default Layer. Press the blue circle to open the Layer panel, then press Add New. Set the sprite to the same layer so it can be rendered by that camera. You'll also want to select the Perspective Camera, and in its Inspector panel, set its Render Order to 4, since it should be rendered after Orthographic Camera. 

     

    Take a look at this modified project as an example. Can't wait to see what you come up with. 

     

    Let me know if you need any clarification!

    Jon

    Comment actions Permalink
  • Hi Jon,

    Thanks sooo much for this detailed explanation.

    I will attack this lens once more in the coming days.

    I'll keep you updated of course.

    Comment actions Permalink
  • Hi Jon,

    I got it working. Thanks a zillion for the example project too. The whole daisy chaining of camera's and layer render order could use some more in depth explanations in your guide. Or some more examples of use cases.Still just on the cusp of understanding this.

    I did notice, what I think is a BUG. When I add the face sprite, I lose the post effect. Or so it seems. When I just change one texture for another (say the sepia fx for BW) the post fx appears again.

    I have lots lenses to create over the next 2 weeks so hopefully you are out there when I get stuck.

    ;)
    Karen

     

    Comment actions Permalink
  • ha well,  got it kind of working using your segmentation template.
    The post effect can be turned on/off thanks to your script,

    but when adding my image texture I miss the ability to place the texture in it's right place.
    (it's a gif by the way).
    I'm using a shoulder segmentation texture, and my image texture is way up in the neck (so the centre of the image is shifted way upwards).
    How can i get around this using the templat/the standard segmentation controller script)?

    Comment actions Permalink
  • i figured it out finally.


    So here is the lens (part of a AR art series called Grey Matter, 52 original lenses done, and more to come in the next months)
    GREYMA univers


    https://www.snapchat.com/unlock/?type=SNAPCODE&uuid=afe91800218f40f283c18f30b3f5df1e&metadata=01

     

    Comment actions Permalink
Have a comment?

Please sign in to leave a comment.

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?

Version

Graphics

Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:

Name:

Email:

What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!