Frostbite on Mobile

Electronic Arts / DICE
Electronic Arts / DICETechnical Fellow - Frostbite - Electronic Arts em Electronic Arts / DICE
Frostbite on
mobile
Niklas Nummelin
Electronic Arts / Frostbite
Me
 Niklas Nummelin
 Worked at EA for 2.5 years
 Mobile industry 9 years
 Passion for computer graphics and music
 Responsible for bringing up Frostbite graphics on mobile
Contents
 A brief history
 From GL to Metal and back
 Shaders, shaders, shaders
 Let there be light
 Summary and future work
A brief history
WHAT IS THIS MOBILE THING?
A brief history
 Initiative to bring Frostbite to mobile started 2.5 years ago
 Battlefield 4 was in development
 First goal: Supply tech for Tablet Commander
Frostbite on Mobile
A brief history
 Next goal: to get full Frostbite experience on mobile with Xbox 360
fidelity
 Showcase all Frostbite features but with limited scale
 Dynamic lighting (Sun light, few dynamic light sources)
 Effects
 Destruction
 Animated characters
 Vehicles
 Networking
 Terrain
A brief history
 First OpenGL ES 2.0 +
extensions
 Later OpenGL ES 3.0
 Exactly the same engine as
running on console/PC
A brief history
 HLSL shaders ported to GLSL with custom optimizations
 Added GLSL target to graph-based shader generator
 Aras / Mesa’s GLSL-optimizer to the rescue!
 Added full forward rendering
 Ended up with hybrid approach with Z-prepass
From GL to Metal and back
THEN WE WENT TO CUPERTINO
Frostbite on Mobile
From GL to Metal and back
 Brought up initial Metal renderer in weeks
 Custom Metal backend for glsl-optimizer
 Reached steady 30 fps with SSAO, DOF, Radiosity,
cascaded shadowmaps, HDR, color grading, FXAA and
lots of draw calls on a stock iPad Air 1
From GL to Metal and back
 New idioms on mobile: Command buffers, pipeline/state
objects, explicit lifetime management
 5x lower cpu overhead
 Explicit control of render passes and tile memory lifetime
 Alpha tested objects kept to a minimum
 Instancing not as beneficial anymore
From GL to Metal and back
 Next goal: Test the limits of the engine (and hardware)
 Get a vertical slice of Battlefield 4 running on iPad Air 2
Frostbite on Mobile
Frostbite on Mobile
From GL to Metal and back
 Two major challenges:
1. Engine had started to diverge in terms of memory
consumption from the xbox 360 days
From GL to Metal and back
From GL to Metal and back
 Two major challenges:
1. Engine had started to diverge in terms of memory
consumption from the xbox 360 days
2. Lots of shaders were written in pure HLSL
YACCGLO™ (Yet another cross-
compiler based on glsl-optimizer)
 Aka. Hellslinger
 DX11 HLSL frontend, Metal and GLSL backends
 Supports full compute, vertex and pixel shaders
 Supports all the various types of buffers/textures
 Separate textures and samplers on Metal
 FP16/FP32 (half/float)
 Cross-compiling all Frostbite shaders
 Outputs source file and json file with reflection meta data
Frostbite on Mobile
From GL to Metal and back
 Used our Metal experience to improve our OpenGL|ES
3.0 backend
 Spent time aligning the Metal and GL backends with the
consoles / PC
 Manage tile memory: glInvalidateFramebuffer, glClear
 Deferred rendering / Forward rendering on all platforms
 Most features on ES, but lower performance
Let there be light
LOTS OF PRETTY PHYSICAL LIGHTS
Let there be light
 Many lights supported using light tiling optimization
 See “Parallel graphics in Frostbite” SIGGRAPH 09 [1]
 All games moving to Physically Based Rendering
 See “Moving Frostbite to PBR” SIGGRAPH 14 [2]
Let there be light
 Light types
 Point lights, spot lights, area lights, shadow casting
equivalents, planar reflections, local reflection volumes
Frostbite on Mobile
Let there be light
 Light tiling Forward vs Deferred.
Light culling /
binning
Rasterization
Find tile /
accumulate
lights.
Light culling /
binning
Tile
classification
Indirect
dispatches for
each light type
Frostbite on Mobile
Let there be light
 Cross-compiling many
complex shaders
 Compute shaders for light
culling / binning
 Toggle between:
Deferred / Forward /
Forward+
Let there be light
 Cube map arrays for local reflections unw(ra/ar)ped to
2d lat-long texture arrays
 Some alu overhead when sampling, but supports
hardware adressing/filtering/mipmaps
Frostbite on Mobile
Let there be light
 Rewrote deferred light accumulation from cs to vs/ps
 Accumulate lights in tile memory 0/
 No indirect drawcalls/dispatches on Metal -> emulated
using early out vertex shader
Frostbite on Mobile
Optimizations
 Backend optimizations
 Expose tiler hint api and use a lot (nop:s on non-tilers)
 Merge as many render passes as possible
 Reduce state changes
Auto merging
Optimizations
 Shader code
 Use as many intrinsics / builtins as possible
 Use scalar math
 Careful packing / alignment of data
Summary and future work
WHERE DO WE GO NOW?
Summary and future work.
 Our approach: Get the full picture before diving into
details
 Today’s mobile hardware and api:s enables full engine
feature set
 Many tile memory specific optimizations can be done
without diverging code bases from desktop / consoles
 If building for multiple platforms, use cross-compiler
Summary and future work.
 New API:s: Vulkan / ES 3.1, spir-v
 Tiler specific shader optimizations (deferred shading)
 “Efficient Rendering with tile local storage” [3]
 Mobile specific shader optimizations (fp16/fp32 usage,
alu / bandwidth balance)
 Future: Tesselation, async compute, indirect
The end
“The best way to predict the future is to invent it”
– Alan Kay / Abraham Lincoln / Peter F. Drucker
Thanks for feedback: Johan Andersson, Kristoffer Benjaminsson, Yuriy
O’Donnell, Mathieu Guindon, Sébastien Hillaire, Sam Martin
For questions: niklas.nummelin@frostbite.com
References
 [1] Johan Andersson. “Parallel graphics in Frostbite – Current and
Future”. Siggraph 2009.
 [2] Charles de Rousiers & Sébastien Lagarde. “Moving Frostbite to
PBR”. Siggraph 2014.
 [3] M. Bjorge, S. Martin, S. Kakarlapudi, J-H. Fredriksen. “Efficient
rendering with tile local storage”. Siggraph 2014.
empowers game creators to shape the future of gaming
1 de 41

Recomendados

The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014) por
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)Philip Hammer
7.3K visualizações53 slides
Optimizing the Graphics Pipeline with Compute, GDC 2016 por
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Graham Wihlidal
135.4K visualizações99 slides
Moving Frostbite to Physically Based Rendering por
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingElectronic Arts / DICE
345.6K visualizações91 slides
The Rendering Technology of Killzone 2 por
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2Guerrilla
11.1K visualizações58 slides
A Bizarre Way to do Real-Time Lighting por
A Bizarre Way to do Real-Time LightingA Bizarre Way to do Real-Time Lighting
A Bizarre Way to do Real-Time LightingSteven Tovey
11.7K visualizações65 slides
Deferred Rendering in Killzone 2 por
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Guerrilla
19.7K visualizações55 slides

Mais conteúdo relacionado

Mais procurados

A Bit More Deferred Cry Engine3 por
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3guest11b095
12K visualizações27 slides
Stochastic Screen-Space Reflections por
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space ReflectionsElectronic Arts / DICE
156.8K visualizações91 slides
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing... por
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Johan Andersson
19.1K visualizações74 slides
Triangle Visibility buffer por
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility bufferWolfgang Engel
649 visualizações80 slides
Shiny PC Graphics in Battlefield 3 por
Shiny PC Graphics in Battlefield 3Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3Electronic Arts / DICE
92.3K visualizações95 slides
DirectX 11 Rendering in Battlefield 3 por
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3Electronic Arts / DICE
56.4K visualizações56 slides

Mais procurados(20)

A Bit More Deferred Cry Engine3 por guest11b095
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3
guest11b09512K visualizações
Stochastic Screen-Space Reflections por Electronic Arts / DICE
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space Reflections
Electronic Arts / DICE156.8K visualizações
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing... por Johan Andersson
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Johan Andersson19.1K visualizações
Triangle Visibility buffer por Wolfgang Engel
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility buffer
Wolfgang Engel649 visualizações
Shiny PC Graphics in Battlefield 3 por Electronic Arts / DICE
Shiny PC Graphics in Battlefield 3Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3
Electronic Arts / DICE92.3K visualizações
DirectX 11 Rendering in Battlefield 3 por Electronic Arts / DICE
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
Electronic Arts / DICE56.4K visualizações
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3 por Electronic Arts / DICE
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
Electronic Arts / DICE28K visualizações
Lighting the City of Glass por Electronic Arts / DICE
Lighting the City of GlassLighting the City of Glass
Lighting the City of Glass
Electronic Arts / DICE106.7K visualizações
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14 por AMD Developer Central
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
AMD Developer Central 31.2K visualizações
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite por Electronic Arts / DICE
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Electronic Arts / DICE29.8K visualizações
Rendering Tech of Space Marine por Pope Kim
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space Marine
Pope Kim20.5K visualizações
Advancements in-tiled-rendering por mistercteam
Advancements in-tiled-renderingAdvancements in-tiled-rendering
Advancements in-tiled-rendering
mistercteam2.2K visualizações
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009) por Johan Andersson
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Johan Andersson11.8K visualizações
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda por Electronic Arts / DICE
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
Electronic Arts / DICE58K visualizações
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run por Electronic Arts / DICE
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Electronic Arts / DICE32.1K visualizações
The Rendering Pipeline - Challenges & Next Steps por Johan Andersson
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next Steps
Johan Andersson101.1K visualizações
Crysis Next-Gen Effects (GDC 2008) por Tiago Sousa
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
Tiago Sousa10.5K visualizações
Destruction Masking in Frostbite 2 using Volume Distance Fields por Electronic Arts / DICE
Destruction Masking in Frostbite 2 using Volume Distance FieldsDestruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance Fields
Electronic Arts / DICE20.6K visualizações
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ... por Johan Andersson
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
Johan Andersson8K visualizações
Rendering Technologies from Crysis 3 (GDC 2013) por Tiago Sousa
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
Tiago Sousa24.6K visualizações

Destaque

FrameGraph: Extensible Rendering Architecture in Frostbite por
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteElectronic Arts / DICE
68.1K visualizações63 slides
High Dynamic Range color grading and display in Frostbite por
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteElectronic Arts / DICE
45.9K visualizações92 slides
Photogrammetry and Star Wars Battlefront por
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontElectronic Arts / DICE
151.5K visualizações164 slides
Rendering Battlefield 4 with Mantle por
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with MantleElectronic Arts / DICE
117.3K visualizações53 slides
5 Major Challenges in Real-time Rendering (2012) por
5 Major Challenges in Real-time Rendering (2012)5 Major Challenges in Real-time Rendering (2012)
5 Major Challenges in Real-time Rendering (2012)Electronic Arts / DICE
286.2K visualizações48 slides
Mantle for Developers por
Mantle for DevelopersMantle for Developers
Mantle for DevelopersElectronic Arts / DICE
147.8K visualizações39 slides

Destaque(18)

FrameGraph: Extensible Rendering Architecture in Frostbite por Electronic Arts / DICE
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in Frostbite
Electronic Arts / DICE68.1K visualizações
High Dynamic Range color grading and display in Frostbite por Electronic Arts / DICE
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in Frostbite
Electronic Arts / DICE45.9K visualizações
Photogrammetry and Star Wars Battlefront por Electronic Arts / DICE
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars Battlefront
Electronic Arts / DICE151.5K visualizações
Rendering Battlefield 4 with Mantle por Electronic Arts / DICE
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with Mantle
Electronic Arts / DICE117.3K visualizações
5 Major Challenges in Real-time Rendering (2012) por Electronic Arts / DICE
5 Major Challenges in Real-time Rendering (2012)5 Major Challenges in Real-time Rendering (2012)
5 Major Challenges in Real-time Rendering (2012)
Electronic Arts / DICE286.2K visualizações
Battlefield 4 + Frostbite + Mantle por Electronic Arts / DICE
Battlefield 4 + Frostbite + MantleBattlefield 4 + Frostbite + Mantle
Battlefield 4 + Frostbite + Mantle
Electronic Arts / DICE178.2K visualizações
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che... por Colin Barré-Brisebois
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barré-Brisebois84.2K visualizações
A Real-time Radiosity Architecture por Electronic Arts / DICE
A Real-time Radiosity ArchitectureA Real-time Radiosity Architecture
A Real-time Radiosity Architecture
Electronic Arts / DICE23.6K visualizações
How High Dynamic Range Audio Makes Battlefield: Bad Company Go BOOM por Anders Clerwall
How High Dynamic Range Audio Makes Battlefield: Bad Company Go BOOMHow High Dynamic Range Audio Makes Battlefield: Bad Company Go BOOM
How High Dynamic Range Audio Makes Battlefield: Bad Company Go BOOM
Anders Clerwall11.9K visualizações
Bending the Graphics Pipeline por Electronic Arts / DICE
Bending the Graphics PipelineBending the Graphics Pipeline
Bending the Graphics Pipeline
Electronic Arts / DICE18.6K visualizações
Introduction to Data Oriented Design por Electronic Arts / DICE
Introduction to Data Oriented DesignIntroduction to Data Oriented Design
Introduction to Data Oriented Design
Electronic Arts / DICE50.1K visualizações
Parallel Futures of a Game Engine por Johan Andersson
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game Engine
Johan Andersson142.3K visualizações
Stable SSAO in Battlefield 3 with Selective Temporal Filtering por Electronic Arts / DICE
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Electronic Arts / DICE185.5K visualizações
Terrain in Battlefield 3: A Modern, Complete and Scalable System por Electronic Arts / DICE
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemTerrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable System
Electronic Arts / DICE146.9K visualizações
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007) por Johan Andersson
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Johan Andersson16.3K visualizações
Audio for Multiplayer & Beyond - Mixing Case Studies From Battlefield: Bad Co... por Electronic Arts / DICE
Audio for Multiplayer & Beyond - Mixing Case Studies From Battlefield: Bad Co...Audio for Multiplayer & Beyond - Mixing Case Studies From Battlefield: Bad Co...
Audio for Multiplayer & Beyond - Mixing Case Studies From Battlefield: Bad Co...
Electronic Arts / DICE100.3K visualizações
Executable Bloat - How it happens and how we can fight it por Electronic Arts / DICE
Executable Bloat - How it happens and how we can fight itExecutable Bloat - How it happens and how we can fight it
Executable Bloat - How it happens and how we can fight it
Electronic Arts / DICE14.8K visualizações

Similar a Frostbite on Mobile

Unite 2013 optimizing unity games for mobile platforms por
Unite 2013 optimizing unity games for mobile platformsUnite 2013 optimizing unity games for mobile platforms
Unite 2013 optimizing unity games for mobile platformsナム-Nam Nguyễn
5K visualizações39 slides
Next generation mobile gp us and rendering techniques - niklas smedberg por
Next generation mobile gp us and rendering techniques - niklas smedbergNext generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedbergMary Chan
2.4K visualizações44 slides
Evolution of the modern graphics architectures with a focus on GPUs | Turing1... por
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...Persistent Systems Ltd.
1.3K visualizações30 slides
Minko - Flash Conference #5 por
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5Minko3D
17.2K visualizações47 slides
Gpu Programming With GPUImage and Metal por
Gpu Programming With GPUImage and MetalGpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and MetalJanie Clayton
4.7K visualizações52 slides
GPU Programming 360iDev por
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDevJanie Clayton
1.2K visualizações58 slides

Similar a Frostbite on Mobile(20)

Unite 2013 optimizing unity games for mobile platforms por ナム-Nam Nguyễn
Unite 2013 optimizing unity games for mobile platformsUnite 2013 optimizing unity games for mobile platforms
Unite 2013 optimizing unity games for mobile platforms
ナム-Nam Nguyễn5K visualizações
Next generation mobile gp us and rendering techniques - niklas smedberg por Mary Chan
Next generation mobile gp us and rendering techniques - niklas smedbergNext generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedberg
Mary Chan2.4K visualizações
Evolution of the modern graphics architectures with a focus on GPUs | Turing1... por Persistent Systems Ltd.
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
Persistent Systems Ltd.1.3K visualizações
Minko - Flash Conference #5 por Minko3D
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5
Minko3D17.2K visualizações
Gpu Programming With GPUImage and Metal por Janie Clayton
Gpu Programming With GPUImage and MetalGpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and Metal
Janie Clayton4.7K visualizações
GPU Programming 360iDev por Janie Clayton
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDev
Janie Clayton1.2K visualizações
Parallel Futures of a Game Engine (v2.0) por Johan Andersson
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)
Johan Andersson10.5K visualizações
FGS 2011: Making A Game With Molehill: Zombie Tycoon por mochimedia
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoon
mochimedia758 visualizações
Minko - Targeting Flash/Stage3D with C++ and GLSL por Minko3D
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko3D3.1K visualizações
01 intro-bps-2011 por mistercteam
01 intro-bps-201101 intro-bps-2011
01 intro-bps-2011
mistercteam493 visualizações
Gdc 14 bringing unreal engine 4 to open_gl por changehee lee
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
changehee lee2.8K visualizações
OTOY Presentation - 2016 NVIDIA GPU Technology Conference - April 5 2016 por otoyinc
OTOY Presentation - 2016 NVIDIA GPU Technology Conference - April 5 2016 OTOY Presentation - 2016 NVIDIA GPU Technology Conference - April 5 2016
OTOY Presentation - 2016 NVIDIA GPU Technology Conference - April 5 2016
otoyinc80K visualizações
BitSquid Tech: Benefits of a data-driven renderer por tobias_persson
BitSquid Tech: Benefits of a data-driven rendererBitSquid Tech: Benefits of a data-driven renderer
BitSquid Tech: Benefits of a data-driven renderer
tobias_persson6.8K visualizações
Introduction to android (and mobile) game development por Ruslan Novikov
Introduction to android (and mobile) game developmentIntroduction to android (and mobile) game development
Introduction to android (and mobile) game development
Ruslan Novikov3.5K visualizações
Commandlistsiggraphasia2014 141204005310-conversion-gate02 por RubnCuesta2
Commandlistsiggraphasia2014 141204005310-conversion-gate02Commandlistsiggraphasia2014 141204005310-conversion-gate02
Commandlistsiggraphasia2014 141204005310-conversion-gate02
RubnCuesta210 visualizações
Getting Intergraph and Esri to Play Nicely Using FME por Safe Software
Getting Intergraph and Esri to Play Nicely Using FMEGetting Intergraph and Esri to Play Nicely Using FME
Getting Intergraph and Esri to Play Nicely Using FME
Safe Software3.2K visualizações
Building iPhone Apps: From Flash Lite to Corona por Anscamobile
Building iPhone Apps: From Flash Lite to CoronaBuilding iPhone Apps: From Flash Lite to Corona
Building iPhone Apps: From Flash Lite to Corona
Anscamobile769 visualizações
Architectural Analysis of Game Machines por Praveen AP
Architectural Analysis of Game MachinesArchitectural Analysis of Game Machines
Architectural Analysis of Game Machines
Praveen AP363 visualizações
Crysis 2-key-rendering-features por Raimundo Renato
Crysis 2-key-rendering-featuresCrysis 2-key-rendering-features
Crysis 2-key-rendering-features
Raimundo Renato1.3K visualizações
Your Game Needs Direct3D 11, So Get Started Now! por Johan Andersson
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!
Johan Andersson5.9K visualizações

Mais de Electronic Arts / DICE

GDC2019 - SEED - Towards Deep Generative Models in Game Development por
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentElectronic Arts / DICE
3.1K visualizações79 slides
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge por
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeSIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeElectronic Arts / DICE
3.8K visualizações94 slides
SEED - Halcyon Architecture por
SEED - Halcyon ArchitectureSEED - Halcyon Architecture
SEED - Halcyon ArchitectureElectronic Arts / DICE
1.9K visualizações137 slides
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing por
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingElectronic Arts / DICE
8K visualizações127 slides
Khronos Munich 2018 - Halcyon and Vulkan por
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanElectronic Arts / DICE
9.2K visualizações93 slides
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing por
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingElectronic Arts / DICE
2.5K visualizações97 slides

Mais de Electronic Arts / DICE(17)

GDC2019 - SEED - Towards Deep Generative Models in Game Development por Electronic Arts / DICE
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game Development
Electronic Arts / DICE3.1K visualizações
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge por Electronic Arts / DICE
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeSIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
Electronic Arts / DICE3.8K visualizações
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing por Electronic Arts / DICE
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Electronic Arts / DICE8K visualizações
Khronos Munich 2018 - Halcyon and Vulkan por Electronic Arts / DICE
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and Vulkan
Electronic Arts / DICE9.2K visualizações
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing por Electronic Arts / DICE
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
Electronic Arts / DICE2.5K visualizações
CEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism por Electronic Arts / DICE
CEDEC 2018 - Functional Symbiosis of Art Direction and ProceduralismCEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
CEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
Electronic Arts / DICE1.8K visualizações
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing por Electronic Arts / DICE
SIGGRAPH 2018 - PICA PICA and NVIDIA TuringSIGGRAPH 2018 - PICA PICA and NVIDIA Turing
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
Electronic Arts / DICE2.8K visualizações
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing por Electronic Arts / DICE
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
Electronic Arts / DICE2.4K visualizações
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems por Electronic Arts / DICE
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open ProblemsHPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
Electronic Arts / DICE3.6K visualizações
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le... por Electronic Arts / DICE
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
Electronic Arts / DICE2.7K visualizações
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering por Electronic Arts / DICE
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingDD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
Electronic Arts / DICE16.1K visualizações
Creativity of Rules and Patterns: Designing Procedural Systems por Electronic Arts / DICE
Creativity of Rules and Patterns: Designing Procedural SystemsCreativity of Rules and Patterns: Designing Procedural Systems
Creativity of Rules and Patterns: Designing Procedural Systems
Electronic Arts / DICE1.1K visualizações
Shiny Pixels and Beyond: Real-Time Raytracing at SEED por Electronic Arts / DICE
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDShiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Electronic Arts / DICE34.3K visualizações
Future Directions for Compute-for-Graphics por Electronic Arts / DICE
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
Electronic Arts / DICE7K visualizações
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu... por Electronic Arts / DICE
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
Electronic Arts / DICE5.7K visualizações
Modular Rigging in Battlefield 3 por Electronic Arts / DICE
Modular Rigging in Battlefield 3Modular Rigging in Battlefield 3
Modular Rigging in Battlefield 3
Electronic Arts / DICE131K visualizações

Último

Cycleops - Automate deployments on top of bare metal.pptx por
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptxThanassis Parathyras
30 visualizações12 slides
SUGCON ANZ Presentation V2.1 Final.pptx por
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptxJack Spektor
21 visualizações34 slides
DevsRank por
DevsRankDevsRank
DevsRankdevsrank786
10 visualizações1 slide
Software testing company in India.pptx por
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptxSakshiPatel82
7 visualizações9 slides
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... por
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Donato Onofri
643 visualizações34 slides
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea... por
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...Safe Software
391 visualizações59 slides

Último(20)

Cycleops - Automate deployments on top of bare metal.pptx por Thanassis Parathyras
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptx
Thanassis Parathyras30 visualizações
SUGCON ANZ Presentation V2.1 Final.pptx por Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor21 visualizações
DevsRank por devsrank786
DevsRankDevsRank
DevsRank
devsrank78610 visualizações
Software testing company in India.pptx por SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 visualizações
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... por Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri643 visualizações
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea... por Safe Software
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...
Safe Software391 visualizações
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... por Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares15 visualizações
How to Make the Most of Regression and Unit Testing.pdf por Abhay Kumar
How to Make the Most of Regression and Unit Testing.pdfHow to Make the Most of Regression and Unit Testing.pdf
How to Make the Most of Regression and Unit Testing.pdf
Abhay Kumar10 visualizações
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... por Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares9 visualizações
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ... por marksimpsongw
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
marksimpsongw74 visualizações
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon por Deltares
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
Deltares11 visualizações
MariaDB stored procedures and why they should be improved por Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
Federico Razzoli8 visualizações
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... por Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 visualizações
Winter '24 Release Chat.pdf por melbourneauuser
Winter '24 Release Chat.pdfWinter '24 Release Chat.pdf
Winter '24 Release Chat.pdf
melbourneauuser9 visualizações
Citi TechTalk Session 2: Kafka Deep Dive por confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 visualizações
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... por Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 visualizações
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida por Deltares
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
Deltares17 visualizações
Applying Platform Engineering Thinking to Observability.pdf por Natan Yellin
Applying Platform Engineering Thinking to Observability.pdfApplying Platform Engineering Thinking to Observability.pdf
Applying Platform Engineering Thinking to Observability.pdf
Natan Yellin12 visualizações
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge... por Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
Deltares16 visualizações

Frostbite on Mobile

  • 2. Me  Niklas Nummelin  Worked at EA for 2.5 years  Mobile industry 9 years  Passion for computer graphics and music  Responsible for bringing up Frostbite graphics on mobile
  • 3. Contents  A brief history  From GL to Metal and back  Shaders, shaders, shaders  Let there be light  Summary and future work
  • 4. A brief history WHAT IS THIS MOBILE THING?
  • 5. A brief history  Initiative to bring Frostbite to mobile started 2.5 years ago  Battlefield 4 was in development  First goal: Supply tech for Tablet Commander
  • 7. A brief history  Next goal: to get full Frostbite experience on mobile with Xbox 360 fidelity  Showcase all Frostbite features but with limited scale  Dynamic lighting (Sun light, few dynamic light sources)  Effects  Destruction  Animated characters  Vehicles  Networking  Terrain
  • 8. A brief history  First OpenGL ES 2.0 + extensions  Later OpenGL ES 3.0  Exactly the same engine as running on console/PC
  • 9. A brief history  HLSL shaders ported to GLSL with custom optimizations  Added GLSL target to graph-based shader generator  Aras / Mesa’s GLSL-optimizer to the rescue!  Added full forward rendering  Ended up with hybrid approach with Z-prepass
  • 10. From GL to Metal and back THEN WE WENT TO CUPERTINO
  • 12. From GL to Metal and back  Brought up initial Metal renderer in weeks  Custom Metal backend for glsl-optimizer  Reached steady 30 fps with SSAO, DOF, Radiosity, cascaded shadowmaps, HDR, color grading, FXAA and lots of draw calls on a stock iPad Air 1
  • 13. From GL to Metal and back  New idioms on mobile: Command buffers, pipeline/state objects, explicit lifetime management  5x lower cpu overhead  Explicit control of render passes and tile memory lifetime  Alpha tested objects kept to a minimum  Instancing not as beneficial anymore
  • 14. From GL to Metal and back  Next goal: Test the limits of the engine (and hardware)  Get a vertical slice of Battlefield 4 running on iPad Air 2
  • 17. From GL to Metal and back  Two major challenges: 1. Engine had started to diverge in terms of memory consumption from the xbox 360 days
  • 18. From GL to Metal and back
  • 19. From GL to Metal and back  Two major challenges: 1. Engine had started to diverge in terms of memory consumption from the xbox 360 days 2. Lots of shaders were written in pure HLSL
  • 20. YACCGLO™ (Yet another cross- compiler based on glsl-optimizer)  Aka. Hellslinger  DX11 HLSL frontend, Metal and GLSL backends  Supports full compute, vertex and pixel shaders  Supports all the various types of buffers/textures  Separate textures and samplers on Metal  FP16/FP32 (half/float)  Cross-compiling all Frostbite shaders  Outputs source file and json file with reflection meta data
  • 22. From GL to Metal and back  Used our Metal experience to improve our OpenGL|ES 3.0 backend  Spent time aligning the Metal and GL backends with the consoles / PC  Manage tile memory: glInvalidateFramebuffer, glClear  Deferred rendering / Forward rendering on all platforms  Most features on ES, but lower performance
  • 23. Let there be light LOTS OF PRETTY PHYSICAL LIGHTS
  • 24. Let there be light  Many lights supported using light tiling optimization  See “Parallel graphics in Frostbite” SIGGRAPH 09 [1]  All games moving to Physically Based Rendering  See “Moving Frostbite to PBR” SIGGRAPH 14 [2]
  • 25. Let there be light  Light types  Point lights, spot lights, area lights, shadow casting equivalents, planar reflections, local reflection volumes
  • 27. Let there be light  Light tiling Forward vs Deferred. Light culling / binning Rasterization Find tile / accumulate lights. Light culling / binning Tile classification Indirect dispatches for each light type
  • 29. Let there be light  Cross-compiling many complex shaders  Compute shaders for light culling / binning  Toggle between: Deferred / Forward / Forward+
  • 30. Let there be light  Cube map arrays for local reflections unw(ra/ar)ped to 2d lat-long texture arrays  Some alu overhead when sampling, but supports hardware adressing/filtering/mipmaps
  • 32. Let there be light  Rewrote deferred light accumulation from cs to vs/ps  Accumulate lights in tile memory 0/  No indirect drawcalls/dispatches on Metal -> emulated using early out vertex shader
  • 34. Optimizations  Backend optimizations  Expose tiler hint api and use a lot (nop:s on non-tilers)  Merge as many render passes as possible  Reduce state changes Auto merging
  • 35. Optimizations  Shader code  Use as many intrinsics / builtins as possible  Use scalar math  Careful packing / alignment of data
  • 36. Summary and future work WHERE DO WE GO NOW?
  • 37. Summary and future work.  Our approach: Get the full picture before diving into details  Today’s mobile hardware and api:s enables full engine feature set  Many tile memory specific optimizations can be done without diverging code bases from desktop / consoles  If building for multiple platforms, use cross-compiler
  • 38. Summary and future work.  New API:s: Vulkan / ES 3.1, spir-v  Tiler specific shader optimizations (deferred shading)  “Efficient Rendering with tile local storage” [3]  Mobile specific shader optimizations (fp16/fp32 usage, alu / bandwidth balance)  Future: Tesselation, async compute, indirect
  • 39. The end “The best way to predict the future is to invent it” – Alan Kay / Abraham Lincoln / Peter F. Drucker Thanks for feedback: Johan Andersson, Kristoffer Benjaminsson, Yuriy O’Donnell, Mathieu Guindon, Sébastien Hillaire, Sam Martin For questions: niklas.nummelin@frostbite.com
  • 40. References  [1] Johan Andersson. “Parallel graphics in Frostbite – Current and Future”. Siggraph 2009.  [2] Charles de Rousiers & Sébastien Lagarde. “Moving Frostbite to PBR”. Siggraph 2014.  [3] M. Bjorge, S. Martin, S. Kakarlapudi, J-H. Fredriksen. “Efficient rendering with tile local storage”. Siggraph 2014.
  • 41. empowers game creators to shape the future of gaming

Notas do Editor

  1. Hi everyone! My name is Niklas and I’ve been working at EA for the last 2.5 years. My main responsibility there have been to bring up the graphics side of the Frostbite engine on mobile devices.
  2. This talk will focus on our journey so far. I’ll start off by running through some history. Then talk about what we’ve done the last year and share some of our findings.
  3. When I started 2.5 years ago, Battlefield 4 was in full production. We were a small team consisting on 4 people that had taken on the task to get selected parts of Frostbite running on tablets. The pilot project that we were building this for was Battlefield 4 Tablet Commander, which was a game where you could join battlefield servers and play as a commander.
  4. This is what it ended up looking like. The commander mode had actually been available in earlier battlefield games, but was brought back into Battlefield 4. By supporting Frostbite on tablets we could re-use large parts of that code, making the time to build the game a lot shorter.
  5. While doing this we had started to develop a more long-term plan for what Frostbite on Mobile could be in the future. We had the strong feeling that we could bring the full frostbite experience to mobile with xbox 360 fidelity within a year, so we set out our next goal. Also we wanted to see if the dynamic nature of the Frostbite engine could play well on mobile and as the engine already scaled from 360 to gen4 console and PC quality, we predicted this should be possible.
  6. At the time we started development were still limited by OpenGL|ES 2.0, but with a wide variety of extensions. We got a lot of functionality up, adding support for extensions to utilize hardware shadow sampling and instancing. It was hard to keep all the various devices running at all times due to the fragmentation landscape and quality of driver implementations. Then came OpenGL|ES 3.0 and we could almost remove all of the extensions we used and just use plain OpenGL|ES 3.0. Compatibiilty started to become much better. As we didn’t have a legacy to maintain, we placed our bets on ES3 and beyond. Similar to how we bet on DX10 early for PC.
  7. So to understand what kind of work we had to do: Frostbite have two main types of shaders. Shader programs, which are hand-written shaders that are written by programmers for solving a specific task. Surface shaders, which are shaders represented by graphs authored by artists in our editor usually used as materials for objects. All the hand-written shaders, like post processing etc, we manually ported to GLSL as it left us the opportunity to optimize them fully for our targets. We did a lot of optimizations like removing dependant texture reads and moving heavy computations out to the vertex shaders. For the surface material shaders we just added GLSL emitting code to our shader generator. As many others we found this nice tool by Aras of Unity called GLSL-optimizer and made use of that to strip our final code down to reasonable sizes. One of the biggest changes to the engine we had to do then was to add support for forward rendering of both opaque and transparent objects. The engine had been exclusively using a full deferred renderer on all platforms, but due to the bandwidth restrictions on mobile devices we had to add support for forward rendering. We got the best performance by using a hybrid approach where we did a z prepass and used that depth buffer for calculating all screen space depth buffer effects, such as accumulating the shadow map cascades in a screen space shadow buffer, computing ssao and downsampling depth buffer to a half-res depth buffer for the half-res transparency pass. The biggest benefit here was that we reduced the bandwidth by not having to store / load the large hdr buffer to/from the tile memory after the opaque pass, but could instead continue with the transparent passes keeping data in tile memory as long as possible. Everything was looking pretty promising but we were still lacking features that the engine had started to rely heavily on.
  8. Then about a year ago we got the opportunity to test pilot Metal. The plan was to have demo for WWDC so we went there and luckily we finished it in time.
  9. This a capture from the demo we showed at WWDC.
  10. We went to Cupertino and worked on this for a number of weeks together with a small team from Popcap and our co-workers at home. As we already used the glsl-optimizer compiler, we quickly realized that the easiest way to add support for all the shaders we needed would be to add a backend that generated Metal code. After implementing the Metal API and creating the compiler backend all of this turned out to be working really well and we could toggle on all the features needed. It enabled us to reach steady 30 fps with SSAO, DOF, Radiosity, cascaded shadowmaps, HDR color grading, FXAA and lots of draw calls on a stock iPad Air 1.
  11. Apple had taken a lot of inspiration from how API:s were starting to be designed for the traditional platforms and put these idioms on to mobile. They also added new mobile specific concepts like being able to control the lifetime of renderpasses and tile memory. The Metal API turned out to be a good fit for Frostbite as the engine had continously been moving towards more explicit graphics api:s and memory management. Due to the low-overhead nature of the api we could see a 5x lower cpu overhead than what we had with OpenGL. Also using the api for controlling the tile memory lifetime we could guarantee our bandwidth from/to tile-memory was kept to a minimum. However the gpu bottlenecks stayed the same. We had to reduce our amount of alpha tested objects to a minimum. Also, due to the reduced cpu overhead, instancing didn’t provide us with any major benefits in terms of performance on the cpu/gpu. At least not for the dataset for the demo.
  12. At this point we were very excited to see how far we could push our Metal backend and the hardware, so we set out a new goal. This time pretty ambitious. We decided that we would try to get a vertical slice of Battlefield 4 up and running on an iPad Air 2 that had just been released.
  13. And we succeeded. The most complex new features we got up and running was our advanced terrain system that uses a virtual texture to be able to visualize large terrains and our mesh scattering system used to distribute and render vegetation and rocks.
  14. As the content still had quality levels for the old consoles we could piggy back on that to get suitable levels of details. We got this running in 30 fps on an iPad Air 2.
  15. Doing this we had two major challenges. Ps4 and Xbox one had become the primary engine targets with xbox360/ps3 being removed from the engine. Keeping memory consumption down wasn’t everyone’s top priority anymore. Also, we had never tried to run anything of this size on our tablets so we were very concerned about memory. However as we knew BF4 shipped on 512 MB consoles we were hopeful.
  16. To tackle this we added fine grained statistics for our gpu textures / buffers. The engine have tags for all the resources, so we added commands for printing all the resources by size and usage frequency to easily see what we should focus on and could get rid of. Here’s an image of a statistics view that we’ve used quite a lot to keep track and get an overview of our resources. Due to the various quality of native profilers and the difficulties of setting up environments for them we wanted to be able to profile as much as possible with our own cross platform code We had to compress all the textures, which took many hours for a single level. The virtual terrain texture however, as it was built in runtime and we had no suitable runtime compressor for mobiles, needed to be stored raw and took almost 100 mb.
  17. The biggest challenge was the fact that a lot of custom shaders were written in pure HLSL. We could of course just have ported all shaders to GLSL as we did previously, but as HLSL was the main shader language of the engine and we had noticed it is a pain to maintain multiple versions of shaders we decided it was time to revisit the way we manage shaders on mobile. Also the shader languages of the mobile platforms had matured.
  18. As we already had backends for glsl-optimizer it made sense to use that as a basis for a cross-compiler. We had a look at the compiler source code and decided it would be possible to create a decent cross-compiler by adding a frontend that parses HLSL and some code to handle unique HLSL features. A few months later that was done. It is a DX11 style syntax compiler that supports compiling all of our shaders, including compute shaders. The result of a compilation is a Metal or GLSL source file, with a json file containing reflection such as constant buffer names to offsets/sizes, resource mappings and number of compute threads per group.
  19. Here’s an image showing some of these features. It handles implicit type conversions, function default parameters, HLSL semantics, HLSL matrix syntax etc. HLSL register name to actual resource index is provided in the reflection data. Not shown here is support for compute shader writeable buffers, atomics and append/consume buffers through buffers + atomics. One nice side effect of having our own compiler is that we have been able to make workarounds for vendor specific bugs in the backends of our compiler.
  20. With all the focus on Metal, we realised we could improve our OpenGL|ES backend, so we spent time fixing bugs and aligning the platforms even more. Metal, being a pretty transparent api, had learnt us a lot of how mobile GPU:s should be treated. We used this knowledge to refine our OpenGL|ES implementation. For instance when we created the Metal backend we added an explicit api for controlling if the frame buffer textures should be loaded to tile memory and stored back. We had started to make heavy use of this api in the code to reduce bandwidth. This optimization could be transitioned to ES by just implementing that api using glInvalidateFramebuffer and glClear. We also made an effort into supporting switching deferred and forward rendering in runtime for all our platforms, to be able to compare performance and try out features in both modes.
  21. At this point the PBR transition of frostbite was nearly done. With everything we had done to close the gap between mobile and console/desktop, PBR and dynamic lighting seemed to be a pretty low hanging fruit. Also, all the Frostbite games were transitioning to our new PBR system for managing our materials and lights so we needed it.
  22. There’s a few good talks going into details of how this has been achieved in the engine. The images here shows some upcoming games and from now on all the Frostbite games are Gen4 console / PC only.
  23. The engine supports multiple types of lights including lights with shadowmaps, planar reflections and local reflections through cube maps. Multiple local reflections can be baked in runtime or offline and stored in a database and loaded on demand into a texture array.
  24. In order to be able to render many of these lights efficiently we need to create a spatial data structure. We do this by taking the set of lights that are inside the view frustum and perform a pass that bins them into 2d-tiles, usually 16x16 pixels. It tries to eliminate as many lights as possible by using various culling techniques against each tile frustum and a coarse z-buffer consisting of the min and max z per tile. The result of this pass is a 2d-texture or buffer, containing light counts for each light type and an offset into a buffer of indices that in turn references the actual light data. This extra indirection is used to reduce the amount of memory and copies needed for the light data.
  25. The data produced from the light culling pass can then be used to get the list of lights that can potentially affect each pixel. We can use this data structure for both forward and deferred rendering. In the forward case it’s simple. When rasterizing primitives we can just determine which tile we’re in to get the list of lights and then iterate over them to accumulate their values. In the deferred case, however, as we have already rasterized the g-buffers we need a way of not having to process tiles that don’t contain lights. Therefore we run a compute shader after the binning pass that finds out which types of lights are affecting each tile. This information is used to issue several indirect dispatches, that only process the tiles affected by lights, with optimized shaders for each permutation of lights.
  26. Here’s an illustration of the steps involved when culling and applying lights using our deferred path. The first image shows the final image. The upper-right image visualizes the light grid, and the bottom images show two of the passes that are executed to apply lights when doing deferred rendering. As you can see we will only process the tiles that gets affected by the lights.
  27. As usual it turned out to be more work than expected. Getting the complex cross-compiled shaders even to compile in the native compilers was non-trivial. Currently the light culling / binning phase relies heavily on compute shaders, so as of today that is a requirement. Compute support on mobile isn’t optimal yet, so we could probably benefit from doing the culling on the cpu early on in the frame. We won’t be able to use the depth buffer for the the culling, but doing clustering on the cpu could erase the need. As we had previously added deferred/forward toggle, we implemented support for being able to toggle a z prepass. This prepass helps when doing the light culling with forward rendering at the cost of rendering extra geometry.
  28. There were a few things we had to do to support some of the new features in the engine on mobile. As both vanilla ES3 and Metal were missing support for cubemap arrays we had to add pass that when baking the reflection volumes into cube maps converted them to 2d lat-long textures. This adds a small alu overhead when getting a sample, but works properly with adressing modes, bilinear filtering and mipmaps. Also we can use exactly the same code with a different function for sampling the texture.
  29. Having an array of reflection textures allows us to sample different reflection volumes per object or even several per object when doing deferred light accumulation.
  30. We added a vertex/pixel-shader version of the deferred light accumulation pass in order to be able to emulate the indirect dispatches with optimized shaders for applying lights. Basically the vertex shader receives the indirect args buffer and emits an offscreen primitive if the tile to be rendered is out of bounds. Also this meant we could stay in tile memory when accumulating all the different light types.
  31. It’s worth mentioning that everything is dynamic, ranging from the lights to dynamic shadowmaps for every light, to dynamically updated reflection views.
  32. In order to reach 30 fps with all the fancy new features we had to further optimize what we had. Instead of changing the algorithms we attacked the problem by trying to optimize our backends and shader code as much as possible. As I previously mentioned we had implemented an api to tell the backend what to do with the frame buffer textures. Using this information we could also in the backend merge many render passes, without the user having to care about it. In GL drivers this already happens in many cases, but on Metal where things are more explicit we had to manage this. In some cases we restructured the order of passes to be able to merge them on mobile, which didn’t affect the performance on non-mobile platforms. We also added a lot of redundant state filtering, including keeping common buffers and textures at fixed register indicies to reduce state changes.
  33. In terms of shader code we added a lot of intrinsics to the cross-compiler to get as efficient code as possible. In many cases these maps to single instructions. Also we disabled vector optimization passes in our cross-compiler to help optimizing for scalar alu:s and not loose any information for the native compilers. Also still don’t expect compilers to optimize even the trivial things for you. Our performance of some of the more advanced shaders were doubled by managing packing of structs ourselves in the cross-compiler.
  34. To summarize our work has shown that a bleeding edge engine can run on today’s mobile hardware. We’ve done a straight implementation of the engine, cross compiling all shaders with minor divergence. Our approach has been to get the full picture before starting to tweak the details. We prefer to disable slow features until we attack them and attack the ones giving the most bang for the buck first. We believe we’re at a point now when we have the full picture and can start diving into the details. Things we have noticed: Many tile memory specific optimizations such as merging render passes and specifying how frame buffer textures should be loaded and stored can be done without diverging code bases. Cross-compilation is key.
  35. We hope that Vulkan will get a good uptake on Android as this style of api has proven to be a good fit for our engine. Until Vulkan has gained some momentum, we will stick to ES3 and experiment with ES 3.1. We haven’t had time to experiment with the tile storage yet and really want to see what can be done it with it. There’s a really interesting talk from last year going into the details on how this can be used to optimize deferred rendering. Also due to most mobile gpu:s having native support for both fp16 and fp32 operatons, and with newer gpu:s some alu may perform better than a single texture lookup we want to find a good balance there. Frostbite has also started to utilize async compute, tesselation and indirect dispatches a lot so we hope to see more of that on Mobile in the future.
  36. I’ll wrap up with this quote, that apparently has been said by many famous persons, because I think it resonates well with what we all do in the mobile space. If you have any questions, don’t hesitate to mail me here. Thank you!
  37. Here are the previously mentioned talks.