Advanced Ambient Occlusion Methods for Modern Games

Advanced Ambient Occlusion Methods for Modern Games

Advanced Ambient Occlusion Methods for Modern Games Andrei Tatarinov, Senior Developer Technology Engineer Alexey Panteleev, Senior Developer Technology Engineer Outline • What is AO and why is it SS? • Is screen space enough? • HBAO+ Ultra • Voxel Ambient Occlusion • VXAO integrations gameworks.nvidia.com 2 Screen Space Ambient Occlusion gameworks.nvidia.com 3 Screen Space Ambient Occlusion • A rendering technique for efficiently approximating ambient occlusion in the games • Independent from scene complexity • Minimal data pre-processing • Easily integrated into any modern rendering pipeline – Don’t do this… © Wikipedia » Or this gameworks.nvidia.com 4 Horizon-Based Ambient Occlusion + • Bavoil, L., Sainz, M., Image-Space Horizon- Based Ambient Occlusion, Siggraph 2008 • HBAO+ improves upon existing Ambient Occlusion techniques to add richer, more detailed, more realistic shadows around objects that occlude rays of light • Compared to previous techniques, HBAO+ is faster, more efficient, and significantly better gameworks.nvidia.com 5 Is screen space enough? gameworks.nvidia.com 6 Is screen space enough? • No. – Don’t do this… » Or this gameworks.nvidia.com 7 Is screen space enough? • No. • Let’s do an excursion into history… – Don’t do this… » Or this gameworks.nvidia.com 8 Assassin’s Creed series • Strategic partnership between NVIDIA and Ubisoft • GameWorks is featured in three major installments – Don’t do this… » Or this gameworks.nvidia.com 9 Assassin’s Creed IV Black Flag • Towns look like chaotic collections of buildings • Objects are fairly far away from each other Image courtesy of Ubisoft gameworks.nvidia.com 10 Assassin’s Creed Unity • People are always protesting on the streets and squares Image courtesy of Ubisoft gameworks.nvidia.com 11 Assassin’s Creed Syndicate • XIX century London brings some order to the crowd Image courtesy of Ubisoft gameworks.nvidia.com 12 Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 13 gameworks.nvidia.com 14 What’s gone wrong? • Let’s take a simple scene gameworks.nvidia.com 15 What’s gone wrong? • This is how AO would look like: gameworks.nvidia.com 16 What’s gone wrong? • Let’s try to add a character walking by: gameworks.nvidia.com 17 What’s gone wrong? • Let’s try to add a character walking by: gameworks.nvidia.com 18 What’s gone wrong? • Let’s try to add a character walking by: gameworks.nvidia.com 19 What’s gone wrong? • We want minimal influence of the character on the AO image gameworks.nvidia.com 20 What’s gone wrong? • AO looks correct if character is close enough gameworks.nvidia.com 21 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 22 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 23 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 24 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 25 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 26 What’s gone wrong? • HBAO+ detects objects not belonging to a surface • Samples from these objects are not taken into account • HBAO+ doesn’t know what is behind the character gameworks.nvidia.com 27 What’s gone wrong? • This results in visible “halo” around the character gameworks.nvidia.com 28 What’s gone wrong? • This results in visible “halo” around the character gameworks.nvidia.com 29 Tune HBAO+ • Use smaller HBAO+ radius • Minimizes artifacts, not removes them! • Makes AO look worse gameworks.nvidia.com 30 Tune HBAO+ • Use smaller HBAO+ radius • Minimizes artifacts, not removes them! • Makes AO look worse gameworks.nvidia.com 31 Need a Superman • Want to teach HBAO+ see through objects – Don’t do this… » Or this Image from SuperFriends gameworks.nvidia.com 32 Need a Superman • Want to teach HBAO+ see through objects • Bavoil, L., and Sainz, M., Multi-Layer Dual-Resolution Screen-Space Ambient Occlusion, Siggraph 2009 • Mara, M., McGuire, M., Luebke, D., Lighting Deep G-Buffers: Single- Pass, Layered Depth Images with Minimum Separation Applied to Indirect Illumination, NVIDIA 2013 Image from SuperFriends gameworks.nvidia.com 33 Depth-peeled AO • Good solution to a problem gameworks.nvidia.com 34 Depth-peeled AO • Good solution to a problem • AO shaders become more sophisticated • Integrating into an engine may be troublesome gameworks.nvidia.com 35 Depth-peeled AO • Good solution to a problem • AO shaders become more sophisticated • Integrating into an engine may be troublesome • Do we really need full-scale depth peeling? gameworks.nvidia.com 36 Double-layered AO • Only moving objects create noticeable artifacts! • Use two layers to separate statics from dynamics • AO shaders stay the same gameworks.nvidia.com 37 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 38 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 39 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions First pass is static geometry only gameworks.nvidia.com 40 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Second pass is static geometry plus characters gameworks.nvidia.com 41 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Use stencil to mask out the characters gameworks.nvidia.com 42 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Use stencil to mask out the characters gameworks.nvidia.com 43 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions And blit them on the first pass AO image gameworks.nvidia.com 44 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions AO from characters is missing gameworks.nvidia.com 45 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Use inverted stencil gameworks.nvidia.com 46 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Use inverted stencil and MIN blending gameworks.nvidia.com 47 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Single-layered HBAO+ gameworks.nvidia.com 48 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Double-layered HBAO+ gameworks.nvidia.com 49 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions Single-layered HBAO+ gameworks.nvidia.com 50 gameworks.nvidia.com 51 gameworks.nvidia.com 52 gameworks.nvidia.com 53 Integration into Assassin’s Creed Syndicate • Tune HBAO+ to look good in all cases • Pick AO radius optimal to handle both small features and large-scale objects • …and minimize artifacts gameworks.nvidia.com 54 Integration into Assassin’s Creed Syndicate • Tune HBAO+ to look good in all cases • Pick AO radius optimal to handle both small features and large-scale objects • …and minimize artifacts • But hey, we’re running two passes now! gameworks.nvidia.com 55 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 56 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 57 Integration into Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 58 Assassin’s Creed Syndicate • AO-only video with massive corruptions gameworks.nvidia.com 59 HBAO+ Ultra • Double-pass HBAO+ is default in Ultra preset • Decided to name it “HBAO+ Ultra” • Added advanced blending functionality to HBAO+ gameworks.nvidia.com 60 Advanced blending functionality in HBAO+ struct GFSDK_SSAO_TwoPassBlend_D3D11 { // When enabled, overrides any other compositing state GFSDK_SSAO_BOOL Enable; // Used to mask the pixels in each of the 2 passes ID3D11DepthStencilView* pDepthStencilView; // Blend & depth-stencil state for the first compositing pass GFSDK_SSAO_BlendPass_D3D11 FirstPass; // Blend & depth-stencil state for the second compositing pass GFSDK_SSAO_BlendPass_D3D11 SecondPass; GFSDK_SSAO_TwoPassBlend_D3D11() : Enable(false) , pDepthStencilView(NULL) { } }; gameworks.nvidia.com 61 gameworks.nvidia.com HBAO+ 62 gameworks.nvidia.com HBAO+ Ultra63 gameworks.nvidia.com HBAO+ 64 gameworks.nvidia.com HBAO+ Ultra 65 gameworks.nvidia.com HBAO+ 66 gameworks.nvidia.com HBAO+ Ultra 67 gameworks.nvidia.com HBAO+ 68 gameworks.nvidia.com HBAO+ Ultra69 gameworks.nvidia.com HBAO+ 70 gameworks.nvidia.com HBAO+ Ultra71 gameworks.nvidia.com HBAO+ 72 gameworks.nvidia.com HBAO+ Ultra73 Performance 6 • GeForce GTX 970 4.8 MS 5 • 1920x1080 4 3 2.1 MS 2 1 0 HBAO+ HBAO+ Ultra gameworks.nvidia.com 74 Summary • Screen space is not enough for robust AO • You need just two layers to improve quality • HBAO+ supports advanced blending modes • HBAO+ source will be available to registered developers gameworks.nvidia.com 75 Huge thanks to • Louis Bavoil, NVIDIA • Maksym

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    124 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us