minko - windows app meetup nov. 2013
TRANSCRIPT
#WindowsApps – Nov. 2013 Build 3D web and desktop applications with C++11
Jean-Marc Le Roux CEO and co-founder of Aerys [email protected] @promethe42
Join!
WebGL France http://www.meetup.com/WebGL-France
@WebGLFrance
by
3D. Everywhere. Deliver engaging, interactive and rich 3D content and applications on
desktops, mobiles and the web.
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.
IronForce (EA/Coolfish)
« We chose Minko to be the 3D engine in one of our new Flash-based games because we think it’s a highly professional solution in terms of
development ecosystem and high performance. »
André Weissflog, Head of Development at BigPoint
Features 100% compatible with Windows, Mac,
Linux, iOS, Android and WebGL
WYSIWYG Scene editor
3D scene graph API
Components & scripts system
Physics (Bullet)
Data-driven rendering engine
80+ 2D/3D file formats supported
Dynamic assets loading
Über-shaders
3D compression, simplification and streaming
Plugin system (Oculus, Leap, ….)
Particles engine
3D apps are usually bigger/more complex projects Bigger teams Bigger expectations Complex assets workflow
C++ is more expressive and brings some specific optimizations
Static typing, templates Inlining Low level memory management (no GC) …
C++ can be used on any platforms (Windows, Mac, Linux, iOS, Android, Flash, Windows
Phone…)
« Anything that can be done with JavaScript will be done in Javascript » Well anything that can be done has already been done in C++ so…
Why?
Targeting HTML5/WebGL
C++ 2011
Standard, fast, well documented and supported by a vast community
Already fully supported by all major compilers (VS, GCC, LLVM…)
New additions make it closer to what we’re used to with Javascript – Closures/lambda functions – Type inference (instead of dynamic typing) – Shared pointers (instead of GC)
C++11 Example – Closures
// callback is removed when mouseWheel is set to nullptr
C++11 Example – Shared pointers
Emscripten https://github.com/kripken/emscripten
Open source project driven by Mozilla – Based on LLVM, which is supported by Google, Apple, Intel and many more
Cross-compile C++ code to Javascript code
– Binds OpenGL to WebGL – Provide virtual file system – C++ Javascript bindings
Code optimizations
– LLVM and C++ specific optimizations – Closure compiler – asm.js (2x performances of native code!)
Code compression using LZMA
ASM.js –Benchmarks
Source: http://kripken.github.io/mloc_emscripten_talk/#/28
EXAMPLE: SPONZA HTML5! http://minko.io/showcase/sponza-html5
TARGETING WINDOWS/DIRECTX
ANGLE https://code.google.com/p/angleproject/
Almost Native Graphics Layer Engine
Open source project driven by Google – Used by Chrome and Firefox WebGL implementations
OpenGL wrapper that will map OGL calls to the DirectX API
– Provide better performances on Windows – Makes it possible to target DirectX with an OpenGL based implementation – Should provide Windows Phone 8 compatibility out of the box
Also converts GLSL shaders to HLSL
– Completely transparent to the developer! – Write once, deploy everywhere
Supports DirectX 11
– Compatible with the Windows 8.1 App Store
Conclusion
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, iOS, Android and WebGL
withouth a single modification! Haven’t tested iOS/Android yet, but should work out of the box
Speed Native speed on Windows, Mac, Linux, iOS and Android 2x speed of native code in HTML5/WebGL thanks to asm.js!
Target DirectX 11 thanks to ANGLE Direct push on the Windows 8.1 App Store
My Feedback – The Bad Parts
RAM consumption for HTML5/WebGL apps x-compiled with emscripten Will likely improve with every new release
Not yet compatible with the Windows Phone 8 App Store Forbidden to use the « online » HLSL compiler for mobile apps