Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Multiple Tiny experiences rendered in a single webpage / app screen

Discussion in 'Project Tiny' started by jfaust-fy, Dec 7, 2020.

  1. jfaust-fy

    jfaust-fy

    Joined:
    Dec 2, 2020
    Posts:
    5
    I'm looking into Tiny for a use-case which involves multiple different (non-fullscreen) experiences in a single page/app screen. They're "different" in that they'd load different assets, but the code would be identical.

    I've been looking through the various support packages for web/Android/iOS, and the idea of a single engine instance seems pretty baked in.

    There are some workarounds possible on the web (like rendering the canvas offscreen and copying to other canvases... only one canvas really needs to run at interactive speeds), but I'm not sure about on mobile.

    Is this possible now? If not, is there any plan to support it?
     
  2. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Currently, you can't have multiple tiny experiences (apps) on the same screen.
    But we support multi-cameras maybe have one camera render Section A of your scene and adjust the rendering Viewport Rect to the first half of the screen and
    have another camera that renders Section A of your scene and adjust the Viewport Rect to render on the second half of the screen.
    Also for the web, we support a custom web template so you can modify the HTML page to include multiple canvases.
     
  3. jfaust-fy

    jfaust-fy

    Joined:
    Dec 2, 2020
    Posts:
    5
    To expand a little bit - the goal is to embed into existing apps, which makes that kind of viewport management difficult. Those apps may have multiple viewcontrollers/activities, and they also may not be able to render in front of the Unity viewport in a way that'll work. Maybe we can instantiate Unity with a shared rendering context, render off-screen and blit the render target into a native view?

    RE: the web, to make sure I understand correctly: I can add multiple canvases, but Unity will only use the one with UT_CANVAS as its id? I was looking at the javascript output by the Tiny build, and I didn't see any way to instantiate the engine multiple times (once for each canvas).
     
  4. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Yes, you are correct Tiny will look for UT_CANVAS so you can't use tiny multiple canvases
     
  5. jfaust-fy

    jfaust-fy

    Joined:
    Dec 2, 2020
    Posts:
    5
    Thanks for the responses! Do you know if these are use-cases that are on the roadmap? Or are they too far off the beaten path?
     
  6. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    123
    Hello, these are interesting use cases. Being able to embed experiences built with Project Tiny without restriction is on the backlog but we haven't yet prioritized nor scheduled it. So you should not expect it soon.
    As a side note, we've learnt a lot from making "Unity as a Library" a supported feature ;-)(https://docs.unity3d.com/Manual/UnityasaLibrary.html).
     
    jfaust-fy likes this.