3D. Everywhere. Deliver engaging, interactive and rich 3D content and applications on desktops, mobiles and the web.
Augment your processes. Minko « Entreprise » Edition W Share massive 3D files on the cloud thanks to Minko’s exclusive 3D compression and streaming algorithms. Go mobile, integrate your 3D content in documents and work in augmented reality.
Focus on design. Boost with code. Minko « Studio » Edition Designers integrate 3D content, customize materials, setup lights and animations. Developers plug in scripts and interactivity.
The sky is the limit. Minko « Community » Edition Build desktop, web and mobile 3D applications with Minko’s free and open source SDK including a fully-featured 3D engine and plugins.
Why? Motivations to build WebGL apps with C++
3D apps tends to be more complex 3D apps are usually bigger projects Bigger teams Bigger expectations
C++ is more expressive (but more complex)
Reuse existing C++ libraries
3D apps require more performances GPU programming, 3D maths, 3D physics, 3D AI, Massive files loading
WebGL VS Stage3D - Penetration Rate WebGL Flash 53% 96% Firefox 4+, Chrome 9+, IE11 Any browser with Flash 11+ Source: Statcounter
WebGL VS Stage3D – HW Compatibility WebGL Flash ? 96% * * 2006 and newer hardware, software fallback otherwise
WebGL => Flash Fallback! Start working with standards today, but keep adressing the largest audience possible Is WebGL no available? Run Flash app. yes Run WebGL/JS app.
AbstractContext Mimics flash.display3D.Context3D interface – Leverages Adobe’s work on wrapping DirectX/OpenGL – Mainly uses simple native types (int, float…) to make it easier to wrap/bind in multiple languages
Defines al you need to work with OpenGL ES 2-compliant APIs – Enforces compatibility – Can be extended to provide more « custom » capabilities if you want AbstractContext OpenGLES2Context WebGLContext
OpenGLES2Context Extends AbstractContext
Implement al required methods using the OpenGL API
Actually uses OpenGL bindings, but limited only to what is actually available in OpenGL ES 2 – Should work out of the box with any OpenGL ES 2 compliant implementation – But also on any OpenGL implementation (ex: Windows, Mac and Linux) AbstractContext OpenGLES2Context WebGLContext
WebGLContext Extends OpenGLES2Context – Actually inherits more than 95% of its code
Override a few methods to handle some minor WebGL quirks – Some methods do not work properly/exist and have to be wrapped using (simple) workarounds AbstractContext OpenGLES2Context WebGLContext
Virtualized build environment Based on VirtualBox Wil instal and bootstrap everything for you Wil auto-update itself to make sure you always use the latest stable toolchain
We provide the configuration file to compile to HTML5/WebGL in just a single command line! Ubuntu virtual machine Uses Premake4 + gmake Wil do the same for Flash/Crossbridge
My Feedback – The Good Parts Working with C++ 2011 is amazing More complex but so much powerful/expressive than AS3/JS Useful and reliable STL containers (list, maps, sets, etc…) Shared pointers make memory management just as easy as with managed languages: not a single memory leak so far!
Visual Studio/XCode are very good IDEs
Minko 3’s implementation is much lighter and yet just as much powerful
Vagrant + Premake provides an efficient build system with cross- compilation
My Feedback – The Good Parts Compatibility The app runs on Windows, Mac, Linux and WebGL withouth a single modification! Haven’t tested iOS/Android yet, but should work out of the box
Binary size Closure compiler will make the binary 2 to 3x lighter LZMA compression will make the binary 5 to 6x lighter Combine both to get a final binary even lighter than the native one!
Speed 2x speed of native code thanks to asm.js! Possiblity much faster than an AS3 implementation
Integration Emscripten « modules » system make it easy to generate a *.js file and run it in any web page
My Feedback – The Bad Parts Workflow Haven’t figured out how to make dynamic libraries for now
Speed WebGL API is the bottleneck
Memory consumption 256MB of required memory seems excessive (I haven’t make a comparison with AS3 so far though…)
I miss the Flash API How do to a 2D UI using HTML5 comps? URLRequest?
Conclusion C++ 2011 is very efficient to build interactive and rich apps
Emscripten is mature enough to start working on large- scale applications
Using #ifdef for portability of C++ code is a bit cumbersome But it can easily be fixed by wrapping the app. init