Search Unity

How to display web pages in Unity?

Discussion in 'Editor & General Support' started by nikolahristov98, Aug 29, 2018.

Thread Status:
Not open for further replies.
  1. nikolahristov98

    nikolahristov98

    Joined:
    Jun 15, 2018
    Posts:
    5
    Hello, I'm looking for a way to display web pages in Unity for a desktop application that the user can interact with. Something like a browser. I have seen people mentioning uWebKit, Awesomium however they no longer seem to be supported while others cost quite a bit of money. Is there a free asset/kit that I can use to achieve that? Thanks in advance!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    tatsuuuuuuu and nikolahristov98 like this.
  3. ChrisDirkis

    ChrisDirkis

    Joined:
    Jun 1, 2017
    Posts:
    38
    Embedded Chromium (CEF, CefSharp, etc) won't work. Single threaded mode kinda works, but was deprecated a long time back, and multithreaded mode causes the Editor to freak the heck out (maybe because the Asset Store already uses CEF?).

    For desktop, Embedded Browser works well -- it has a separate executable and pipes data between Unity and that, to get around the CEF limitations.

    For mobile, In-App Web Browser appears to be pretty good, it just pipes to the platform's native browser. I think there might be free versions that work too somewhere on the asset store, but really can't be bothered searching now.

    We wanted to do something like Coherent Labs' Hummingbird, since it is much money, but ran into the desktop issues. If you're doing mainly UI, and want to make use of your skills in html-css-js, PowerUI seems pretty good.

    If you don't need the rendering part of Unity, try steer clear. If you're just making a UI based app, there are heaps of better solutions.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    I didn't mean use specifically Embedded Chromium. But rather to embade chromium https://www.chromium.org/Home
    The difference is, first one are already derived projects and it may happen as you pointed out, the solutions may not be supported. Whle the second, is the "pure" chromium, which requires wrapper. This ensuring latest version.

    As of Embeded Browser with chromium, if OP do not target mobile devices, it would work completely fine. I don't know about performance on mobiles. On desktop is spot on. Browsers instances run as separate process, so they can run on separate CPU thread.

    But building cool functional GUI for Unity 2018 application with HTML5 is superb. And lot of resources are available on the net. But I choose this method for two main reasons. Modability, and Blockly integration. I don't need it, but Youtube works as well. So you can watch things in game ;)

    In the end, is up to OP, what he requires.
     
    tatsuuuuuuu likes this.
  5. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    498
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    Only thing is, it targets Unity 5.x, Is it unclear if it supports Unity 2018. Only android is mentioned to support 2018.x.
    So unless interested with Unity 5.x I wouldn't be stressing about it. But saying that, Definitely should give a try on Latest Unity version. Maybe it works out of the box? But quite skeptical.
     
    tatsuuuuuuu likes this.
  7. ChrisDirkis

    ChrisDirkis

    Joined:
    Jun 1, 2017
    Posts:
    38
    It also doesn't support Windows, apparently
     
    bustertm likes this.
  8. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    And this is why, it is hard for good embeded browser in Unity.
    I am in fact surprised that Unity do not provide such feature, out of the box.
     
  9. Patrick-Ward

    Patrick-Ward

    Joined:
    Oct 25, 2018
    Posts:
    1
    The Unity Embedded browser with chromium works well for desktops. It will load anything into your game that chromium can load. Presently, Windows, Mac and Linux are supported, but not Android. So mobile devices are out for the present. Also, it only supports building on the same platform as your target. So if you want to build for (say) a Mac, you have to do it on a Mac. If you work on Windows and you do a Mac build, there will be issues loading the browser when you run the game on the Mac. But it might be possible to tweak it a bit ; I don't know.
     
  10. FelixBarker

    FelixBarker

    Joined:
    Aug 21, 2019
    Posts:
    3
    Hello,
    So I am trying to build my game in WebGL, and embed a web viewer on a mesh object so the player can go on the internet while they are playing the game (standing in front of the mesh object). Is this possible? If so can someone let me know how I can do this?
     
  11. ChrisDirkis

    ChrisDirkis

    Joined:
    Jun 1, 2017
    Posts:
    38
    There's possibly a way to send a message to the Javascript side, asking it to point an IFrame at a webpage and render it to a texture to be sent back to the Unity side. Feels pretty convoluted though.
     
Thread Status:
Not open for further replies.