Hacker News new | ask | show | jobs
by ndepoel 3960 days ago
It's very simple: Unity was never designed with a target platform as radical as HTML5/JS/WebGL in mind. It's stuck with an older version of the Mono runtime for its scripting language, and they've pulled off some crazy tricks to get it to work on WebGL: Mono IL code is cross-compiled to C++, which then gets cross-compiled again to JS/WebGL using Emscripten. That it works at all is nothing short of a miracle. However, compatibility and performance will be really hard to get up to a decent standard, especially when compared to engines that were built from the ground up for WebGL, such as Blend4Web.

Long story short: if WebGL is your primary target platform, Unity is not exactly the first place you should look.

2 comments

Quite true.

If one main goal is WebGL then the best option is to adopt a WebGL native engine, instead of trying to cram a native experience into the browser.

It depends on the functionality you need. Unity does a lot more than lightweight WebGL engines do.

Of course, if a lightweight WebGL engine is enough - and it might well be the case for this NASA app, which doesn't need sophisticated AI, physics, scripting, effects, etc. - then that is the better route.

There are also middle grounds between a native WebGL engine and a full native engine like Unity. There are lightweight native engines, like Cube 2,

https://developer.mozilla.org/en-US/demos/detail/bananabread

and there are even lighter than that. There isn't a dichotomy between native and compiled game engines. In fact, some native WebGL game engines use compiled portions, like PlayCanvas which uses ammo.js, a compiled native physics engine,

https://github.com/playcanvas/engine

Someone calling Unity "sophisticated" makes me laugh. It's a poorly implemented bugfest.
I doubt WebGL will be a serious competitor to any platform 3D engine for at least another decade, probably two.
I think you're conflating low level rendering API (WebGL) with Game Engine (built on top of low level rendering APIs such as WebGL, OpenGL ES, OpenGL, Direct3D).

WebGL does have to do some validation, but most implementations are built on top of ANGLE, which for the most part is _NOT_ an emulator. It does have slow paths for things that exist in WebGL such as the TRIANGLE_FAN drawing mode that don't exist in D3D11. For an interesting read, might I sugguest: https://books.google.com/books?id=6crECQAAQBAJ&lpg=PP1&pg=PA...

I exported my home from SweetHome3D into Blender, then into HTML5 using blend4web and it looks surprisingly good both on my fresh $100 smartphone and on my $600 notebook. I just added another source of light to make shadows softer. I reading book about Blender because I want to add walkability to home, but I have no idea how. :-)
Sounds like you really love your home :-)
I hoped that I will start building of my home in 2014, but revolution and war with Russia delayed it. I bought plan of "Starboard Solar home" built in Boulder, Colorado 30 years ago. It uses Trombe wall to heat and/or cool home. I will also use G.R.E.B. technology to build "Passivhaus". Unfortunately, I spent all my savings at revolution, so now I am waiting until I will have at least $15K in savings to build enclosure, so I am spending my time to make building plan detailed and SweetHome3D is perfect tool for that, except that it is hard to share 3D model with others. Export to HTML5 solved my problem: I can just display home levels on my cheap 5,5" smartphone or share it using Google Drive.

IMHO, export of 3D models to HTML5 is superb technology and will be used everywhere. For example, clothes shop can use it to display clothes on model of customer, in dynamic (walking, dancing, running, etc.). Car shop can use it to provide virtual test drive. Constructions shop can use it to let customer practice with tools and materials. Anybody willing to start SaaS startup in that area? I am working for outsource firm, so I cannot start a software startup, because I will be fired immediately and I have not enough savings, but I can be hired. I have more than 25 years of experience in programming and more than 30 of successfully finished projects (and 2 failed), I participated in few startups (e.g. Bazarvoice), I saw my code spread, e.g. in BashFAQ, etc.

Just saw this comment now. Interesting to hear your story. Do you have a link for your home HTML5 model?
In most cases I believe time estimates for technological advance to be far too short, but in this case I believe the estimate to be far too long. We've already got decent 3d engines running in the browser - it's not theoretical. With the current pace of web tech advancement and the advent of web assembly, it could easily happen within five years.
In terms of presentation, you're dead on. In terms of tooling and development environment, not sure that that's going to be.
webGL is very low level, so you should be able to get good performance. But the problem I think is that the specifications/standards move too fast. If you start to build a game with the latest technology today, those technologies will be deprecated once your release the game :P
This really isn't the case on the web. There are no "take backs-ies".