Page 1
© 2016 Autodesk© 2016 Autodesk Join the conversation #AU2016
Tips and Tricks to Get the Most out of Your Virtual-Reality
Experiences in Stingray
Olivier Dionne Software Development Manager
Benjamin Slapcoff Software Engineer
Andrew Grant Product Manager
Page 2
© 2016 Autodesk© 2016 Autodesk
Stingray Renderer Overview
Profiler and VR Optimizations
Building Immersive Experiences
Content Tips and Tricks
Outline
Page 3
© 2016 Autodesk© 2016 Autodesk
Warhammer Vermintide - Fatshark, [PC | PS4 |
XBox]
Page 4
© 2016 Autodesk© 2016 Autodesk
Hamiltons Great Adventure - Fatshark
[PC/PS3/Android]War of the Roses- Fatshark [PC]
Page 5
© 2016 Autodesk© 2016 Autodesk
Helldivers - Arrowhead (Sony) [PC | PS4 | PS3 |
PS Vita]
Page 6
© 2016 Autodesk© 2016 Autodesk
Gauntlet - Arrowhead (Sony) [PS4, PC]
Page 7
© 2016 Autodesk© 2016 Autodesk
The Showdown Effect - Arrowhead [PC]
Page 8
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
Page 9
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
Page 10
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
Page 11
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
Page 12
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
Page 13
© 2016 Autodesk© 2016 Autodesk
Shaders, resource creation, resource manipulation and flow of
rendering pipeline entirely defined in data
Data is expressed in SJSON
Hot-reloadable for quick iteration times
Allows for fast experimentation and debugging
Flexible Data-Driven Renderer
Page 14
© 2016 Autodesk© 2016 Autodesk
Ties all rendering sub-systems
Dictates the order of operations for a
frame
Defines quality settings, device
capabilities and default shader libraries to
load
Three key ingredients
Resource sets – memory allocations /
deallocations
Resource generators – resource updating
Layer configurations – frame scheduling
Stingray render_config
Page 15
© 2016 Autodesk© 2016 Autodesk
High refresh rates: 90Hz (11.11ms per frame)
Frame buffer: 2160x1200
Super sampled to reduce aliasing artifacts
Off-screen buffer scaled by 1.5x in each dimension (3240x1800)
Shaded visible pixels
Challenges in VR
Resolution Refresh Rate (Hz) MPixels per Second
720p 60 55
1080p 60 124
2160p 60 498
VR (3240x1800) 90 525
Page 16
© 2016 Autodesk© 2016 Autodesk
Sequential stereo rendering
Two distinct scene cameras to represent eyes. Submit entire
scene for left eye, then resubmit scene again for right eye.
Pros:
Easiest strategy to start supporting VR devices and their
tracking systems
Cons:
Inefficient: Draw calls and state changes are doubled
Not CPU or GPU cache friendly!
Stingray VR – Humble beginnings…
Page 17
© 2016 Autodesk© 2016 Autodesk
Live Design Booth AU2015
Stingray VR – Humble beginnings…
Page 18
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
Page 19
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
Page 20
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
Page 21
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
Page 22
© 2016 Autodesk© 2016 Autodesk
Stingray VR – Humble beginnings…
“Gentlemen, we can rebuild him. We have the technology…”
Page 23
© 2016 Autodesk© 2016 Autodesk
Frustums are a big deal…
Stingray VR – Optimizations
Culling Cascaded shadow
mapping
Clustered shading
Page 24
© 2016 Autodesk© 2016 Autodesk
Compute single compound frustum to incorporate both eyes
Stingray VR – Optimizations
L
R
Page 25
© 2016 Autodesk© 2016 Autodesk
Bail early on non-visible (depth and stencil compare)
Stingray VR – Optimizations
Page 26
© 2016 Autodesk© 2016 Autodesk
GPU geometry instancing to render in stereo
Stingray VR – Optimizations
Even instances clip
position scaled and
shifted left
Odd instances clip
position scaled and
shifted right
Dynamic clip plane
Geometry
instance count
doubled
Page 27
© 2016 Autodesk© 2016 Autodesk
Stingray VR - Today
Page 28
© 2016 Autodesk© 2016 Autodesk
Adaptive quality
Foveated rendering
Multi GPU support
Mobile optimizations
Stingray VR – What’s Next
Page 29
© 2016 Autodesk© 2016 Autodesk
Building VR Experiences
using Stingray
Page 30
© 2016 Autodesk© 2016 Autodesk
Template for both Oculus and HTC Vive
Very similar functionality exposed in both the Lua API and Flow
Stingray VR Templates
Page 31
© 2016 Autodesk© 2016 Autodesk
Page 32
© 2016 Autodesk© 2016 Autodesk
Page 33
© 2016 Autodesk© 2016 Autodesk
Template for both Oculus and HTC Vive
Very similar functionality exposed in both the Lua API and Flow
Initialization in respective lua files (steam_vr.lua/oculus.lua)
Stingray VR Templates
VR settings in settings.ini
A lot of premade functionality present in the templates
Page 34
© 2016 Autodesk© 2016 Autodesk
Page 35
© 2016 Autodesk© 2016 Autodesk
First Example: Teleportation
Page 36
© 2016 Autodesk© 2016 Autodesk
Page 37
© 2016 Autodesk© 2016 Autodesk
Teleporting with a fade transition…
Page 38
© 2016 Autodesk© 2016 Autodesk
Teleportation Marker
Page 39
© 2016 Autodesk© 2016 Autodesk
Last improvement…
Page 40
© 2016 Autodesk© 2016 Autodesk
Without Local Position Adjustment
With Local Position Adjustment
Page 41
© 2016 Autodesk© 2016 Autodesk
Final Result
Page 42
© 2016 Autodesk© 2016 Autodesk
Page 43
© 2016 Autodesk© 2016 Autodesk
Second example: Picking up objects
Page 44
© 2016 Autodesk© 2016 Autodesk
Second example: Picking up objects
Page 45
© 2016 Autodesk© 2016 Autodesk
Multi-threaded game engine (Game thread, Render thread, GPU
thread, etc).
GPU thread operates 2 frames behind Game Thread
VR Trackers updated on Render Thread
Page 46
© 2016 Autodesk© 2016 Autodesk
Page 47
© 2016 Autodesk© 2016 Autodesk
Documentation and Online
Resources
Page 48
© 2016 Autodesk© 2016 Autodesk
Optimizing Content For
VR in Stingray
Page 49
© 2016 Autodesk© 2016 Autodesk
Don’t make me sick
Page 50
© 2016 Autodesk© 2016 Autodesk
Page 51
© 2016 Autodesk© 2016 Autodesk
Is overdraw set too high?
Am I running too many post-processes?
Am I rendering too many polygons?
Am I running out of GPU texture memory?
Am I casting too many shadows? (batches)
Typical Optimization Checklist
Page 52
© 2016 Autodesk© 2016 Autodesk
Reduce overdraw to 1.4
Templates are 1.6 by default
Disable TAA
Enable FXAA
Render Settings – overdraw and anti-aliasing
Page 53
© 2016 Autodesk© 2016 Autodesk
Disable all un-necessary post processes
Keep:
Bloom
Auto-Exposure
Post Processes
Page 54
© 2016 Autodesk© 2016 Autodesk
Red Herring
Poly Reduction
Page 55
© 2016 Autodesk© 2016 Autodesk
3DS Max:
Optimize, ProOptimizer
Maya
PolyReduce
Simplygon
Instant Field Aligned Meshes:
https://github.com/wjakob/instant-meshes
Poly Reduction Tools
Page 56
© 2016 Autodesk© 2016 Autodesk
Texture Blowout
Page 57
© 2016 Autodesk© 2016 Autodesk
Am I maxing out my texture memory?
Tool: Procexp
GPU Tab
GPU Dedicated Memory
Optimization Checklist: Textures
Page 58
© 2016 Autodesk© 2016 Autodesk
Resize all textures to be powers-of-two and of
reasonable size
1024x1024, 256x512, etc
Tool:
XnView
Show All Files (recursive)
Sort by Properties
Batch processing
Texture Optimization Basics
Page 59
© 2016 Autodesk© 2016 Autodesk
Compression requirements
Why power of two?
Page 60
© 2016 Autodesk© 2016 Autodesk
Enable compression on all textures:
Color(albedo) no alpha: DXT1
Color with alpha: DXT5
Normal: BC5
RMA: DXT1
Single-channel linear textures: BC4
Texture Optimization Basics (for PC/Consoles)
Page 61
© 2016 Autodesk© 2016 Autodesk
Tool: Texture Manager
Output Format
Discard Largest
MIPS
Texture Optimization Basics
Page 62
© 2016 Autodesk© 2016 Autodesk
Am I casting too many shadows?
Tool: Artist Performance HUD
Optimization Checklist: Shadow Casting
Page 63
© 2016 Autodesk© 2016 Autodesk
Disable shadow casting where unnecessary
Objects in shadow, floors, etc
Convert point lights to Spotlights
1/6 cost of point lights
Bake Lighting
Optimization Checklist: Shadow Casting
Page 64
© 2016 Autodesk© 2016 Autodesk
Shadow Proxies
Tool: Unit Editor
Cast Shadows
Optimization Checklist: Shadow Casting
Page 65
© 2016 Autodesk© 2016 Autodesk
Optimization Checklist: Batching
Page 66
© 2016 Autodesk© 2016 Autodesk
Tool: Artist Performance HUD
Optimization Checklist: Batching
Page 67
© 2016 Autodesk© 2016 Autodesk
One batch per material, per mesh, per shadow
casting observer, per camera
What Is a Batch?
Page 68
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Spotlight
2 Shadow Casting
Batches
2 G-Buffer Batches
Page 69
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Sunlight
5 Shadow Casting
Batches
2 G-Buffer Batches
Page 70
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Omni Light
6 Shadow Casting
Batches
2 G-Buffer Batches
Page 71
© 2016 Autodesk© 2016 Autodesk
Page 72
© 2016 Autodesk© 2016 Autodesk
Merge meshes
Re-import
Reduce Materials
Create LODs
Optimization Checklist: Reduce Batching
Page 73
© 2016 Autodesk© 2016 Autodesk
Create Occluder
Boxes
Remember: Occluders occlude from all
observers!
Optimization Checklist: Occluders
Page 74
© 2016 Autodesk© 2016 Autodesk
Same Geometry
Same Materials
Material supports Instancing
Batch Merging
Page 75
© 2016 Autodesk© 2016 Autodesk
Standard import materials are optimized for
compatibility – not performance!
Material Optimization
Page 76
© 2016 Autodesk© 2016 Autodesk
Create simple materials
Use inheritance
Parent materials
Use standard_rma materials
RMA = Roughness, Metalness, Ambient Occlusion
Included in v1.6
Material Optimization
Page 77
© 2016 Autodesk© 2016 Autodesk
You can’t always get what you want
But if you try sometimes…
Game artists can help!
In Closing
Page 78
© 2016 Autodesk© 2016 Autodesk
Tobias Persson
Niklas Frykholm
Mikael Hansson
Andreas Asplund
Jim Sagevid
Jean-Philippe Grenier
Anders Lindqvist
Rex Hill
Acknowledgements
Dan Matlack
Paul Kind
Matthew Harwood
Page 79
Autodesk is a registered trademark of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and
specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2016 Autodesk, Inc. All rights reserved.
© 2016 Autodesk. All rights reserved.