1 / 61

640 likes | 1.01k Vues

Physically Based Shading. A simplified artist interface. Niklas Hansson Head Teacher Game programming The Game Assembly. Physically Based Shading. What is it ? Why should I use it ? How do I integrate it into a project ?. Basic BRDF Theory.

Télécharger la présentation
## Physically Based Shading

**An Image/Link below is provided (as is) to download presentation**
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Content is provided to you AS IS for your information and personal use only.
Download presentation by click this link.
While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

**Physically Based Shading**A simplified artist interface Niklas Hansson Head Teacher Game programming The Game Assembly.**Physically Based Shading**• What is it ? • Why should I use it ? • How do I integrate it into a project ?**Basic BRDF Theory**• Boundary : When light goes from one material to another • Light splits up into two directions : reflection and refraction. • The amount of light reflected depends on the materials reflective index. Image from “Real-Time Rendering 3rd Edition”**Basic BRDF Theory**• Basic Material • - Part is Reflected • - Part enters the material • Metal • Part is Reflected • The part entering the • Material is absorbed Image from “Real-Time Rendering 3rd Edition”**Basic BRDF Theory**• Non metals • - Light that enters the material scatters internally • - Is absorbed • - and often exits the surface again. Image from “Real-Time Rendering 3rd Edition”**Basic BRDF Theory**• Sub surface scattering • Distance between enter and exit positions are determined by the material. Image from “Real-Time Rendering 3rd Edition”**Basic BRDF Theory**• Point model • By ignoring distance between exit and enter points we can model lighting with an BRDF. Image from “Real-Time Rendering 3rd Edition”**Basic Microfacet BRDF Theory**• Microfacets • A surface consists of many small perfectly flat surfaces. • How much they differ in normal determines how light interact Image from “Real-Time Rendering 3rd Edition”**Basic Microfacet BRDF Theory**Images from “Real-Time Rendering 3rd Edition”**Shadowing & Masking**• Not all micro facets facing half vectors direction contribute to lightning • Shadowing • Masking Images from “Real-Time Rendering 3rd Edition”**So why is specular so important ?**Images from “Everything is Shiny” by John Hable**So why is specular so important ?**Images from “Everything is Shiny” by John Hable**Fresnel Reflectance**• Returns a Value from 0-1 in RGB • Fraction of light reflected from optically flat surface given Light directon l and Half vector h**Fresnel Reflectance**• Depends on refraction index (in our terms the substance of the object) and the light angle. Image from “Real-Time Rendering 3rd Edition”**Fresnel**Images from “Everything has Fresnel” by John Hable**Schlick’s Approximation**• Decently Accurate, uses F(0) the refractive index as input. • Which is our substance term.**Geometric term**• Gives a scalar value between 0 and 1 • Contains the fraction of non obscured microfacets • Various functions exists most using roughness as input**Distribution function**• Calculates factor of microfacets reflecting light towards the eye • The function determines size and shape of the specular highlight**Blinn Phong Distribution Functions**• Blinn Phong Distribution Function • Modified Blinn Phong**Beckman Distribution function**Conversion :**Blinn Phong Energy Conversation**• If the specular highlight is larger the specular intensity must be lower. • N = roughness**Blinn Phong Energy Conversation**• 0.397436n+0.0856832**Blinn Phong Energy Conversation**• 0.397436n+0.03183**Energy Conversation**• Our Normalized equation for specular light • Lambert Cdiff*PI <=1 • Full BRDF Cdiff+Cspec <=1**Ambient Light**• Ambient Light is just Light • Has a specular component too • reflections • roughness controls reflections blurriness substance controls reflection strength. • Pre blurred cubemaps**Ambient Light**• ATI cubemap gen has nice functions for preblurring mipmaps. • For correctnes the blurring needs to match your specular light**Blurred cubemap**• Use the angular extent and always sample from top mip. • Use the glossiness for that mipmap level and evaluate max size of highlight for size of angular extent. • Use the phong function to evaluate a contribution for all the pixels inside the extent.**Why physically based ?**• It’s more realistic thanks to being physically based? • Materials does not require as much retweaking under changing lighting conditions. • You can create more easily varied materials with lesser number of values • It saves artist time and simplifies workflow**Simplified Artist interface**• Reduces number of maps from 4-5 to 2. • Simplifies Junior artist training • No longer take albedo and desaturate for intensity • And then lower color for gloss • We have all seen it**Simplified Artist interface**• PBL simplifies this by creating a material interface that makes sense. • Substance • Is the index of refraction for the material • No need to hand paint. • Mathematically matches old intensity**Simplified Artist interface**• Roughness • The old gloss • But thanks to Normalization a lot more useful • Where hand painting happens • Controls reflection blurrinees and spec • Surface Roughness that normal maps can’t show • Touch • Observe**Why physically based ?**• Lower numbers of values to tweak • Smaller tighter gbuffer • Low bandwitdh • Small ALU increase • Ideal for deferred rendering • While still allowing very varied materials**How to use it**• What did we do ? • Microfacet BRDF with • Normalized Blinn Phong • Fresnel reflectance • Void Geometry Function • G(h) = 4(n dot l)(n dot v) • Prefiltered glossy reflections from cubemap probes • Ambient from ambient probes**What we did**• Crefis the value from the reflection probe • Cambis the value from the ambient probe • Fschlick(v,h) is the fresnel term using the view direction instead of the light direction**Lessons learned**• Substance and Roughness vs Intensity and Gloss • Spend time training and communicating to your artists • Help them use the new interface • Tools is essential • Beware of bugs

More Related