Broken Age's Approach to Scalability. Oliver Franzke Lead Programmer, Double Fine Productions

Similar documents
Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

Dave Shreiner, ARM March 2009

Mobile graphics API Overview

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

POWERVR MBX & SGX OpenVG Support and Resources

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

Engine Development & Support Team Lead for Korea UE4 Mobile Team Lead

GPU Quality and Application Portability

PowerVR Performance Recommendations The Golden Rules. October 2015

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

Profiling and Debugging Games on Mobile Platforms

PowerVR Series5. Architecture Guide for Developers

Sign up for crits! Announcments

More frames per second. Alex Kan and Jean-François Roy GPU Software

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

Mobile HW and Bandwidth

Efficient and Scalable Shading for Many Lights

LPGPU Workshop on Power-Efficient GPU and Many-core Computing (PEGPUM 2014)

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Working with Metal Overview

PowerVR Hardware. Architecture Overview for Developers

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

Mobile Performance Tools and GPU Performance Tuning. Lars M. Bishop, NVIDIA Handheld DevTech Jason Allen, NVIDIA Handheld DevTools

Mobile Application Programing: Android. OpenGL Operation

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME)

Animation Essentially a question of flipping between many still images, fast enough

PowerVR: Getting Great Graphics Performance with the PowerVR Insider SDK. PowerVR Developer Technology

Streaming Massive Environments From Zero to 200MPH

PowerVR Performance Recommendations. The Golden Rules

OPENGL RENDERING PIPELINE

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

Programming shaders & GPUs Christian Miller CS Fall 2011

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

Understanding M3G 2.0 and its Effect on Producing Exceptional 3D Java-Based Graphics. Sean Ellis Consultant Graphics Engineer ARM, Maidenhead

LEVEL 1 ANIMATION ACADEMY2010

NVIDIA Tools for Artists

The PowerVR Insider SDK. PowerVR Developer Technology

Enabling immersive gaming experiences Intro to Ray Tracing

AutoCAD DWG Drawing Limitations in SAP 3D Visual Enterprise 9.0 FP02

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

MXwendler Fragment Shader Development Reference Version 1.0

Content. Building Geometry Appearance Lights Model Loaders

CS 354R: Computer Game Technology

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

POWERVR MBX. Technology Overview

Applications of Explicit Early-Z Z Culling. Jason Mitchell ATI Research

Designing the look and feel for Smoke and Neon powers The creation of a new toolset and pipeline for I:SS Pros and cons from our new workflow and

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

CS427 Multicore Architecture and Parallel Computing

ArcGIS Runtime: Maximizing Performance of Your Apps. Will Jarvis and Ralf Gottschalk

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Shadows. Prof. George Wolberg Dept. of Computer Science City College of New York

Using the PowerVR SDK to Optimize your Renderer

Copyright Khronos Group Page 1

Mobile Application Programing: Android. OpenGL Operation

OpenGL ES 2.0 Performance Guidelines for the Tegra Series

The Shadow Rendering Technique Based on Local Cubemaps

GoForce 3D: Coming to a Pixel Near You

Lecture 6: Texture. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Breathing life into your applications: Animation with Qt 3D. Dr Sean Harmer Managing Director, KDAB (UK)

Scalable multi-gpu cloud raytracing with OpenGL

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

Lecture 16. Introduction to Game Development IAP 2007 MIT

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Rendering Grass with Instancing in DirectX* 10

Game Development for

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Adobe Flash Course Syllabus

PSD to Mobile UI Tutorial

NVIDIA Developer Toolkit. March 2005

PowerVR Performance Recommendations. The Golden Rules

Adding Advanced Shader Features and Handling Fragmentation

Introduction to Shaders.

Shaders. Slide credit to Prof. Zwicker

PVRTC & Texture Compression. User Guide

st ANNUAL SKILLS MANITOBA COMPETITION CONTEST DESCRIPTION

A Bandwidth Effective Rendering Scheme for 3D Texture-based Volume Visualization on GPU

Zappar's coordinate system is based on the center of the scene being the center of the target image.

Coming to a Pixel Near You: Mobile 3D Graphics on the GoForce WMP. Chris Wynn NVIDIA Corporation

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Graphics Architectures and OpenCL. Michael Doggett Department of Computer Science Lund university

Introduction. What s New in This Edition

AutoCAD DWG Drawing Limitations in SAP 3D Visual Enterprise 9.0 FP03

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

Underwater Manager (Optional)

Introduction to OpenGL ES 3.0

The Making of Seemore WebGL. Will Eastcott, CEO, PlayCanvas

Resistance: Fall of Man. Insomniac Games

Pump Up Your Pipeline

Rendering 17 Mixed Lighting

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Optimizing for DirectX Graphics. Richard Huddy European Developer Relations Manager

Parallelizing Graphics Pipeline Execution (+ Basics of Characterizing a Rendering Workload)

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

GPGPU. Peter Laurens 1st-year PhD Student, NSC

Vulkan: Architecture positive How Vulkan maps to PowerVR GPUs Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics.

Transcription:

Broken Age's Approach to Scalability Oliver Franzke Lead Programmer, Double Fine Productions

Content Introduction Platform diversity Game assets Characters Environments Shaders

Who am I? Lead Programmer of Broken Age Joined games industry in 2000 Programming for 25 years p1xelcoder

What is Broken Age? Classic adventure game by Tim Schafer Modern look Funded with 834% of original funding goal We have awesome fans! Available on nearly everything* * See Platforms slide

Trailer Time! http://www.youtube.com/watch?v=bwm4r5jsake

The look of Broken Age Modern HD graphics Expressive characters Beautiful lively environments Parallaxing (2.5D) Dynamic lighting Real-time reflections 2D character shadows

The look of Broken Age Typical scenes

Platforms, platforms, platforms! Optimistic view: 5 platforms Windows OSX Linux ios mobile & tablets Android mobile & tablets Desktop GPUs Mobile GPUs

Platforms, platforms, platforms! Pessimistic view: 8+ platforms! Windows, OSX, Linux ios mobile & tablets Android mobile & tablets Desktop GPUs PowerVR NVIDIA Mobile GPUs Qualcomm Vanilla Android Derivates (e.g. OUYA)

Why is this a problem? GPUs are very different Architectural goals Supported features Performance characteristics Platform fragmentation No exact knowledge of device capabilities Android fragmentation report: http://opensignal.com/reports/fragmentation-2013/

Scalability goals Amazing visuals on high-end PCs High resolution Fast Scale to low-end handheld devices Low resolution Low memory Slow

Scalability goals

A brief look at GPU types Desktop GPUs Maximize throughput Lots of memory High power consumption (100W+) No restrictions on draw calls Transparency is not a problem

A brief look at GPU types Desktop GPUs Frame Backbuffer

A brief look at GPU types Desktop GPUs Frame Backbuffer

A brief look at GPU types Desktop GPUs Frame Backbuffer

A brief look at GPU types Desktop GPUs Frame Backbuffer

A brief look at GPU types Desktop GPUs Frame... Backbuffer

A brief look at GPU types Mobile GPUs Low power consumption (~100mW) Limited memory Tiled rendering architecture Limitation to draw calls Optimized for opaque geometry Overdraw is expensive

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

A brief look at GPU types Mobile GPUs Frame Memory Backbuffer

Consequences for Broken Age Minimize overdraw Keep number of draw calls low (<100) No render-targets Avoid dependent texture look-ups Optimize shaders

Characters Goals Expressive Efficient to animate Flexible and extendible Receive dynamic lighting Minimize memory and overdraw Use studio expertise

Characters Hybrid rig Skinned geometry Flipbook animation Best of both worlds!

Characters Hybrid rig Authoring Concept

Characters Hybrid rig Authoring Texture layout

Characters Hybrid rig Authoring Skinned geometry for body parts

Characters Hybrid rig Authoring One skeletal rig for all views!

Characters Hybrid rig Authoring Animation Joint transform Geometry visibility Auto lip-sync generation Annosoft lipsync library

Characters Hybrid rig Run-time Evaluate joint transforms subset visibility Gather visible body parts and

Characters Hybrid rig Run-time Sort geometry Back-to-front using AABBs Batch draw calls

Characters Hybrid rig vs. Flipbooks More efficient creation Repurpose existing tools Lower memory footprint Boy: ~23MB vs. ~5.5GB (1 : 244) Hybrid rig + all animations: 5.8MB = 68810 frames (215 anims) 150KB = rig 17.4MB = textures (DXT5) Flipbook estimation: Frames = 34405 (anims @ 15fps) Sprite size = 256 x 512 (DXT5) Disclaimer: Pre-alpha values

Characters Lighting Gradient lighting Low-frequency lighting

Characters Lighting Gradient lighting Sample nearby sources Average top and bottom color Approximated normal Cheap!

Characters Lighting Rim lighting Edge highlighting

Characters Lighting Rim lighting Local space normal map Average direction and color Expensive

Characters Lighting Shadows 3 shadow blobs (feet and body) Distance to ground drives intensity and radius

Characters Lighting Shadows Approximated directionality

Characters Lighting - Comparison

Characters Lighting - Comparison

Environments Goals Painted in Photoshop Support parallaxing Multiple light states Minimize memory overdraw and

Environments Authoring Concept

Environments Authoring Whitebox

Environments Authoring Final painting

Environments Authoring Groups become scene layers Scene layers

Environments Authoring Groups can have vector masks Vector masks

Environments Authoring Lighting groups define alternate state Light state

Environments Authoring - Custom export script Creates PNG and clip polygon per scene layer Vector masks

Environments Data-build - Calculate mip-maps Sharpen mips to counter loss of contrast High and low mips are compressed separately High mip only gets loaded on high-end platforms minimize IO and memory footprint High mip Low mips

Environments Data-build Chunking Split into GPU friendly textures Calculate chunk polygons Clipper library Tesselate geometry GLUtesselator Omit empty chunks

Environments Run-time Clip masks minimize overdraw

Environments Lighting Blend between light states

Shaders Goals Optimized! Permutations No Übershaders! Disable features on weak GPUs Minimize impact of platform specific code ETC1 needs extra alpha texture! Support for #include and #if

Shaders Optimization No precompiled shaders in Open GL ES Raw shader source is shipped Drivers are very different Amount and type of optimizations Compilation speed Extremely problematic

Shaders Optimization Offline GLSL optimization Creates optimized shader based on original source Maximizes performance Minimizes size of shader source Open source GLSL optimizer Thank you Aras Pranckevičius!!!

Shaders Optimization Example (Original) #include "common.fsh" uniform MEDP vec4 g_vtintcolor; uniform MEDP float g_fcrossfadeintensity; uniform sampler2d g_samcolor2; varying MEDP vec2 uvvarying; void main() { MEDP vec4 texcolor = SampleMainTexture( uvvarying ); if(g_bcrossfade) { MEDP vec4 texcolor2 = SampleTexture( g_samcolor2, uvvarying ); texcolor = mix(texcolor, texcolor2, saturate( g_fcrossfadeintensity )); } Include Precision modifiers Permutation Helper functions } gl_fragcolor = texcolor * g_vtintcolor;

Shaders Optimization Example (Windows) varying vec2 uvvarying; uniform vec4 g_vtintcolor; uniform sampler2d g_samcolor; void main (){ gl_fragcolor = (texture2d (g_samcolor, uvvarying) * g_vtintcolor); } Perm: No cross fade varying vec2 uvvarying; uniform sampler2d g_samcolor2; uniform float g_fcrossfadeintensity; uniform vec4 g_vtintcolor; uniform sampler2d g_samcolor; void main (){ gl_fragcolor = (mix (texture2d (g_samcolor, uvvarying), texture2d (g_samcolor2, uvvarying), clamp (g_fcrossfadeintensity, 0.000000, 1.00000)) * g_vtintcolor); } Perm: Cross fade

Shaders Optimization Example (Android ETC1) varying lowp vec2 uvvarying; uniform lowp vec4 g_vtintcolor; uniform sampler2d g_samsplitalpha; uniform sampler2d g_samcolor; void main (){ lowp vec4 tmpvar_1; tmpvar_1.xyz = texture2d (g_samcolor, uvvarying).xyz; tmpvar_1.w = texture2d (g_samsplitalpha, uvvarying).x; lowp vec4 tmpvar_2; tmpvar_2 = (tmpvar_1 * g_vtintcolor); gl_fragcolor = tmpvar_2; } Perm: No cross fade

Shaders Optimization Example (Android ETC1) varying lowp vec2 uvvarying; uniform sampler2d g_samcolor2; uniform lowp float g_fcrossfadeintensity; uniform lowp vec4 g_vtintcolor; uniform sampler2d g_samsplitalpha; uniform sampler2d g_samcolor; void main (){ lowp vec4 tmpvar_1; tmpvar_1.xyz = texture2d (g_samcolor, uvvarying).xyz; tmpvar_1.w = texture2d (g_samsplitalpha, uvvarying).x; lowp vec4 tmpvar_2; tmpvar_2 = (mix (tmpvar_1, texture2d (g_samcolor2, uvvarying), clamp (g_fcrossfadeintensity, 0.000000, 1.00000)) * g_vtintcolor); gl_fragcolor = tmpvar_2; } Perm: Cross fade

Shaders Permutations Data-build Permutation variables Flag (bool) Enumeration Drastically reduces the amount of permutations n << n! + 2 Generate shader source for all permutations Select current state using C preprocessor of optimizer Omit redundant shaders

Shaders Permutations Run-time Only creates used permutation programs ~15% are used (average) Reuse vertex and fragment shaders Permutation variable overrides for level-of-detail Only one uniform state Force re-apply uniforms when permutation changes

Conclusion Think about platforms early on Define the constraints Artists are magicians! Top-down and bottom-up scalability Hide platform specific parts where possible

Thank you! Questions? http://www.brokenagegame.com/

References Open source libraries GLSL optimizer https://github.com/aras-p/glsl-optimizer Clipper http://www.angusj.com/delphi/clipper.php Further reading Smedis: Bringing AAA graphics to mobile platforms http://www.unrealengine.com/files/downloads/smedberg_niklas_bringing_aaa_graphics.pdf