WebGL and unity?

Will Unity ever support exporting to webGL so that you don’t need a plugin at all?
Could that ever be possible or is webGL and javascript too limited?

Ideas?

No, because basically the entire Unity engine would have to be re-written in Javascript.

–Eric

no, it wouldn’t have to be rewritten. there is a c/c++ to javascript compiler that uses llvm. similar to what adobe offers for c/c++ to actionscript compilation.

but i guess javascript still is slower than actionscript and some stuff is lacking a little for doing games in javascript. for example audio features. or control over the mouse cursor, going fullscreen,…

I wouldn’t say “never”. Especially after the recent announcements regarding Flash as a target platform.

It won’t be a trivial amount of work, but it’s not impossible.

it would have to be rewritten.
Sure there is a cross compiler, but that does not give you anything as the engine needs to be opted for the platform, for example the terrain needs to be removed etc etc, it would be an optimization on or above the level of iOS and Android as webgl + js is even more limited hw and performance wise

This will not work. You need to recompile the ENGINE. That means physx, umbra and all that jazz too.
It just won’t work.
It will need a rewrite.

for molehill the engine needs to be recompiled to actionscript too. doesn’t seem to require a rewrite. :slight_smile:

the adobe c/c++ to actionscript compiler will be used for that (probably it also is llvm based).

the same cross-compilation is possible for javascript.

sure, some (a lot of?) adaptations will/would be necessary but it wouldn’t be a complete rewrite.

if it can be done for molehill (which basically also only is an opengl ES 2.0 wrapper, just like webgl) then it can be done for javascript too. like i said, the problem with javascript maybe is worse performance and some missing features like low level audio stuff. but those problems will be solved too in the future. webCL is already announced for example.

Yeah, enjoy unityengine getting decompiled and stolen :slight_smile:

actionscript is as easy to steal as javascript. it would have to be obfuscated.

I think this is more possible than all of you might believe, and this isn’t dependent on a straight rewriting of the whole engine.

Why wouldn’t it be possible to have the unity code generate WebGL code based on what functions are supported? So like deferred lighting, umbra and physx wouldn’t get exported. But basic GL rendercalls and some game logic would be. Ya it’d be even more stripped down than iOS and flash potentially, but even the function to export just a 3D model to .html with the ability to rotate around it would be a valuable function of the Unity engine. I bet you just that is incredibly do-able and this could be built up from there.

I mean if Unity is transferrable to PS3, Xbox360, android, Wii, iOS flash… every platform. Not all of those are supported by Mono libraries or even have directly relatable internal workings, UT manually writes the translation code for things like that. I bet you getting Unity code translated to run on PS3 is even more abstract than getting it to run on WebGL.

Of course though, I admit my grasp on this is extremely limited and I’m just stabbing in the dark. But considering that Unity is translatable to every so far, to say WebGL is impossible and needs a whole-rewrite of the engine? That seems wrong, Unity is already written from the ground up to be translatable to every platform. Why would WebGL be such a foreign platform as compared to any other platform that it becomes impossible?

It wouldn’t, though. If you’re just going to do that, you don’t even need an engine. If you’re going to strip everything out that makes Unity Unity, then why bother?

–Eric

Native Client. Eat your cake and have it too.

Because I would like an easy way to export models to webgl for posting on websites :expressionless:
There is still alot to be made with no physx, umbra, trees, terrain, deffered lighting or fancy shaders. Thousands of games don’t have such things, and it’d be cool to make such a game that is only a .html file.

So if I follow what your saying, and I assume since your administrator you might be knowledgable about the possibility of this, what your saying is that there could be a client native to webGL?

I don’t understand how that is in reference to having or eating cake as well?

Native Client is a google technology integrating in Chrome, Chrome OS and other areas. Other browsers have signed on as well. The concept is that you can run advanced content in the browser (or whatever client is implementing it) without installing a plugin.

We’re actively working on a Native Client build of Unity at the moment.

Awesome!

Even better

Really a great news!