SlideShare a Scribd company logo
1 of 27
GenerativeArt—MadewithUnity
XR Graphics in Unity
Maximizing your AR/VR experience’s potential
Dan Miller
Unity Technologies, XR Evangelist
@DanMillerDev
Agenda
3
Virtual Reality
- Stereo Rendering Considerations
- Custom Shader Modifications
- RenderScale and RenderViewportScale
- Scriptable Render pipelines for VR
Augmented Reality
- Occlusions
- Shadows
- Platforms Specific Rendering
- Demo
Rendering For Each Eye 👀
4
Stereo Rendering
Stereo Rendering
5
Single-pass instancingSingle-passMulti-pass
Two textures are packed into one
large texture (referred to as a
double-wide texture).
Only goes through the scene graph
once, so it’s much faster on the
CPU. However requires a lot of
extra GPU state changes to
accomplish this
Uses a single texture array
containing two textures storing
the rendering for each eye.
Involves the same amount of
GPU work, but fewer draw calls
and work for the CPU, so it’s
significantly more performant.
Requires going through the scene
graph multiple times, once for each
view you need
Custom Shader Changes 🔮
6
Vertex Shader Changes
struct appdata
{
float3 pos;
UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID;
};
struct v2f
{
float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO; // uint stereoEyeIndex : SV_RenderTargetIndex;
};
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v); // unity_StereoEyeIndex = v.instanceID & 0x01;
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); // o.stereoEyeIndex = unity_stereoEyeIndex
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
7
struct appdata
{
float3 pos;
UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID;
};
struct v2f
{
float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO; // uint stereoEyeIndex : SV_RenderTargetIndex;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
struct appdata
{
float3 pos;
UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID;
};
struct v2f
{
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
struct appdata
{
float3 pos;
};
struct v2f
{
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
Vertex Shader Changes
8
RenderScale vs RenderViewportScale
RenderScale vs RenderViewportScale
9
RenderViewportScaleRenderScale
Controls the actual size of eye textures as a
multiplier of the device's default resolution.
● value of 1.0 will use the default eye texture
resolution specified by the XR device.
● less than 1.0 will use lower resolution eye
textures
● greater than 1.0 will yield higher resolutions
Controls how much of the allocated eye
texture should be used for rendering.
Valid range is 0.0 to 1.0. This value can
be changed at runtime without
reallocating eye textures. Therefore it is
useful for dynamically adjusting eye
render resolution.
EyeTextureResolutionScale
Current Support and Features 😳 🛋🛋
10
HDRP for Virtual Reality
HDRP for VR
11
Supported in 2019.1+
Some HDRP features are not compatible
with VR. When you enable VR in your
Project, HDRP automatically disables the
features that it does not support
2019.1 — Single Pass Stereo
2019.2 — Single pass instanced
Not supported
● Multi-pass rendering
● Single-pass instancing
● Tile lighting
● Deferred rendering
● Volumetrics
● Render and viewport scale
● VFX Graph
HDRP for VR
12
In 2019.1 Supported
● Multi-pass rendering
● Single-pass instancing
● Tile lighting
● Deferred rendering
● Volumetrics
● Render and viewport scale
● VFX Graph
In 2019.2+
Supported In 2019.3+
Universal Render Pipeline for VR 😎
13
URP for Virtual Reality
Universal RP for VR
14
Supported in 2019.1+
● Better performance than legacy in most lighting setups
~25% increase on mobile hardware
● Has a new batcher that reduces setup cost for each
draw call
● Shades light in single pass decreasing the overdraw
and amount of drawcalls
● Only performs a depth prepass when using Cascade
shadows
Universal Render Pipeline
15
Current Limitations
● There are currently some issues with MSAA and PostProcessing in VR.
● We added single pass double wide as the fallback to SRP in 2019.1
Challenges and Solutions 🌅
16
Post-Processing Stack
Post processing in XR
17
Always consider what if any post-processing effect you need.
● Most temporal effects add blurriness and latency
● Simulating depth of field, a property of physical cameras, in a headset, which is simulating the
human eye, will most likely cause nausea.
● If you’re running into issues, try the different stereo rendering modes.
● For mobile Augmented Reality, effects will be processed on the entire camera feed, not just
digital objects.
Rendering techniques ✨ 👀
18
Augmented Reality
Things to keep in mind
● Digital and augmented objects are rendering on top of
the camera feed
● Occlusion and Shadows are not enabled by default and
require special shaders and consideration
● Your users will be using this in a variety of different
conditions and environments
● Universal Render Pipeline support is continuing to be
updated and improved
○ Only available in AR Foundation
Augmented Reality Rendering — Mobile
19
Things to keep in mind
● Additive displays — Blacks = Transparent
● Physically based rendering and self shadowing can create dark areas
● Consider leveraging unique platform features like eye tracking
● Universal Render Pipeline only supported in single pass and single pass instanced stereo rendering.
Augmented Reality Rendering — Head Mounted
20
Occlusion
21
http://bit.ly/MobileOcclusionShader
● Special shader
● Can be applied to planes or world mesh
● Used with feature points for quicker occlusion
● Built in support on specific platforms
Human Segmentation enabled in ARKit 3.0 with AR Foundation
Shadows
22
http://bit.ly/MobileARShadow
● Casting shadows on transparent geometry
● Consider size and scale - rescale size of rendered
content
● For static objects use blob shadows
Platform Specific Features — Mobile
23
Environmental Probes — ARKit
● Generate environment textures during an AR session
using camera imagery
● Plug that cubemap texturing into a reflection probe in
Unity to provide realistic image-based lighting for virtual
objects in AR
Environmental HDR — ARCore
● Directional light rotations to help with placing shadows in
the right direction
● Ambient Spherical Harmonics: helps model ambient
illumination from all directions
● HDR Cubemap: provides specular highlights and reflections
Tips and Tricks ✨
24
Demo
Demo Breakdown
25
Colored Materials Specular, Normal
Occlusion maps
Environmental
Probes
Light estimation Post Processing -
Color Grading
Want to learn more?
Project:
VR in Unity: A Beginner's Guide
Tutorial:
Configuring Unity for AR Development
Subscribe now for a 3-month free trial at unity.com/learn-
premium with code: UNITECPH19
*Learn Premium is included in Unity Plus and Pro licenses. Just sign in with your Unity ID.
Thank you.
Dan Miller — XR Evangelist
DanielMi@unity3d.com
@DanMillerDev

More Related Content

What's hot

What's hot (20)

Bindless Deferred Decals in The Surge 2
Bindless Deferred Decals in The Surge 2Bindless Deferred Decals in The Surge 2
Bindless Deferred Decals in The Surge 2
 
The Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next Steps
 
Moverio+unityで始めるarグラスアプリ開発
Moverio+unityで始めるarグラスアプリ開発Moverio+unityで始めるarグラスアプリ開発
Moverio+unityで始めるarグラスアプリ開発
 
Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next Generation
 
Unite2019 _ 학교에서 배우는 게임개발이란
Unite2019 _ 학교에서 배우는 게임개발이란Unite2019 _ 학교에서 배우는 게임개발이란
Unite2019 _ 학교에서 배우는 게임개발이란
 
1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들
 
【UE4.25 新機能】ロードの高速化機能「IOStore」について
【UE4.25 新機能】ロードの高速化機能「IOStore」について【UE4.25 新機能】ロードの高速化機能「IOStore」について
【UE4.25 新機能】ロードの高速化機能「IOStore」について
 
Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)
 
UE4 Volumetric Fogで 空間を演出する!
UE4 Volumetric Fogで 空間を演出する!UE4 Volumetric Fogで 空間を演出する!
UE4 Volumetric Fogで 空間を演出する!
 
【Unite Tokyo 2019】SRPで一から描画フローを作ってみた! ~Unity描画フローからの脱却~
【Unite Tokyo 2019】SRPで一から描画フローを作ってみた! ~Unity描画フローからの脱却~【Unite Tokyo 2019】SRPで一から描画フローを作ってみた! ~Unity描画フローからの脱却~
【Unite Tokyo 2019】SRPで一から描画フローを作ってみた! ~Unity描画フローからの脱却~
 
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of GamesKillzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
 
Unityとアセットツールで学ぶ「絵づくり」の基礎 ライト、シェーダー、イメージエフェクト
Unityとアセットツールで学ぶ「絵づくり」の基礎 ライト、シェーダー、イメージエフェクトUnityとアセットツールで学ぶ「絵づくり」の基礎 ライト、シェーダー、イメージエフェクト
Unityとアセットツールで学ぶ「絵づくり」の基礎 ライト、シェーダー、イメージエフェクト
 
UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)
UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)
UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)
 
UE4.26 レンダリング新機能(CEDEC+KYUSHU 2020)
UE4.26 レンダリング新機能(CEDEC+KYUSHU 2020)UE4.26 レンダリング新機能(CEDEC+KYUSHU 2020)
UE4.26 レンダリング新機能(CEDEC+KYUSHU 2020)
 
Mixed Reality Technology ppt
Mixed Reality Technology ppt Mixed Reality Technology ppt
Mixed Reality Technology ppt
 
UnityによるHoloLens用UWPアプリケーション開発の勘所
UnityによるHoloLens用UWPアプリケーション開発の勘所UnityによるHoloLens用UWPアプリケーション開発の勘所
UnityによるHoloLens用UWPアプリケーション開発の勘所
 
Empathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the MetaverseEmpathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the Metaverse
 
Unityで始めるバーチャルプロダクション
Unityで始めるバーチャルプロダクションUnityで始めるバーチャルプロダクション
Unityで始めるバーチャルプロダクション
 
猫でも分かるUE4を使ったARコンテンツ作り方 初級編 ver 1.0.0
猫でも分かるUE4を使ったARコンテンツ作り方 初級編 ver 1.0.0猫でも分かるUE4を使ったARコンテンツ作り方 初級編 ver 1.0.0
猫でも分かるUE4を使ったARコンテンツ作り方 初級編 ver 1.0.0
 

Similar to XR graphics in Unity: delivering the best AR/VR experiences – Unite Copenhagen 2019

Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex Vlachos
 

Similar to XR graphics in Unity: delivering the best AR/VR experiences – Unite Copenhagen 2019 (20)

Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
 
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
 
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
 
VR Optimization Techniques
VR Optimization Techniques VR Optimization Techniques
VR Optimization Techniques
 
Making VR with Unreal Engine Luis Cataldi
Making VR with Unreal Engine  Luis CataldiMaking VR with Unreal Engine  Luis Cataldi
Making VR with Unreal Engine Luis Cataldi
 
Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2
 
Mobile VR, Programming, Rendering
Mobile VR, Programming, RenderingMobile VR, Programming, Rendering
Mobile VR, Programming, Rendering
 
Crysis 2-key-rendering-features
Crysis 2-key-rendering-featuresCrysis 2-key-rendering-features
Crysis 2-key-rendering-features
 
Essential Tips for Optimizing 3D Modelling and Animation.pptx
Essential Tips for Optimizing 3D Modelling and Animation.pptxEssential Tips for Optimizing 3D Modelling and Animation.pptx
Essential Tips for Optimizing 3D Modelling and Animation.pptx
 
Turning Augmented/Virtual Reality hype Into Actual Reality
Turning Augmented/Virtual Reality hype Into Actual RealityTurning Augmented/Virtual Reality hype Into Actual Reality
Turning Augmented/Virtual Reality hype Into Actual Reality
 
Technologies Used In Graphics Rendering
Technologies Used In Graphics RenderingTechnologies Used In Graphics Rendering
Technologies Used In Graphics Rendering
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
 
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
 
WebXR and Browsers
WebXR and BrowsersWebXR and Browsers
WebXR and Browsers
 
Marker less augmentedd reality using computer vision
Marker less augmentedd reality using computer visionMarker less augmentedd reality using computer vision
Marker less augmentedd reality using computer vision
 
Alexey Savchenko, Unreal Engine
Alexey Savchenko, Unreal EngineAlexey Savchenko, Unreal Engine
Alexey Savchenko, Unreal Engine
 
Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]
 
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
 
Developing Virtual Reality Application using Google Cardboard
Developing Virtual Reality Application using Google CardboardDeveloping Virtual Reality Application using Google Cardboard
Developing Virtual Reality Application using Google Cardboard
 

More from Unity Technologies

More from Unity Technologies (20)

Build Immersive Worlds in Virtual Reality
Build Immersive Worlds  in Virtual RealityBuild Immersive Worlds  in Virtual Reality
Build Immersive Worlds in Virtual Reality
 
Augmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real worldAugmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real world
 
Let’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and moreLet’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and more
 
Using synthetic data for computer vision model training
Using synthetic data for computer vision model trainingUsing synthetic data for computer vision model training
Using synthetic data for computer vision model training
 
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global IndustriesThe Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
 
Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games
 
Unity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator ToolsUnity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator Tools
 
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019
 
Turn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiencesTurn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiences
 
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
 
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
 
QA your code: The new Unity Test Framework – Unite Copenhagen 2019
QA your code: The new Unity Test Framework – Unite Copenhagen 2019QA your code: The new Unity Test Framework – Unite Copenhagen 2019
QA your code: The new Unity Test Framework – Unite Copenhagen 2019
 
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
 
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
 
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
 
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
 
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 

XR graphics in Unity: delivering the best AR/VR experiences – Unite Copenhagen 2019

  • 1.
  • 2. GenerativeArt—MadewithUnity XR Graphics in Unity Maximizing your AR/VR experience’s potential Dan Miller Unity Technologies, XR Evangelist @DanMillerDev
  • 3. Agenda 3 Virtual Reality - Stereo Rendering Considerations - Custom Shader Modifications - RenderScale and RenderViewportScale - Scriptable Render pipelines for VR Augmented Reality - Occlusions - Shadows - Platforms Specific Rendering - Demo
  • 4. Rendering For Each Eye 👀 4 Stereo Rendering
  • 5. Stereo Rendering 5 Single-pass instancingSingle-passMulti-pass Two textures are packed into one large texture (referred to as a double-wide texture). Only goes through the scene graph once, so it’s much faster on the CPU. However requires a lot of extra GPU state changes to accomplish this Uses a single texture array containing two textures storing the rendering for each eye. Involves the same amount of GPU work, but fewer draw calls and work for the CPU, so it’s significantly more performant. Requires going through the scene graph multiple times, once for each view you need
  • 6. Custom Shader Changes 🔮 6 Vertex Shader Changes
  • 7. struct appdata { float3 pos; UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID; }; struct v2f { float4 vertex : SV_POSITION; UNITY_VERTEX_OUTPUT_STEREO; // uint stereoEyeIndex : SV_RenderTargetIndex; }; v2f vert (appdata v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); // unity_StereoEyeIndex = v.instanceID & 0x01; UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); // o.stereoEyeIndex = unity_stereoEyeIndex o.vertex = UnityObjectToClipPos(v.vertex); return o; } 7 struct appdata { float3 pos; UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID; }; struct v2f { float4 vertex : SV_POSITION; UNITY_VERTEX_OUTPUT_STEREO; // uint stereoEyeIndex : SV_RenderTargetIndex; }; v2f vert (appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); return o; } struct appdata { float3 pos; UNITY_VERTEX_INPUT_INSTANCE_ID; // uint instancedID : SV_InstanceID; }; struct v2f { float4 vertex : SV_POSITION; }; v2f vert (appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); return o; } struct appdata { float3 pos; }; struct v2f { float4 vertex : SV_POSITION; }; v2f vert (appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); return o; } Vertex Shader Changes
  • 9. RenderScale vs RenderViewportScale 9 RenderViewportScaleRenderScale Controls the actual size of eye textures as a multiplier of the device's default resolution. ● value of 1.0 will use the default eye texture resolution specified by the XR device. ● less than 1.0 will use lower resolution eye textures ● greater than 1.0 will yield higher resolutions Controls how much of the allocated eye texture should be used for rendering. Valid range is 0.0 to 1.0. This value can be changed at runtime without reallocating eye textures. Therefore it is useful for dynamically adjusting eye render resolution. EyeTextureResolutionScale
  • 10. Current Support and Features 😳 🛋🛋 10 HDRP for Virtual Reality
  • 11. HDRP for VR 11 Supported in 2019.1+ Some HDRP features are not compatible with VR. When you enable VR in your Project, HDRP automatically disables the features that it does not support 2019.1 — Single Pass Stereo 2019.2 — Single pass instanced
  • 12. Not supported ● Multi-pass rendering ● Single-pass instancing ● Tile lighting ● Deferred rendering ● Volumetrics ● Render and viewport scale ● VFX Graph HDRP for VR 12 In 2019.1 Supported ● Multi-pass rendering ● Single-pass instancing ● Tile lighting ● Deferred rendering ● Volumetrics ● Render and viewport scale ● VFX Graph In 2019.2+ Supported In 2019.3+
  • 13. Universal Render Pipeline for VR 😎 13 URP for Virtual Reality
  • 14. Universal RP for VR 14 Supported in 2019.1+ ● Better performance than legacy in most lighting setups ~25% increase on mobile hardware ● Has a new batcher that reduces setup cost for each draw call ● Shades light in single pass decreasing the overdraw and amount of drawcalls ● Only performs a depth prepass when using Cascade shadows
  • 15. Universal Render Pipeline 15 Current Limitations ● There are currently some issues with MSAA and PostProcessing in VR. ● We added single pass double wide as the fallback to SRP in 2019.1
  • 16. Challenges and Solutions 🌅 16 Post-Processing Stack
  • 17. Post processing in XR 17 Always consider what if any post-processing effect you need. ● Most temporal effects add blurriness and latency ● Simulating depth of field, a property of physical cameras, in a headset, which is simulating the human eye, will most likely cause nausea. ● If you’re running into issues, try the different stereo rendering modes. ● For mobile Augmented Reality, effects will be processed on the entire camera feed, not just digital objects.
  • 18. Rendering techniques ✨ 👀 18 Augmented Reality
  • 19. Things to keep in mind ● Digital and augmented objects are rendering on top of the camera feed ● Occlusion and Shadows are not enabled by default and require special shaders and consideration ● Your users will be using this in a variety of different conditions and environments ● Universal Render Pipeline support is continuing to be updated and improved ○ Only available in AR Foundation Augmented Reality Rendering — Mobile 19
  • 20. Things to keep in mind ● Additive displays — Blacks = Transparent ● Physically based rendering and self shadowing can create dark areas ● Consider leveraging unique platform features like eye tracking ● Universal Render Pipeline only supported in single pass and single pass instanced stereo rendering. Augmented Reality Rendering — Head Mounted 20
  • 21. Occlusion 21 http://bit.ly/MobileOcclusionShader ● Special shader ● Can be applied to planes or world mesh ● Used with feature points for quicker occlusion ● Built in support on specific platforms Human Segmentation enabled in ARKit 3.0 with AR Foundation
  • 22. Shadows 22 http://bit.ly/MobileARShadow ● Casting shadows on transparent geometry ● Consider size and scale - rescale size of rendered content ● For static objects use blob shadows
  • 23. Platform Specific Features — Mobile 23 Environmental Probes — ARKit ● Generate environment textures during an AR session using camera imagery ● Plug that cubemap texturing into a reflection probe in Unity to provide realistic image-based lighting for virtual objects in AR Environmental HDR — ARCore ● Directional light rotations to help with placing shadows in the right direction ● Ambient Spherical Harmonics: helps model ambient illumination from all directions ● HDR Cubemap: provides specular highlights and reflections
  • 24. Tips and Tricks ✨ 24 Demo
  • 25. Demo Breakdown 25 Colored Materials Specular, Normal Occlusion maps Environmental Probes Light estimation Post Processing - Color Grading
  • 26. Want to learn more? Project: VR in Unity: A Beginner's Guide Tutorial: Configuring Unity for AR Development Subscribe now for a 3-month free trial at unity.com/learn- premium with code: UNITECPH19 *Learn Premium is included in Unity Plus and Pro licenses. Just sign in with your Unity ID.
  • 27. Thank you. Dan Miller — XR Evangelist DanielMi@unity3d.com @DanMillerDev