Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Scriptable Render
Pipelines
Jean-François F Fortin
Graphics Expert, Field Engineer, Unity Technologies
Unity’s Current Render Pipeline
• Forward or deferred.
• Different options available to tweak the rendering:
• - Custom sh...
In Practice…
• Hard to configure for your needs.
• Different rendering techniques
• Different platforms:
• - Different pla...
The Flexibility/Extensibility Problem
• Not a problem for most users but more advanced teams wants to modify
or extend uni...
The Problem In Pictures
Goals of The New Pipeline
• Need to perform better on modern hardware.
• Low-level, performance critical code in C++.
• Hi...
Goals of The New Pipeline
• Possibility to create multiple rendering pipelines
• - Built for a specific target in mind: ha...
Examples of Rendering Pipelines
• HD: targeting “high end”, modern PC and consoles.
• VR: optimized for VR and caching/sha...
The New Foundations
• Engine: C++, performance critical code
• - Culling
• - Rendering set of objects with filtering, sort...
Let’s talk about the HD Render
Pipeline
HD Render Pipeline: Current Plans
• Provide a built-in render pipeline targeting modern (compute-capable)
platforms.
• Dev...
HD Render Pipeline: Current Plans
• Shaders less reliant on separate shader specializations/variants.
• - Uses more static...
HD Render Pipeline: Features
• GGX with metal and specular parametrization.
• Anisotropic GGX
• Sub-surface scattering (SS...
Example: Sub-surface Scattering
Let’s look at some example
code…
Scriptable Rendering Pipelines
is an experimental feature and
this is made for 5.6.0f3.
How To Create A Render Pipeline?
• Need an asset to bind to the graphics settings.
• All rendering goes through the Render...
What goes in the “Render” function?
• Inside the render loop you would typically do:
• - Culling for all of the cameras.
•...
Note for the following demos
• This is not the recommended way to create new pipelines.
• Start from GitHub that correspon...
How To Create A Render Pipeline?
• What do you get from the GitHub builds?
• - Two render loops:
• - BasicRenderLoopTutori...
Demo: How To Create A Render
Pipeline?
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
Simple Rendering Pipeline
• Even with a simple example we can see that we can control shaders.
• - We could provide differ...
Simple Rendering Pipeline
• The C++ parts does the per-object operations.
• Written in style targeting higher performance,...
Let’s go back to some code…
Profiling
• In ProfilingSample constructor:
• When ProfilingSample is being destroyed:
Transparent Objects
Geometry Buffer / Deferred Rendering
Shadows
Shadows: Cascaded Shadow Maps
Shadows: Screen Space Shadows [1/2]
Shadows: Screen Space Shadows [1/2]
What could you build with it next?
• Techniques or features not yet supported by Unity.
• - New post-processing effects.
•...
Summary
• We are responsible for culling, and for rendering everything.
• Includes per-frame and per-pass shader uniform v...
Thank you!
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張
Upcoming SlideShare
Loading in …5
×

【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張

11,086 views

Published on

講演者:Jean-François F Fortin(Unity Technologies)

こんな人におすすめ
・スクリプト可能なレンダーパイプラインを学びたいプログラマー

受講者が得られる知見
・レンダリングパスを加える方法
・バッファを微調整し、自分のデータを加える方法
・スクリプト可能なレンダーパイプラインで、シェーダーを作成する方法

Published in: Technology
  • Be the first to comment

【Unite 2017 Tokyo】スクリプタブル・レンダーパイプラインのカスタマイズと拡張

  1. 1. Scriptable Render Pipelines
  2. 2. Jean-François F Fortin Graphics Expert, Field Engineer, Unity Technologies
  3. 3. Unity’s Current Render Pipeline • Forward or deferred. • Different options available to tweak the rendering: • - Custom shaders for surface and lighting • - Command buffers • - Compute shaders • - Post-processing effects • Works well on multitude of platforms.
  4. 4. In Practice… • Hard to configure for your needs. • Different rendering techniques • Different platforms: • - Different platform strengths • - Different optimisation strategies
  5. 5. The Flexibility/Extensibility Problem • Not a problem for most users but more advanced teams wants to modify or extend unity’s rendering. • Unity’s rendering pipeline is essentially a black box: • - Documentation, presentations and shader source code available. • - Still difficult to understand without a source code license.
  6. 6. The Problem In Pictures
  7. 7. Goals of The New Pipeline • Need to perform better on modern hardware. • Low-level, performance critical code in C++. • High-level, less performance critical code in C#. • No magic => Open-sourced and available on GitHub. • https://github.com/Unity-Technologies/ScriptableRenderLoop
  8. 8. Goals of The New Pipeline • Possibility to create multiple rendering pipelines • - Built for a specific target in mind: hardware or use case. • - Less compromises, more flexible, more performance. • Easier dealing with backwards compatibility • - Difficult to make changes to rendering. • - Users expect things to continue working.
  9. 9. Examples of Rendering Pipelines • HD: targeting “high end”, modern PC and consoles. • VR: optimized for VR and caching/sharing eye data and different viewport schemes. • Low-End/Mobile: optimized for low-end devices or simpler 2D games.
  10. 10. The New Foundations • Engine: C++, performance critical code • - Culling • - Rendering set of objects with filtering, sorting, and batching. • - Platform abstraction. • User project: C# and shaders, open source • - Camera, light, and shadow setup • - Frame render pass structure and logic • - Shader (including compute) code.
  11. 11. Let’s talk about the HD Render Pipeline
  12. 12. HD Render Pipeline: Current Plans • Provide a built-in render pipeline targeting modern (compute-capable) platforms. • Developed with PC and PS4/XB1 in mind. • Looking at optimizations to include high-end mobile platforms. • - Special interests on techniques that saves bandwidth (like on-tile storage/framebuffer fetch)
  13. 13. HD Render Pipeline: Current Plans • Shaders less reliant on separate shader specializations/variants. • - Uses more static branching. • - Shader specializations/variants only where it makes sense upon profiling on target hardware. • A more up-to-date / state-of-the-art pipeline for high end games. • Released as experimental on GitHub, will have a real release later with one of the next releases.
  14. 14. HD Render Pipeline: Features • GGX with metal and specular parametrization. • Anisotropic GGX • Sub-surface scattering (SSS) and transmission • Fine pruned tiled lighting (FPTL) • Physically-based camera parameters • Supports the post-processing stack • …
  15. 15. Example: Sub-surface Scattering
  16. 16. Let’s look at some example code…
  17. 17. Scriptable Rendering Pipelines is an experimental feature and this is made for 5.6.0f3.
  18. 18. How To Create A Render Pipeline? • Need an asset to bind to the graphics settings. • All rendering goes through the Render function of the interface IRenderPipeline. • public void Render(ScriptableRenderContext context, IEnumerable<Camera> cameras)
  19. 19. What goes in the “Render” function? • Inside the render loop you would typically do: • - Culling for all of the cameras. • - Calls to CommandBuffer to setup global shader properties, render targets, dispatch compute shaders, etc. • - Series of calls to ScriptableRenderContext.DrawRenderers.
  20. 20. Note for the following demos • This is not the recommended way to create new pipelines. • Start from GitHub that corresponds to your unity build. • - Important at this point because of the API changes.
  21. 21. How To Create A Render Pipeline? • What do you get from the GitHub builds? • - Two render loops: • - BasicRenderLoopTutorial • - ScriptableRenderLoop/HDRenderPipeline • - Test scenes.
  22. 22. Demo: How To Create A Render Pipeline?
  23. 23. Simple Rendering Pipeline
  24. 24. Simple Rendering Pipeline
  25. 25. Simple Rendering Pipeline
  26. 26. Simple Rendering Pipeline
  27. 27. Simple Rendering Pipeline
  28. 28. Simple Rendering Pipeline
  29. 29. Simple Rendering Pipeline
  30. 30. Simple Rendering Pipeline
  31. 31. Simple Rendering Pipeline • Even with a simple example we can see that we can control shaders. • - We could provide different shader pass for different pipelines. • - Change shaders for set of objects to provide some sort of shader LOD. • - Change the inputs and outputs of a pass by binding buffers or render targets.
  32. 32. Simple Rendering Pipeline • The C++ parts does the per-object operations. • Written in style targeting higher performance, using packed arrays and multithreading. • - Culling • - DrawRenderers • - DrawShadows
  33. 33. Let’s go back to some code…
  34. 34. Profiling • In ProfilingSample constructor: • When ProfilingSample is being destroyed:
  35. 35. Transparent Objects
  36. 36. Geometry Buffer / Deferred Rendering
  37. 37. Shadows
  38. 38. Shadows: Cascaded Shadow Maps
  39. 39. Shadows: Screen Space Shadows [1/2]
  40. 40. Shadows: Screen Space Shadows [1/2]
  41. 41. What could you build with it next? • Techniques or features not yet supported by Unity. • - New post-processing effects. • - Research for new techniques. • - Implement new shading or lighting algorithms. - Tiled lighting - Forward+ • Platform-specific pipelines.
  42. 42. Summary • We are responsible for culling, and for rendering everything. • Includes per-frame and per-pass shader uniform variables, management of render targets, dispatching compute, etc. • Visible lights and probes can be queried from the cull results. • - Useful for tiled lighting, or other per-object light lights. • No per-object operations, independent of scene complexity. • Download the code on GitHub and start you own pipelines!
  43. 43. Thank you!

×