48
The Making of Turbulenz’ Ian Ballantyne, Turbulenz @ianballantyne WebGL Benchmark (Printer Friendly Version)

WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Embed Size (px)

DESCRIPTION

Presentation WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne at the AMD Developer Summit (APU13) November 11-13, 2013.

Citation preview

Page 1: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

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

Example Games

Page 4: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Building a WebGL benchmark

Page 5: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

WebGL capable devices

Page 6: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

WebGL capable browsers

Page 7: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

HTML5 Game Engines utilizing WebGL

Page 8: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Benchmark Demo

Page 9: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

Must be interesting!

Page 11: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Why use the Polycraft game?

Page 12: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

Polycraft game

Page 14: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

From game to benchmark

Page 15: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

Early Benchmark Tests

Page 17: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

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

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
Page 21: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

New particle effects

Old Torch New Torch

Page 22: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

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

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

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

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

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

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

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

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

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

Multiple streams

Page 33: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Generating results

Page 34: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

Graphing

Page 36: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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
Page 38: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne
Page 39: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Complications

● Timing● Browser control● Feature support● Vsync

Page 40: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

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

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

Early Stress Test Demo

Page 44: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

Before we continue building...

Page 45: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne
Page 46: WT-4066, The Making of Turbulenz’ Polycraft WebGL Benchmark, by Ian Ballantyne

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

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

Questions

Register interest: bit.ly/polycraft_benchmark_preview