Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com...
Transcript of Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com...
![Page 1: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/1.jpg)
Subsurface Scattering
in the Unreal Forward Renderer
David Wilkinson / AMD
Tom Sanocki / Limitless Ltd
![Page 2: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/2.jpg)
![Page 3: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/3.jpg)
![Page 4: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/4.jpg)
![Page 5: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/5.jpg)
![Page 6: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/6.jpg)
![Page 7: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/7.jpg)
![Page 8: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/8.jpg)
Moving ForwardAn Optimized Path For VR Rendering
David WilkinsonDeveloper Technology Engineer, AMD
![Page 9: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/9.jpg)
Introduction
• Overview of Forward Rendering
• Pros and Cons
• Feature Support
• Example: Subsurface Rendering
![Page 10: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/10.jpg)
Forward Rendering Overview
• Scenes are rendered with multiple lights for each prim• Lighting and shading happen together during rasterization
• Legacy forward renderers were inefficient with large # lights
• Only a subset of lights are selected• Using Compute shaders
• Lights and reflections are tiled and culled into frustum-spaced grid
• Only lights influencing a local grid tile are considered
• Only top ‘m’ contributors considered during rendering
• 1000s of lights per scene no problem
![Page 11: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/11.jpg)
Forward Rendering Overview
• Rendering performance is significantly increased• Around 20% increase for base pass (UE4)
• Average 25-30% increase for total frame time (on UE4)
• Overdraw is avoided by using a depth pre-pass
• Hardware Anti-aliasing (MSAA) can be enabled
• Translucency just works
![Page 12: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/12.jpg)
Forward Rendering – Pros and Cons
Pros
• MSAA
• Complex Materials
• Bandwidth friendly
• Translucency just works
• Features can be enabled per-material
Cons
• No screen-space operations
• SSR, SSAO, Contact Shadows, IES,
Subsurface Profiles.
• GPU Occupancy suffers
• Tiny triangles
• VGPR Usage
![Page 13: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/13.jpg)
Why Are Some Features Unsupported?
• Maturity of Implementation• Not a trivial amount of work, porting each feature takes time
• Technical Complexity• Some features may not have a viable equivalent forward implementation
• May require hybrid solution (forward + mini-gbuffer)
• Or, looking forward, a Texel Shader / Object Space approach
![Page 14: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/14.jpg)
Working Around Unsupported Features
• Screen Space Alternatives• SSR -> Planar Reflections and Reflection Captures
• SSAO -> AO using depth pre-pass buffer
• SSSS -> Texture Space Diffusion Or Diffuse Wrap w/ textures
• Use Hybrid Rendering• Use the full screen depth-pass to perform deferred rendering passes
• Keep Gbuffers small – 1-2 packed 64-bit params
• Do not adopt deferred bottlenecks!
![Page 15: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/15.jpg)
Working Around Unsupported Features
• Look for forward based substitutes• Revisit older algorithms that may not have been previously feasible for RTR
• See what other studios are doing• ‘RoboRecall’ by Epic is a great example of what can be done in the Forward
path
• Check the forums, others are likely tackling similar issues
• Definitely approach IHVs and engine developers, there may be a solution in the
works…
• Plus, it assists them in evaluating and prioritizing in-demand features
![Page 16: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/16.jpg)
Example: Subsurface Rendering
![Page 17: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/17.jpg)
Skin Rendering Example• ‘Reaping Rewards’ contains many assets that feature skin, cloth, hair
• In UE4, these could be implemented with the skin subsurface profile
• However, this is a screen space technique – not available in the forward path
• Limitless is currently experimenting with two alternative techniques• Diffuse wrap shaders w/ textures
• Hybrid mini-Gbuffer pass for subsurface scattering
• The wrap shader will be shown here
• Can be implemented in UE4 material editor, no engine changes
![Page 18: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/18.jpg)
Diffuse Wrap
• Simulates subsurface scattering• A key part of skin rendering
• Models the translucent nature of skin
• Light enters, and bounces numerous times
• Then exits at a different place
• Extends diffuse lighting to wrap around an object• Gives a translucent appearance
• Forms the base layer of the skin surface
• Can be implemented as a Material shader in UE4• Create a material and set shader model to:
• Two sided foliage
• Subsurface
• Pre-integrated skin
![Page 19: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/19.jpg)
Diffuse Wrap
Hm. Needs less cowbell.
Let’s texture some layers…
![Page 20: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/20.jpg)
ScatterMap
![Page 21: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/21.jpg)
Roughness
![Page 22: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/22.jpg)
Sheen
![Page 23: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/23.jpg)
Subsurface Color
![Page 24: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/24.jpg)
Final Result
![Page 25: Subsurface Scattering in the Unreal Forward Renderer32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com › ...Skin Rendering Example • ‘Reaping Rewards’ contains many assets that](https://reader033.fdocuments.net/reader033/viewer/2022052718/5f0486f07e708231d40e695d/html5/thumbnails/25.jpg)
Thank You