Wallpaper Engine

Wallpaper Engine

View Stats:
Smileynator Mar 20, 2017 @ 3:36pm
Unity WebGL wallpaper
Hey @Biohazard,
It seems that running WebGL Unity3D projects is not working. I do not know why this is. Could it be that the project is not allowed to host locally?

If you have any answer for this i would love to hear it.
Current result: http://puu.sh/uSa1N.png
Expected result: http://puu.sh/uSagM.png
Test Project WebGL: http://puu.sh/uSa9Z.zip

Please help!
Why?
This way we do not have the "Application" warning from a .exe and i can probably use JS to read the audio spectrum in Unity3D without any messing around.
< >
Showing 1-15 of 20 comments
Smileynator Mar 20, 2017 @ 3:38pm 
BTW talk to me if you need to. I am a game dev, maybe i can help.
Squee Mar 22, 2017 @ 5:46pm 
If you try to open it locally in chrome you get "It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser."

My guess is it is running into problems running from a local filesystem. Works fine if i put it on my dev server and request it via http://
Smileynator Mar 23, 2017 @ 2:30pm 
Originally posted by Squee:
If you try to open it locally in chrome you get "It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser."

My guess is it is running into problems running from a local filesystem. Works fine if i put it on my dev server and request it via http://
Yes i know, chrome blocked loading this page from a local drive for some reason, it can however somewhere be disabled i think.
It would be nice if we could somehow use unity WebGL though, all the neat stuff of running an EXE, without running an EXE and without security risks.
Squee Mar 23, 2017 @ 2:43pm 
Yeah, but I am unsure why Unity would require you to use http. From what I can see "security reasons in chrome" but some say if you run chrome with the argument "--allow-file-access-from-files" it should work ( haven't tested ) ..

Not sure if there is anything againt using that with WE or if that would cause real security problems as in script being allowed to access files from other places on the drive or anything.
Smileynator Mar 25, 2017 @ 1:41pm 
I am not sure either.
What i do know is that i can use "build and run" to paly it locally just fine (it starts some sort of server to locally host the webpage, then chrome thinks it is fine to do) so maybe we can do the same for WE?
Squee Mar 25, 2017 @ 2:31pm 
Thats true, Unity does run a local server ( at least i heard it does ). Could it be a solution to put the project up on some internet server, then try to redirect the page or embed an iframe in the page that is 100% width and 100% height? I do believe some people managed to put an external site/page into a workshop item.
Smileynator Mar 25, 2017 @ 2:54pm 
Yeah i think most of them do (or redirect an existing) However i am not about to host 50mb of a project just to put it in the workshop for free :P that ♥♥♥♥ is expensive to host!
Squee Mar 25, 2017 @ 3:13pm 
50mb .. woah .. Ok, didn't think of that.
Smileynator Mar 25, 2017 @ 4:13pm 
Yeah, WebGL things usually are not small. Even though it got better.
Squee Mar 25, 2017 @ 4:21pm 
My webgl wallpaper was only 1mb I think :) but only used 3 small textures, rest is lighting effects. If you grab threejs and not unity you can make a webgl project without problems, even 50 mb ones .. But you wont have all the tools unity provides.
Smileynator Mar 30, 2017 @ 9:41am 
Ah well, Unity has like 30MB in engine stuff iirc. weither you like it or not :P
Doesn't solve my issue sadly.
Biohazard  [developer] Mar 30, 2017 @ 1:38pm 
I kinda missed this thread. Actually, my Sheep wallpaper was using Unity with WebGL export in the beginning, but that was with Unity 4, I guess something must have changed.

Are you able to run the exported html file in Chrome at all without a server? The web wallpaper already sets --allow-file-access-from-files that Squee mentioned (and instead it uses a mechanism to limit file access to the project directory).

Can you check the bin/debug.log and bin/log.txt file? Those should at least show something going wrong, maybe you can put them on www.pastebin.com and link them here too.


Edit: If Unity WebGL is using XMLHttpRequest objects then you might have to edit their JS: http://steamcommunity.com/app/431960/discussions/0/144512753469915486/#c144512942756106076
Last edited by Biohazard; Mar 30, 2017 @ 1:43pm
Smileynator Apr 3, 2017 @ 1:56pm 
Originally posted by Biohazard:
Are you able to run the exported html file in Chrome at all without a server? The web wallpaper already sets --allow-file-access-from-files that Squee mentioned (and instead it uses a mechanism to limit file access to the project directory).

Well, since a while ago it seems that Chrome just does not allow to run a default unity HTML game while running from the local filesystem. Something to do with security? Not too sure why that was blocked off. If i run it outside of WE in chrome, it will do the exact same.

As for the XMLHttpRequest, i do not actively use it as far as i know, but i can't tell if unity uses it. Have you ever seen a .js export from unity? It's not like i can find it :/
EDIT: Well there we go: http://puu.sh/v8hBH.png
Now i wonder if we can work around that or not.

Basically this is the answer, try firefox or get it hosted somehow:
http://gamedev.stackexchange.com/questions/114239/unity-webgl-not-loading-on-chrome

Here is what it does without local server: http://puu.sh/v8hyv.png

So that begs the question, can we make WE host the wallpaper locally for us? Or would that just be asking the insane to just get a unity webgl page working?

And if we DID do that, does it imply a security issue just like using any .exe?

EDIT2:
Look, i "found it":
http://puu.sh/v8hVj.png
Isn't that neat readable code?

Last edited by Smileynator; Apr 3, 2017 @ 1:58pm
Squee Apr 3, 2017 @ 2:37pm 
A lil tip to make it readable:

Open the project in chrome and open the developer tools. Go to the "Sources" tab and select the file. Once the code is open, in the status bar below the code you should see a "{}" icon. Click that for some formatting.
Last edited by Squee; Apr 3, 2017 @ 2:37pm
Biohazard  [developer] Apr 4, 2017 @ 12:37am 
I can see (o.status==0||o.status==200) in there, so I think they are handling local files, at least in this place?
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: Mar 20, 2017 @ 3:36pm
Posts: 20