What's the difference between the SceneManager feature vs enabling/disabling elements dynamically?

danielpetho
danielpetho Posts: 2
edited October 2023 in General #1

I understand that this is a more streamlined approach to load/unload states, scenes and manage resources more efficiently during the experience.

What isn't really clear to me what happens when one loads/unloads a Scene "under the hood"? Is there any difference loading an object with the SceneManager versus enabling/disabling that object dynamically?

What happens when the user first open the lens, how and when the resources will be loaded, when the shaders will be compiled etc etc? Do the Lens still have to compile all shaders, decompress all meshes in the beginning, regardless if their parent objects are enabled or not? Using the SceneManager compiles the shaders on the go?

The documentation isn't really clear about the performance gain here, if there are any.

We have a Sponsored Lens with a lot of textures, materials and mesh resources, and the average activation time / LAT is more than we desire. Obviously we're trying to keep under control, and until now, we just enabled elements later on, or only when we needed them, but I'm wondering it's worth the effort the restructure the project to utilize the SceneManager.

Any help would be greatly appreciated!

Answers

  • Snapchat's SceneManager feature and dynamically enabling/disabling elements serve different purposes in the context of creating interactive and immersive augmented reality (AR) experiences on the platform. Here are the key differences between the two:

    SceneManager Feature:

    Purpose: SceneManager is a core feature of the Snapchat Lens Studio, a tool for creating AR Lenses. It is used to manage the scenes or stages within a Lens experience.
    Organization: SceneManager helps creators organize and structure their Lens experiences by dividing them into multiple scenes. Each scene can have its own set of 3D objects, animations, interactions, and logic.

    Transition:

    Creators can define transitions between scenes, allowing users to move between different parts of the AR experience seamlessly. This can be used to create complex and interactive narratives.
    Example Use: Suppose you are creating an AR game on Snapchat. SceneManager would be useful for dividing the game into scenes such as the title screen, gameplay, and game over screen, each with its own elements and interactions.

    Dynamically Enabling/Disabling Elements:

    Purpose: Dynamically enabling or disabling elements refers to the ability to control the visibility and behavior of specific objects or assets within a scene based on certain conditions or user interactions.
    Granular Control: This approach provides granular control over individual elements within a scene. It allows creators to show or hide objects, trigger animations, or change the behavior of elements based on user actions.

    Interactivity:

    Creators can make the AR experience more interactive by responding to user gestures or inputs. For example, tapping a 3D character to make it perform an action.

    Example Use:

    In an AR Lens that adds virtual furniture to a real room, you might dynamically enable or disable different pieces of furniture based on user selection, allowing them to customize the virtual decor.
    In summary, SceneManager is primarily focused on organizing and managing different scenes within a Lens experience, while dynamically enabling/disabling elements offers fine-grained control over the visibility and behavior of individual objects within a scene. Creators may use both features in conjunction to create more complex and interactive AR experiences on Snapchat. The choice between these approaches depends on the specific goals and requirements of the Lens being developed.