Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3D rendering compatibility with Facebook

Discussion in 'Wish List' started by draknir_, Sep 15, 2009.

  1. draknir_

    draknir_

    Joined:
    Sep 1, 2009
    Posts:
    30
    Hi,

    I'm trying to integrate a Unity3D game we're developing with the social functions of Facebook. So far I've had no problems getting the web player and Facebook to communicate data.

    However I am coming up against a wall which I imagine may be bothering other Facebook-Unity developers as well: Facebook pop ups (such as the on-page application settings, extended permission requests and wall post requests) are drawn under the Unity3D web object.

    This was observed in the latest versions of FireFox and Google Chrome. In Internet Explorer some pop ups were observed to overlay correctly, while others were also under the Unity object. In FF/Chrome the pop ups also flickered/z-fought with Unity when scrolling the window up and down.

    While the pop up overlays are not essential to making these applications work, it is a very jarring effect which can ruin the Facebook experience, so I would like to request that the Unity dev team takes some time to see what solutions are possible.

    respectfully,
    draknir
     
  2. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    One trick which might work well for you is to have your Unity app call a Javascript function on the page, which moves the Unity app down, off the page. There are a number of Facebook apps which do this.

    In the same function which calls that Facebook Pop-Up, you move the Unity app down. When the Pop-Up is completed, you bring it back up.
     
  3. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    The Unity player will not integrate nicely with other DOM elements. Your best bet is to hide the player completely if you need to do a Facebook lightbox of some kind...
     
  4. Factoid

    Factoid

    Joined:
    Mar 30, 2008
    Posts:
    69
    Adding my support for improving the web player's integration with DOM elements, if at all possible. Flash does it, hopefully Unity can too.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    flash does not use 3d hardware acceleration, makes stuff a whole lot easier (and two to 10 whole lots slower)
     
  6. Brad-Keys

    Brad-Keys

    Joined:
    May 1, 2006
    Posts:
    161
    Developers will face this more and more as they try to use Facebook, but it's also problematic because a benefit of deploying your game to the web is integrating innovative web technologies into your gameplay or HUD design. This particular issue could be preventing great ideas from coming to life.

    Hiding the game is an option, but not for everyone. This problem is a deal-breaker for some developers and should be addressed.
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    There isn't much that can be done actually.
    Unity itself is not part of the page. it reserves a rect within the website which corresponds to the desktop size of the player, but the 3D context is outside the browser (browsers have no support for such stuff as 3d hardware accelerated lowlevel access,webgl won't change that with its js 3d support).
    Thats why trying to overlay it can only fail if you don't pause / hide the webplayer (it will refresh the screen and will near granted be in front again)

    but it has been shown in the past that you can use flash and unity in conjunction so there are ways, they just are not as easy as "show div - be happy"

    also there are over half a dozen facebook games that just work.
     
  8. Brad-Keys

    Brad-Keys

    Joined:
    May 1, 2006
    Posts:
    161
    Has anyone posted more details on using Flash and Unity together to achieve this? I searched around with no luck. If not, do you know of an existing example you could point me to?

    I've seen developers use Flash as a border around a Unity game, but I've never seen Flash overlay the web player.
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Thats the solution I meant.

    You can't overlay unity while its active, its 3d context refresh will overdraw anything (nothing in the browser window can ever be in front of the 3D context as long as it is actively rendering)
     
  10. Brad-Keys

    Brad-Keys

    Joined:
    May 1, 2006
    Posts:
    161
    Yeah, I thought so.

    What I meant in my first post is there's probably a solution Unity Tech would have to implement. And hopefully they will. They're smart :wink:
     
  11. samirez

    samirez

    Joined:
    Feb 21, 2010
    Posts:
    3
    This seems to have gotten better in the last couple weeks. I see FB popups and chat rendering over the unity window on Firefox and Chrome on Mac. Firefox on PC seems to intermittently work.

    Did Unity change something? Or facebook? I assumed Unity would have to run in software mode for this to work at all.
     
  12. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    I would think that this is a Facebook issue and they should develop their site to allow content and not have developers make builds so that relatively few that would use Facebook would be able to beat their site.. Never could see the big draw to data mining sites run in the background by guv intel.

    Just a blusterin'
    Bluster T Hogwash
     
  13. dbp

    dbp

    Joined:
    Mar 3, 2010
    Posts:
    324
    sorry to bump this old post, but the request forms (almost) work on my system (windows xp, firefox 3.6.3). the only thing that still gets hidden is the shadow-like border around the form, which isn't essential, but it can be a little irritating when the form just partly overlaps the web player. did they fix the "flickering" already or is it just working on my system?
     
  14. ThanNewell

    ThanNewell

    Joined:
    May 4, 2011
    Posts:
    9
    Most dialogs work, however the crucial one for us, the pay dialog, does not. Any ideas? Hiding the unity player also no longer seems to work.