Search Unity

Unity NaCl question

Discussion in 'Developer Preview Archive' started by timetopat1, Jan 21, 2012.

  1. timetopat1

    timetopat1

    Joined:
    Nov 8, 2010
    Posts:
    53
    I have a couple very simple questions about Native Client support for unity3d. From the demos on the chrome webstore i played and from what i have heard it looks very good.

    1-Will NaCl support be free? Is it just an option on the webplayer like i see currently?

    2-Is it easy to integrate unity projects into the chrome webstore?

    3-Does NaCl Support have any major limitations?

    Thanks for your help
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    1. Yes, NaCl support will be free, just like the normal web player. It is presented as on option on the Web Player build, because the two are very much related. The NaCl player basically plays back the same .unity3d files as the Web Player, when you make a NaCl build, it will generate two html files, one for play back with NaCl and one for playback with the web player.

    2. Yes. Basically you just need to upload the zipped player folder, and provide basic information on the app, such as a description and screenshots.

    3. See your local documentation (as the online one is still for 3.4) on for a list of current limitations in Unity NaCl.
     
  3. timetopat1

    timetopat1

    Joined:
    Nov 8, 2010
    Posts:
    53
    Thanks for the really quick answer. It sounds great and i will look at the local docs.
     
  4. timetopat1

    timetopat1

    Joined:
    Nov 8, 2010
    Posts:
    53
    One last simple question.

    When deploying the project, i build and run and it opens in chrome and is on the chrome app part of chrome. I can launch it from there. When i try to launch it from the nacl html file, it throws an error. This is supposed to happen and how you are suppose to launch it?

    Also the local documentation for unity. On a windows machine what is the directory? At one point i could of sworn i knew it but now when i use mono dev to go to help it sends me online.

    Thanks
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    The easiest way to launch it is by just doing Build Run. Just double-clicking the _nacl.html file won't work, as NaCl is disabled by default, and only enabled for Chrome apps, and NaCl is not allowed for file:// urls.

    To launch it manually, you can either manually install it as a Chrome app (go to chrome://extensions, click "Load unpacked extension", select the folder of your nacl build), or upload it to a web server, enable NaCl (go to chrome://flags, enable NaCl, and restart Chrome), and load the html from there.

    I don't know the paths on windows, but you should be able to access it from the menus.
     
  6. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Is it possible to share the NaCL installs with other, non-unity based machines? We're doing some testing internally and we've been unsuccessful in getting the app to run in test machines that do not have unity installed but do have chrome installed. After installing the app on the extensions page we get this error when we run..

    NaCl module load failed: could not load nexe url.

    is it possible that, since the path's are 100% the same its simply not finding the application? Right now we're only able to build and review on physical build machines but not on any other machines. Is there a step i'm missing? I've yet to place it on a web server for testing as we don't want to externalize any of it, just want to run it through some internal test scenarios.

    Cheers
    Bryan
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Just to make sure: You are not trying to load the app by double-clicking the html? That won't work. You need to install the extension, and then click it's icon in a new tab in chrome (Chrome will display installed apps as icons).
     
  8. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Jonas,

    correct. Initially we did that, and it obviously didn't work correctly but we've actually installed the app (as you mentioned above) via chrome://extensions and thats where we are getting that issue. It shows the app installed (the icon is there on the launch page) but when we run it we get that above noted error. We are building it w/these flags...

    offline deployment - on
    enable NaCL support - on

    Again, i can run it fine (either build and run via unity or installing it via chrome and running it there) locally on a machine that has unity and has previously built the app, but not able to run it on a clean machine w/o unity.
     
  9. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @jonas,

    Still not sure why it won't run locally, but placing it on our web server and accessing it that way works perfectly fine... which (ultimately) is a better test of the process. I would still like to figure out why its not running locally on other machines but its a less of a priority.
     
  10. Vectrex

    Vectrex

    Joined:
    Oct 31, 2009
    Posts:
    267
    Does chrome cache anything? ie if the player visits the same game can it cache the whole thing?
    Also, I find it very weird that NaCl is chrome 'apps' only. In fact, I find it really annoying since chrome 'apps' are just an extremely clumsy way of having bookmarks that you 'install' as far as I can tell.
    If any website could use it, it'd be brilliant and we might see other browsers incorporating it
     
  11. Cameron_SM

    Cameron_SM

    Joined:
    Jun 1, 2009
    Posts:
    915
    NaCl isn't Chrome Apps only, but finding info on how to get it running in other browsers is nigh impossible. Aparently there's plugins that will let it run in Firefox, IE, Opera and Safari on Windows as wells as FF and Camino on Linux and OSX - but I don't think this so called plugin is publically avaliable anywhere, I think you need to download the NaCl SDK and have to install it manually from that so really not very useful at the moment.

    From Google Code page:

    Tested Platforms - nativeclient - Platforms on which Native Client has been tested

    Would really like more info on this, probably have to dig though the NaCl SDK docs to get it though - anything you search for on google will just be random blogs talking generally about what the tech can do without going into any useful details.
     
    Last edited: Jan 25, 2012
  12. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    So, you are starting it by clicking on the app icon in Chrome, and then it gives you that error? In that case all I can think of is maybe you forgot to copy some files? Otherwise, you can file a bug with a repro case, and we'll check it out.
     
  13. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    When you publish your app as a packaged Chrome app, there is no need to cache anything, as the whole app will be installed on the users disk on first run. Otherwise, it is subject to the normal caching used by Chrome as any other web content.

    NaCl is not limited to chrome apps per se. But in current versions of Chrome, it is disabled for generic web pages by default. This can be changed by going to chrome://flags and enabling Native Client there, and restarting Chrome.

    The reasoning behind this decision is that currently NaCl is i686 and x86_64 only (with ARM support in the works) - and as thus criticised by the web community for introducing platform specific code to the web. Google plans to fix this by working on a technology called PNaCl, which uses platform independent LLVM bitcode instead of native binaries. Once this technology is ready, they plan to enable it for the generic web by default, but for now they want to keep it in a space they can control.

    As for other browsers incorporating NaCl, there are no current plans I know of, but the tech is open source for anyone to pick up. I think it is largely dependent on developers like you making cool content for it to get other browser makers interested.
     
  14. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    This information is outdated - there is no up to date plugin to let NaCl run outside of Chrome. It is possible to use Chrome Frame to run it in IE if you first enable NaCl in chrome://flags, but that's it for the time being.
     
  15. Cameron_SM

    Cameron_SM

    Joined:
    Jun 1, 2009
    Posts:
    915
    Arr bummer, oh well.

    Thanks for all the info and replies in here though. Saved me and probably a lot of others a few hours of web hopping. :)
     
  16. gormanj

    gormanj

    Joined:
    Oct 20, 2010
    Posts:
    3
    I am having a render problem with Native Client. I have tried turning off fog and removed specularity from the material. However, Chrome renders the ground plane incorrectly when I turn at certain angles. Flash, web and application Unity files are fine, just NaCl has the problem.

    This is Chrome NaCl render showing the problem:


    This is the same when I turn the camera slightly (now the way it is supposed to render):


    Does anyone know how to get NaCl to render properly?
     
  17. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Read whole topic, but couldn't find the answer - how to make NACl app run locally on clean machine?
    We need to deploy our app to Linux machines as web player. We can specify Chrome browser as a requirement for running it, but it should be run locally on computer with Linux. Right now when i try to run it locally it gives an error "Can't load manifest file".