#WindowsApps – Nov. 2013
Build 3D web and desktop applications with C++11

Jean-Marc Le Roux
CEO and co-founder of Aerys
jeanmarc@aerys.in
@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

 80+ 2D/3D file formats supported
 Dynamic assets loading
 Über-shaders

 Components & scripts system

 3D compression, simplification and
streaming

 Physics (Bullet)

 Plugin system (Oculus, Leap, ….)

 Data-driven rendering engine

 Particles engine
Why?
 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…
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
http://minko.io/showcase/sponza-html5

EXAMPLE: 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 crosscompilation
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
Don’t forget to check http://minko.io !

Merci !

Minko - Windows App Meetup Nov. 2013

  • 1.
    #WindowsApps – Nov.2013 Build 3D web and desktop applications with C++11 Jean-Marc Le Roux CEO and co-founder of Aerys jeanmarc@aerys.in @promethe42
  • 2.
  • 3.
  • 4.
    3D. Everywhere. Deliver engaging,interactive and rich 3D content and applications on desktops, mobiles and the web.
  • 5.
    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.
  • 6.
    The sky isthe 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.
  • 7.
  • 8.
    « We choseMinko 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
  • 9.
    Features  100% compatiblewith Windows, Mac, Linux, iOS, Android and WebGL  WYSIWYG Scene editor  3D scene graph API  80+ 2D/3D file formats supported  Dynamic assets loading  Über-shaders  Components & scripts system  3D compression, simplification and streaming  Physics (Bullet)  Plugin system (Oculus, Leap, ….)  Data-driven rendering engine  Particles engine
  • 10.
    Why?  3D appsare 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…
  • 11.
  • 12.
    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)
  • 13.
    C++11 Example –Closures // callback is removed when mouseWheel is set to nullptr
  • 14.
    C++11 Example –Shared pointers
  • 15.
    Emscripten https://github.com/kripken/emscripten  Opensource 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
  • 16.
  • 17.
  • 18.
  • 19.
    ANGLE https://code.google.com/p/angleproject/  AlmostNative 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
  • 20.
  • 21.
    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 crosscompilation
  • 22.
    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
  • 23.
    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
  • 24.
    Don’t forget tocheck http://minko.io ! Merci !