Settings

Theme

A browser plugin for Unity

blog.mozvr.com

154 points by imoldfella 5 years ago · 39 comments

Reader

nwah1 5 years ago

You can also render Unity inside of Firefox. Infinite recursion potential.

chrismorgan 5 years ago

The current title here on HN of “Firefox in Unity” is incorrect. This is based on Servo, not Firefox. From what I understand as a very casual observer that hasn’t been keeping up with things, Servo’s architecture is rather more conducive to this application both in embedding convenience and rendering, being able to render pages in a way that will make them perfect quality regardless of your 3D perspective, whereas I imagine Firefox might still be at the “rasterise the viewport and use it as a tile” level, though maybe WebRender (applying Servo’s renderer to Firefox) has resolved that? As I say, I haven’t been keeping up with things. Anyway, the correct title for the article is “A browser plugin for Unity”.

  • dang 5 years ago

    Ok, we've changed the title to what the article says.

    "Please use the original title, unless it is misleading or linkbait; don't editorialize."

    https://news.ycombinator.com/newsguidelines.html

    • andybak 5 years ago

      Whilst I understand the motivation behind this guideline, it seems to be applied with little regards for it's usefulness.

      Post titles need more context than the original article title because posting to HN strips out most of that original context.

      • dang 5 years ago

        You probably have that perception because cases that you dislike stand out like sore thumbs, while all the other title edits escape notice. If you think about it, that pretty well guarantees the feeling "it seems to be applied with little regards for its usefulness"—because all the "useful" edits are by definition excluded.

        You can use petercooper's title edit tracker to see some of them: https://hackernewstitles.netlify.app/. It doesn't show all of them, and it doesn't distinguish between edits by submitters and edits by mods. Probably we should just publish the official list—I feel like title editing is the most consistent and easily defensible thing we do.

        • andybak 5 years ago

          Thanks for the reply.

          What do you feel would be the harm if the policy was modified to

          > "Please use the original title, unless it is misleading or linkbait or lacks sufficient context; don't editorialize."

          It just seems like there's frequently times when the original title is completely baffling out of situ.

          • dang 5 years ago

            The issue there is that sometimes a little bafflement is a good thing. Not too much, not too often, but enough to make readers work a little: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que.... It slows the mind down and makes it engage a bit in figuring-things-out mode, which is good for curiosity. I think it's a valuable mechanism for interrupting the internet reflex brain, with its rapid reactions to literally everything, that mostly governs us online.

      • leeoniya 5 years ago

        agreed.

        this policy applied as dogma does more harm than good on a frequent basis here. especially given the clear nature of this article where there's no debatable nuance.

  • c-smile 5 years ago

    > "rasterise the viewport and use it as a tile"

    Yes, rendering HTML/CSS using solely Unity's backend is problematic at best.

    For the Unreal Engine though it is perfectly feasible.

    Here is Sciter Engine (HTML/CSS/script) rendered directly into DirectX scene: https://sciter.com/see-sciter-lite-unreal-engine-in-theaters... using Sciter's DX rendering backend.

meesterdude 5 years ago

This is something I've wanted for years, for numerous uses like collaboration, Method of loci, and documentation. Overlaying our built-in spatial awareness with focused data is an area of information architecture with a lot of untapped potential.

there is also this which allows multiple windows within unity (there's a demo you can try): https://zenfulcrum.com/browser

  • chrisweekly 5 years ago

    "Overlaying our built-in spatial awareness with focused data is an area of information architecture with a lot of untapped potential."

    +1 for this; couldn't agree more

Guest81 5 years ago

This seems similar to ZFBrowser which implements chromium in unity, and is used by Tabletop Simulator. I wonder how the performance compares?

ourcat 5 years ago

I remember when this sort of functionality arrived in Second Life.

It enabled a lot of easy 'shared experiences'. eg: Watching a live video stream of an event with people, or group presentations etc.

robterrell 5 years ago

As the author of the first web browser plugin for Unity (HTMLTexture) I must say I'm very impressed by this. Kudos.

Sounds like Unity has changed enough under the hood that the technique I used (calling gl_bind() behind Unity's back, using the texture ID you pass in, to basically write to the texture Unity is using for your mesh) no longer works.

callumprentice 5 years ago

For anyone else looking to embed a modern browser in their Windows/macOS/Linux* C++ application, you might consider Dullahan: source: https://bitbucket.org/lindenlab/dullahan/src/master/ and example screenshot: https://bitbucket.org/lindenlab/dullahan/raw/master/docs/web...

I recently updated it to use Chromium 81 and would have updated it to the most recent version (84) if there weren't some non-trivial changes needed to make video/audio streaming work again.

It's what we use in Second Life and would welcome other users' comments to help improve it.

dleslie 5 years ago

What are the security guarantees about this?

  • devwastaken 5 years ago

    Exactly this. Vrchat had chromium for a while, but exploits got it removed. Itd be great if it was just a static browser engine, no Js, with a strong sandbox. So at most all that can be done is messing with the browsers runtime memory itself, not the system it's on.

gfxgirl 5 years ago

I'm sure having a browser in game as a million uses but ...

Oculus Rift has in game browser built into their OS. In any game and any time I can pull up a browser in VR (or any desktop app). Pin a walkthru up. Pin up video chat with a friend.

It seems like browser in VR would be better served at an OS level. The OS could provide a way for the app to request VR be placed in the scene. Ideally it happens in a way the app can't look at the screen since a game shouldn't be able to look at the contents of your browser window.

jayd16 5 years ago

>As we do not have control over the binding of the texture and the Unity context, the current design for updating this texture uses a blit (copy) via Servo’s surfman-chains API

I don't think this is necessary. You should be able to make Texture objects that ref existing native textures in Unity and I've been able to use OES_EGL_image_external extensions to sample Android decoded video textures sampled from Unity shaders.

Its not the most widely available option but the perf is much better.

  • phil_moz 5 years ago

    The issue is not access to an external texture, it's access to an external texture on the right thread in the right GL context. We did look at writing a new backend for surfman to integrate directly, but it's a bit of work and not at all cross-platform, so this was not a goal of the project at this stage. I'd like to find a way to avoid the blit though, so I'm continuing to experiment in this direction.

arendtio 5 years ago

What is wrong when something cool like this triggers a response along the lines of 'finally I can get tracked while being in-game'?

twoodfin 5 years ago

I’m a little disappointed the WebGL demo didn’t show what happens when the “outer” viewport moves.

bzb3 5 years ago

More like Servo in Unity... And from what I recall, Servo is not even an alpha at this point

  • tashoecraft 5 years ago

    I don’t believe servo is ever intended to be more then a testbed for integrating components into Firefox core. It’s modular, and pieces of it have already been merged and are used in Firefox. So my interpretation of this is that they are using their more modern code to test out this feature and if it’s solid enough and useful enough it can be pulled into core.

    • mook 5 years ago

      I thought they _originally_ intended for servo to perhaps someday be its own thing; I had this impression specifically because I think they had at some point aspirations for servo to have a stable embedding API (to let other applications use it as a rendering engine). Of course I don't think that's the case anymore.

      • chrismorgan 5 years ago

        There was explicitly never any plan for Servo to be a product on its own. Note that this does not mean that there was an explicit plan for Servo never to be a product.

    • sitkack 5 years ago

      Given the complexity of a browser, having a test bed to vet ideas and techniques before trying to renovate the Tower of Babel while folks are using it makes a ton of sense.

      So much of what the folks around Rust have done is really the systematic and pervasive application of science. A shining example of what humans are capable of.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection