© 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
© 2016 Autodesk© 2016 Autodesk
Stingray Renderer Overview
Profiler and VR Optimizations
Building Immersive Experiences
Content Tips and Tricks
Outline
© 2016 Autodesk© 2016 Autodesk
Warhammer Vermintide - Fatshark, [PC | PS4 |
XBox]
© 2016 Autodesk© 2016 Autodesk
Hamiltons Great Adventure - Fatshark
[PC/PS3/Android]War of the Roses- Fatshark [PC]
© 2016 Autodesk© 2016 Autodesk
Helldivers - Arrowhead (Sony) [PC | PS4 | PS3 |
PS Vita]
© 2016 Autodesk© 2016 Autodesk
Gauntlet - Arrowhead (Sony) [PS4, PC]
© 2016 Autodesk© 2016 Autodesk
The Showdown Effect - Arrowhead [PC]
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
© 2016 Autodesk© 2016 Autodesk
Autodesk Stingray V1.6
© 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
© 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
© 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
© 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…
© 2016 Autodesk© 2016 Autodesk
Live Design Booth AU2015
Stingray VR – Humble beginnings…
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
© 2016 Autodesk© 2016 Autodesk
Stingray Profiler
© 2016 Autodesk© 2016 Autodesk
Stingray VR – Humble beginnings…
“Gentlemen, we can rebuild him. We have the technology…”
© 2016 Autodesk© 2016 Autodesk
Frustums are a big deal…
Stingray VR – Optimizations
Culling Cascaded shadow
mapping
Clustered shading
© 2016 Autodesk© 2016 Autodesk
Compute single compound frustum to incorporate both eyes
Stingray VR – Optimizations
L
R
© 2016 Autodesk© 2016 Autodesk
Bail early on non-visible (depth and stencil compare)
Stingray VR – Optimizations
© 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
© 2016 Autodesk© 2016 Autodesk
Stingray VR - Today
© 2016 Autodesk© 2016 Autodesk
Adaptive quality
Foveated rendering
Multi GPU support
Mobile optimizations
Stingray VR – What’s Next
© 2016 Autodesk© 2016 Autodesk
Building VR Experiences
using Stingray
© 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
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
© 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
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
First Example: Teleportation
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
Teleporting with a fade transition…
© 2016 Autodesk© 2016 Autodesk
Teleportation Marker
© 2016 Autodesk© 2016 Autodesk
Last improvement…
© 2016 Autodesk© 2016 Autodesk
Without Local Position Adjustment
With Local Position Adjustment
© 2016 Autodesk© 2016 Autodesk
Final Result
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
Second example: Picking up objects
© 2016 Autodesk© 2016 Autodesk
Second example: Picking up objects
© 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
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
Documentation and Online
Resources
© 2016 Autodesk© 2016 Autodesk
Optimizing Content For
VR in Stingray
© 2016 Autodesk© 2016 Autodesk
Don’t make me sick
© 2016 Autodesk© 2016 Autodesk
© 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
© 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
© 2016 Autodesk© 2016 Autodesk
Disable all un-necessary post processes
Keep:
Bloom
Auto-Exposure
Post Processes
© 2016 Autodesk© 2016 Autodesk
Red Herring
Poly Reduction
© 2016 Autodesk© 2016 Autodesk
3DS Max:
Optimize, ProOptimizer
Maya
PolyReduce
Simplygon
Instant Field Aligned Meshes:
https://github.com/wjakob/instant-meshes
Poly Reduction Tools
© 2016 Autodesk© 2016 Autodesk
Texture Blowout
© 2016 Autodesk© 2016 Autodesk
Am I maxing out my texture memory?
Tool: Procexp
GPU Tab
GPU Dedicated Memory
Optimization Checklist: Textures
© 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
© 2016 Autodesk© 2016 Autodesk
Compression requirements
Why power of two?
© 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)
© 2016 Autodesk© 2016 Autodesk
Tool: Texture Manager
Output Format
Discard Largest
MIPS
Texture Optimization Basics
© 2016 Autodesk© 2016 Autodesk
Am I casting too many shadows?
Tool: Artist Performance HUD
Optimization Checklist: Shadow Casting
© 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
© 2016 Autodesk© 2016 Autodesk
Shadow Proxies
Tool: Unit Editor
Cast Shadows
Optimization Checklist: Shadow Casting
© 2016 Autodesk© 2016 Autodesk
Optimization Checklist: Batching
© 2016 Autodesk© 2016 Autodesk
Tool: Artist Performance HUD
Optimization Checklist: Batching
© 2016 Autodesk© 2016 Autodesk
One batch per material, per mesh, per shadow
casting observer, per camera
What Is a Batch?
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Spotlight
2 Shadow Casting
Batches
2 G-Buffer Batches
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Sunlight
5 Shadow Casting
Batches
2 G-Buffer Batches
© 2016 Autodesk© 2016 Autodesk
One Cube
One Plane
One Omni Light
6 Shadow Casting
Batches
2 G-Buffer Batches
© 2016 Autodesk© 2016 Autodesk
© 2016 Autodesk© 2016 Autodesk
Merge meshes
Re-import
Reduce Materials
Create LODs
Optimization Checklist: Reduce Batching
© 2016 Autodesk© 2016 Autodesk
Create Occluder
Boxes
Remember: Occluders occlude from all
observers!
Optimization Checklist: Occluders
© 2016 Autodesk© 2016 Autodesk
Same Geometry
Same Materials
Material supports Instancing
Batch Merging
© 2016 Autodesk© 2016 Autodesk
Standard import materials are optimized for
compatibility – not performance!
Material Optimization
© 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
© 2016 Autodesk© 2016 Autodesk
You can’t always get what you want
But if you try sometimes…
Game artists can help!
In Closing
© 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
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.