![Page 1: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/1.jpg)
The Making of Turbulenz’
Ian Ballantyne, Turbulenz@ianballantyne
WebGL Benchmark
(Printer Friendly Version)
![Page 2: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/2.jpg)
About TurbulenzHTML5 Game Development● Gaming Platform
(turbulenz.com)● Publishing Platform
(hub.turbulenz.com)● Game Engine
(github.com/turbulenz/turbulenz_engine)● Game Studio
(wonderstruckgames.com)
![Page 3: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/3.jpg)
Example Games
![Page 4: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/4.jpg)
Building a WebGL benchmark
![Page 5: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/5.jpg)
WebGL capable devices
![Page 6: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/6.jpg)
WebGL capable browsers
![Page 7: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/7.jpg)
HTML5 Game Engines utilizing WebGL
![Page 8: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/8.jpg)
Benchmark Demo
![Page 9: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/9.jpg)
Project Goals
● Run a real-world WebGL game● Maximize GPU utilization● Repeatable content for comparison● Simple, quick to run● Useful for information for:
○ Hardware developers○ Browser developers○ Game developers
● Open Source benchmark code
![Page 10: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/10.jpg)
Must be interesting!
![Page 11: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/11.jpg)
Why use the Polycraft game?
![Page 12: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/12.jpg)
Polycraft Benchmark
● Cutting-edge 3D, HTML5 game● Playable in the browser today● Targeting a range of hardware● Interest in performance● Actively in development
![Page 13: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/13.jpg)
Polycraft game
![Page 14: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/14.jpg)
From game to benchmark
![Page 15: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/15.jpg)
Efficient GPU benchmarking
● Run as fast as it can● Minimise CPU cost● Remove unnecessary subsystems● Control the rendering
![Page 16: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/16.jpg)
Early Benchmark Tests
![Page 17: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/17.jpg)
Game Modifications
● Expand scripting system● Move work from CPU to GPU● Add new GPU effects● Make the game deterministic
![Page 18: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/18.jpg)
Updated Scripting
● Improved scriptable camera○ Dynamic waypoints○ Required a skybox○ Different perspective on the game
● Player waypoints● Trigger waves of enemies
![Page 19: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/19.jpg)
New GPU effects● Additional shadow casting light● Post processing effects● New GPU particle system
![Page 20: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/20.jpg)
![Page 21: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/21.jpg)
New particle effects
Old Torch New Torch
![Page 22: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/22.jpg)
Repeatable game logic
● Seeded random number generator● Disabled approximations● Used a fixed timestep● Synchronized update with rendering
![Page 23: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/23.jpg)
Benchmark recording/playback interface
WebGL API
Turbulenz Graphics Device
Polycraft game
WebGL API
Benchmark app
Turbulenz Graphics Device
Record Playback
![Page 24: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/24.jpg)
Benchmark recording/playback interface
Meshes Textures Shaders
WebGL API
Turbulenz Graphics Device
Polycraft game
WebGL API
Turbulenz Graphics Device
Benchmark app
![Page 25: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/25.jpg)
Benchmark recording/playback interface
Meshes Textures Shaders Scripting data
WebGL API
Polycraft game
Turbulenz Graphics Device
WebGL API
Turbulenz Graphics Device
Polycraft game
![Page 26: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/26.jpg)
Benchmark recording/playback interface
Meshes Textures Shaders Frame data
WebGL APIWebGL API
Turbulenz Graphics Device
Polycraft gameBenchmark app
![Page 27: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/27.jpg)
Benchmark recording/playback interface
WebGL API
Turbulenz Graphics Device
Polycraft game
Meshes
Capture Device
Textures Shaders Frame data
WebGL API
Benchmark app
Playback Device
Turbulenz Graphics Device
![Page 28: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/28.jpg)
Benchmark recording/playback interface
WebGL API
Turbulenz Graphics Device
Polycraft game
Capture Device
Frame data
WebGL API
Playback Device
Turbulenz Graphics Device
Textures Shaders
Benchmark app
![Page 29: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/29.jpg)
Benchmark recording/playback interface
WebGL API
Turbulenz Graphics Device
Polycraft game
Capture Device
Frame data
WebGL API
Playback Device
Turbulenz Graphics Device
Textures Shaders
Benchmark app
![Page 30: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/30.jpg)
Benchmark recording/playback interface
WebGL API
Turbulenz Graphics Device
Polycraft game
Capture Device
Frame data
WebGL API
Playback Device
Turbulenz Graphics Device
Textures Shaders
Benchmark app
![Page 31: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/31.jpg)
Recording/playback
● Process the recording offline● Reuse the system with other content● Playback with minimal overhead● Optimize recorded data
○ Use a binary format○ Process in 60 frame chunks○ Reference only required assets
![Page 32: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/32.jpg)
Multiple streams
![Page 33: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/33.jpg)
Generating results
![Page 34: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/34.jpg)
Possible information to record
● Per-frame data○ Frame execution timing (ms)○ Low level metrics○ High level metrics
● Configuration○ Hardware: Platform, graphics card, driver
○ Runtime: Browser, screen resolution, anti-aliasing
○ Stream: Post effects enabled, render target resolution
![Page 35: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/35.jpg)
Graphing
![Page 36: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/36.jpg)
Graphing Results
● Visual feedback● Allow comparisons● Analyze the output in detail● Export the raw data if required● Discover the information you require
![Page 37: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/37.jpg)
![Page 38: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/38.jpg)
![Page 39: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/39.jpg)
Complications
● Timing● Browser control● Feature support● Vsync
![Page 40: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/40.jpg)
Vsync
Macbook Pro, MacOSX 10.6, Chrome 27
Vsync On Vsync Off
Early Prototype Benchmark Testing
ms
betw
een
fram
es
frame number
![Page 41: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/41.jpg)
Solutions
● Online/Offline● Different streams, different hardware● Look for alternative timing solutions● Frame execution time >16.6ms
![Page 42: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/42.jpg)
What’s next?
● More detailed timing● More stream variants:
○ High, medium, low○ Stress test
![Page 43: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/43.jpg)
Early Stress Test Demo
![Page 44: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/44.jpg)
Before we continue building...
![Page 45: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/45.jpg)
![Page 46: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/46.jpg)
Feedback
● Early access to project in development● Offline benchmark hosted on Github● Experiment with:
○ Offline benchmark runner○ Graphing tools○ Different streams
● Submit:○ Bugs/feature requests bit.ly/polycraft_benchmark_preview
![Page 47: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/47.jpg)
Utilizing the benchmark
● Test on your target platforms● Change the configuration● Record your own content● Look at the Turbulenz Engine
implementation (it’s open source)
bit.ly/polycraft_benchmark_preview
![Page 48: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554a4f69b4c9054b328b467d/html5/thumbnails/48.jpg)
Questions
Register interest: bit.ly/polycraft_benchmark_preview