Physically Based Shading in Real Time Rendering
-
Upload
wilma-mcmahon -
Category
Documents
-
view
62 -
download
5
description
Transcript of Physically Based Shading in Real Time Rendering
Physically Based ShadingPhysically Based Shadingin Real Time Renderingin Real Time Rendering
Christian SchülerChristian Schüler
MBL DevelopmentMBL Development
Who’s me?Who’s me?
•Veteran: Engine programming since 15 yearsVeteran: Engine programming since 15 years
•Several shipped gamesSeveral shipped games
•Doing “serious” work now but still love gamesDoing “serious” work now but still love games
IntroductionIntroduction
Physically Based ShadingPhysically Based Shading
•Solves some real problemsSolves some real problems
•Can make authoring easierCan make authoring easier
•Can improve looksCan improve looks
•Feels as the “right” way to do thingsFeels as the “right” way to do things
•Is going to be implemented in more and more Is going to be implemented in more and more enginesengines
IntroductionIntroduction
Ingredients for Physically Based ShadingIngredients for Physically Based Shading
•Linear LightingLinear Lighting
•Energy Preserving SpecularEnergy Preserving Specular
•Metals + DielectricsMetals + Dielectrics
•Fresnel ReflectanceFresnel Reflectance
•Image Based ReflectionsImage Based Reflections
•Microfacet ModelsMicrofacet Models
IntroductionIntroduction
Ingredients for Physically Based ShadingIngredients for Physically Based Shading
•Linear LightingLinear Lighting
•Energy Preserving SpecularEnergy Preserving Specular
•Metals + DielectricsMetals + Dielectrics
•Fresnel ReflectanceFresnel Reflectance
•Image Based ReflectionsImage Based Reflections
•Microfacet ModelsMicrofacet Models
IntroductionIntroduction
will talk about these todaywill talk about these todayimportant for content creationimportant for content creation
Ingredients for Physically Based ShadingIngredients for Physically Based Shading
•Linear LightingLinear Lighting
•Energy Preserving SpecularEnergy Preserving Specular
•Metals + DielectricsMetals + Dielectrics
•Fresnel ReflectanceFresnel Reflectance
•Image Based ReflectionsImage Based Reflections
•Microfacet ModelsMicrofacet Models
IntroductionIntroduction
programmers and shader programmers and shader authors worry about theseauthors worry about these
PBS IngredientsPBS Ingredients
PBS Ingredient #1PBS Ingredient #1
Linear LightingLinear Lighting
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
19891989The age of “Pixel Art” and a life-changing The age of “Pixel Art” and a life-changing revelation:revelation:RGB values are not linear!RGB values are not linear!
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
too too darkdark
naïvenaïve0—25—50—75—1000—25—50—75—100
correctedcorrected0—50—71—87—1000—50—71—87—100
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
RGB values are not linear. RGB values are not linear. This is important for—This is important for—
•Distance and falloff Distance and falloff curvescurves
sharp bordersharp border
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
RGB values are not linear. RGB values are not linear. This is important for—This is important for—
•Distance and falloff Distance and falloff curvescurves
•Addition of LightsAddition of Lights
not washed outnot washed out
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
RGB values are not linear. RGB values are not linear. This is important for—This is important for—
•Distance and falloff Distance and falloff curvescurves
•Addition of LightsAddition of Lights
•Addition of ColorsAddition of Colors(diffuse + specular)(diffuse + specular)
no color shiftno color shift
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
RGB values are not linear. RGB values are not linear. This is important for—This is important for—
•Distance and falloff Distance and falloff curvescurves
•Addition of LightsAddition of Lights
•Addition of ColorsAddition of Colors(diffuse + specular)(diffuse + specular)
•Addition of ColorsAddition of Colors(atmospheric effects)(atmospheric effects)
effect begins earlyeffect begins early
bright bright details still details still
visiblevisible
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
Counter-Example:Counter-Example:Not done with linear lightingNot done with linear lightingClassic “computer” lookClassic “computer” look
color shiftcolor shift
falloff, gradient too softfalloff, gradient too soft
color shift and clippingcolor shift and clipping
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
Further reading Further reading
•BlogsBlogshttp://filmicgames.com/archives/category/gammhttp://filmicgames.com/archives/category/gammaa
•UnrealUnrealhttp://udn.epicgames.com/Three/TexturingGuidelines.htmlhttp://udn.epicgames.com/Three/TexturingGuidelines.html
•CryEngineCryEnginehttp://freesdk.crydev.net/display/SDKDOC4/Gamma-Correct+Rendering+(sRGhttp://freesdk.crydev.net/display/SDKDOC4/Gamma-Correct+Rendering+(sRGBB))
•UnityUnityhttp://docs.unity3d.com/Documentation/Manual/LinearLighting.htmlhttp://docs.unity3d.com/Documentation/Manual/LinearLighting.html
PBS IngredientsPBS Ingredients
PBS Ingredient #2PBS Ingredient #2
Energy Preserving Energy Preserving SpecularSpecular
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Assignment:Assignment:Make a Blinn/Phong material with textured Make a Blinn/Phong material with textured glossiness.glossiness.
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Assignment:Assignment:Make a Blinn/Phong material with textured glossiness.Make a Blinn/Phong material with textured glossiness.
Why?Why?
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
20062006Per pixel varying glossiness for ice materialPer pixel varying glossiness for ice materialSpellforce 2Spellforce 2
smoothsmooth
roughrough
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
smoothsmoothhigh glossinesshigh glossiness
roughroughlow glossinesslow glossiness
http://en.wikipedia.org/wiki/File:Frost_patterns_4.jpg
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
20092009Per pixel varying glossiness for wet vs dry effectPer pixel varying glossiness for wet vs dry effectVelvet AssassinVelvet Assassin
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
20092009Per pixel varying glossiness for wet vs dry effectPer pixel varying glossiness for wet vs dry effectVelvet AssassinVelvet Assassin
glossiness textureglossiness texturealpha channel of specular mapalpha channel of specular map
First try:First try:
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
What about the parameterization?What about the parameterization?What are meaningful values to put into a texture?What are meaningful values to put into a texture?
0 ... 10 ... 1 0 ... infinity ?0 ... infinity ?
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
What about the parameterization?What about the parameterization?What are meaningful values to put into a texture?What are meaningful values to put into a texture?
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
exponenexponentialtialfunctionfunction
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
0 ... 10 ... 1 1 ... 40961 ... 4096
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
In reality, the size of a highlight is linked with its peak brightness.In reality, the size of a highlight is linked with its peak brightness.This is the This is the Energy PreservationEnergy Preservation bit. bit.
high glosshigh gloss
low glosslow gloss
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Workflow hazard: Glossiness channel and specular color Workflow hazard: Glossiness channel and specular color channel become dependent on one another!channel become dependent on one another!
glossinessglossinessspecular colorspecular color
dependencydependency
Solution: Break the dependency!Solution: Break the dependency!Shader must scale specular color automatically.Shader must scale specular color automatically.
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
exponenexponentialtialfunctionfunction
????
multipliermultiplier
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
This multiplier is called the This multiplier is called the normalization factornormalization factor. . Can be computed from a hemispherical integral.Can be computed from a hemispherical integral.Several possibilities, see references.Several possibilities, see references.
normalization normalization factorfactor
integralintegral
It starts to get somewhat messy.It starts to get somewhat messy.
PBS Ingredients → Energeticgy Conserving SpecularPBS Ingredients → Energeticgy Conserving Specular
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
exponenexponentialtialfunctionfunction
n+1n+122
n+1n+122
normalizatnormalizationion
factorfactor
Why not call that a new kind of material?Why not call that a new kind of material?
PBS Ingredients → Energeticgy Conserving SpecularPBS Ingredients → Energeticgy Conserving Specular
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
Blinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorspecular powerspecular power
exponenexponentialtialfunctionfunction
n+1n+122
n+1n+122
normalizatnormalizationion
factorfactor
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Enter the Enter the normalized Blinn/Phong normalized Blinn/Phong material.material.•Accepts a glossiness parameter in the range 0 to Accepts a glossiness parameter in the range 0 to 1.1.•Automatic scale of specular color.Automatic scale of specular color.
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Neat side effect: Neat side effect: Completely parameterized by two RGBA textures.Completely parameterized by two RGBA textures.
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Further reading Further reading
•BlogsBlogshttp://www.rorydriscoll.com/2009/01/25/energy-conservation-in-games/http://www.rorydriscoll.com/2009/01/25/energy-conservation-in-games/http://seblagarde.wordpress.com/2011/08/17/hello-world/http://seblagarde.wordpress.com/2011/08/17/hello-world/http://www.thetenthplanet.de/archives/http://www.thetenthplanet.de/archives/255255
•UnrealUnrealhttp://udn.epicgames.com/Three/ImageBasedReflections.htmlhttp://udn.epicgames.com/Three/ImageBasedReflections.html
•CryEngineCryEnginehttp://freesdk.crydev.net/display/SDKDOC4/Shadinhttp://freesdk.crydev.net/display/SDKDOC4/Shadingg
PBS IngredientsPBS Ingredients
PBS Ingredient #3PBS Ingredient #3
Metals and Metals and DielectricsDielectrics
PBS IngredientsPBS Ingredients
PBS Ingredient #3PBS Ingredient #3
Metals and Metals and ......
PBS IngredientsPBS Ingredients
PBS Ingredient #3PBS Ingredient #3
Metals and Non-Metals and Non-MetalsMetals
PBS IngredientsPBS Ingredients
PBS Ingredient #3PBS Ingredient #3
Metals and Non-Metals and Non-MetalsMetals
aka: “can set diffuse color to zero without everything else aka: “can set diffuse color to zero without everything else messed up”messed up”
PBS IngredientsPBS Ingredients
PBS Ingredient #3PBS Ingredient #3
Metals and Non-MetalsMetals and Non-Metalsaka: “can set diffuse color to zero without everything else messed aka: “can set diffuse color to zero without everything else messed
up”up”= no need for an extra “metal shader” (helps batching)= no need for an extra “metal shader” (helps batching)
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Assignment:Assignment:What is the difference between metals and non-What is the difference between metals and non-metals?metals?
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Assignment:Assignment:What is the difference between metals and non-What is the difference between metals and non-metals?metals?
Are metals “somehow grey”?Are metals “somehow grey”?
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Assignment:Assignment:What is the difference between metals and non-What is the difference between metals and non-metals?metals?
Are metals “especially shiny”?Are metals “especially shiny”?
Assignment:Assignment:What is the difference between metals and non-What is the difference between metals and non-metals?metals?
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
But surely they But surely they have have
““lots of specular”?lots of specular”?
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
metalmetalnon-greynon-grey
non-metalnon-metalhigh glossinesshigh glossiness
non-metalnon-metallow glossinesslow glossiness
metalmetallow glossinesslow glossiness
metalmetalhigh glossinesshigh glossiness
Metals are pure reflection,Metals are pure reflection,characterized by the characterized by the absenceabsence of a diffuse component. of a diffuse component.
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
non-metalnon-metaldiffusediffuse + + specularspecular
metal metal specularspecular only only
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
specular specular reflectionreflectionmore or less glossymore or less glossy
incoming lightincoming light
surfacesurfacemore or less smoothmore or less smooth
Specular reflection happens on the surfaceSpecular reflection happens on the surface
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
This is still specular reflectionThis is still specular reflection
specular specular reflectionreflectionall over the placeall over the place
incoming lightincoming light
surfacesurfaceextremely roughextremely rough
specular specular reflectionreflectionall over the placeall over the place
incoming lightincoming light
surfacesurfaceextremely roughextremely rough
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
This is still specular reflectionThis is still specular reflection
100% specular100% specular
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
incoming lightincoming light
moleculesmolecules
Diffuse reflection happens Diffuse reflection happens belowbelow the surface the surfaceCompletely different physical processCompletely different physical process
diffuse reflectiondiffuse reflectionabsorption and re-absorption and re-emissionemission
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Diffuse reflection happens Diffuse reflection happens belowbelow the surface the surfaceCompletely different physical processCompletely different physical process
incoming lightincoming light
moleculesmolecules
diffuse reflectiondiffuse reflectionabsorption and re-absorption and re-emissionemission
100% diffuse100% diffuse(no solid surface (no solid surface
at all)at all)
incoming lightincoming light
moleculesmolecules
diffuse reflectiondiffuse reflectionabsorption and re-absorption and re-emissionemission
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
100% diffuse100% diffuse(no solid surface (no solid surface
at all)at all)
Metals (electrical conductors) cannot have thisMetals (electrical conductors) cannot have this
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Ok, so lets give this a tryOk, so lets give this a tryForce the diffuse color to zero—does this look like Force the diffuse color to zero—does this look like a metal?a metal?
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
normalizednormalizedBlinn/Blinn/PhongPhong
diffuse colordiffuse coloropacityopacityspecular colorspecular colorglossinessglossiness
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
ConstantConstant
colorcolor
ConstantConstant
colorcolor
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Software: GLC Player 2.3Software: GLC Player 2.3Model: Model: http://www.3dm3.com/modelsbank/model76.htm
Oh no!Oh no!Ambient is Ambient is gone!gone!
Looks like black plasticLooks like black plastic
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Must have “ambient” Must have “ambient” models for both diffuse models for both diffuse and specular.and specular.
Here: Hemisphere lightHere: Hemisphere light(sky+ground color)(sky+ground color)
So much So much nicernicer
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
diffusediffuse specularspecularlow glossinesslow glossiness
specularspecularhigh glossinesshigh glossiness
direct lightdirect light
hemisphere lighthemisphere light
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
diffusediffuse specularspecularlow glossinesslow glossiness
specularspecularhigh glossinesshigh glossiness
direct light + hemisphere light direct light + hemisphere light
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
diffuse+speculadiffuse+specularr
low glossinesslow glossiness
diffuse+speculadiffuse+specularr
high glossinesshigh glossiness
direct light + hemisphere light direct light + hemisphere light
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
20062006World globe with purely specular surfaceWorld globe with purely specular surfaceSpellforce 2: Dragon StormSpellforce 2: Dragon Storm
directdirect
groundground
^̂̂̂ skysky
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
20092009Wodden collectible box with metal ornamentWodden collectible box with metal ornament Velvet AssassinVelvet Assassin
diffusediffuse specularspecular glossinesglossinesss
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
20092009Wodden collectible box with metal ornamentWodden collectible box with metal ornament Velvet AssassinVelvet Assassin
Velvet AssassinVelvet Assassindiffusediffuse specularspecular glossinesglossines
ss
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
20092009Wodden collectible box with metal ornamentWodden collectible box with metal ornament Velvet AssassinVelvet Assassin
Velvet AssassinVelvet Assassindiffusediffuse specularspecular glossinesglossines
ss
PBS IngredientsPBS Ingredients
PBS Ingredient #4PBS Ingredient #4
Fresnel ReflectanceFresnel Reflectance
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel effect (no news Fresnel effect (no news here)—here)—
•Increasing reflectivity Increasing reflectivity towards grazing angletowards grazing angle
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel effect (no news Fresnel effect (no news here)—here)—
•Increasing reflectivity Increasing reflectivity towards grazing angletowards grazing angle
•Very prominent on waterVery prominent on water
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel effect (no news Fresnel effect (no news here)—here)—
•Increasing reflectivity Increasing reflectivity towards grazing angletowards grazing angle
•Very prominent on waterVery prominent on water
•In theory, everything In theory, everything becomes a perfect mirror becomes a perfect mirror at the grazing limitat the grazing limit
http://de.wikipedia.org/wiki/Fresnelsche_Formeln
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel effect (no news here)—Fresnel effect (no news here)—
•Increasing reflectivity towards Increasing reflectivity towards grazing anglegrazing angle
•Very prominent on waterVery prominent on water
•In theory, everything In theory, everything becomes a perfect mirror at becomes a perfect mirror at the grazing limitthe grazing limit
•Corollary: Everything Is Shiny!Corollary: Everything Is Shiny!http://filmicgames.com/archives/547http://filmicgames.com/archives/547
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel reflectance can be used to classify materialsFresnel reflectance can be used to classify materials
R(90°) is the R(90°) is the samesame
for all ...for all ...
... but R(0°) is different for ... but R(0°) is different for each.each.
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Non-metals are Non-metals are here (2% to 8%)here (2% to 8%)
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Metals are here Metals are here (60% to 90%)(60% to 90%)
most are colored most are colored to some degreeto some degree
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Semiconductors Semiconductors and crystals are and crystals are here here (15% to 50%)(15% to 50%) http://en.wikipedia.org/wiki/
Sapphire
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
Non-metals are Non-metals are here (2% to 8%)here (2% to 8%)
Metals are here Metals are here (60% to 90%)(60% to 90%)
Semiconductors Semiconductors and crystals are and crystals are here here (15% to 50%)(15% to 50%)
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
An approximation: all curves are fairly well predicted An approximation: all curves are fairly well predicted by R(0°)by R(0°)
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Physically Based Shading uses this as “specular color”Physically Based Shading uses this as “specular color”
Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
2%2%
5%5%
10%10%
20%20%
50%50%
80%80%
Physically Based Shading uses this as “specular color”Physically Based Shading uses this as “specular color”
rememberremember
Linear Linear
Lighting?Lighting?
2%2%
5%5%
10%10%
20%20%
50%50%
80%80%Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Physically Based Shading uses this as “specular color”Physically Based Shading uses this as “specular color”
rememberremember
Linear Linear
Lighting?Lighting?
2%2%
5%5%
10%10%
20%20%
50%50%
80%80%Fresnel reflectance can be used to Fresnel reflectance can be used to classify materialsclassify materials
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Non-metals (2% to Non-metals (2% to 8%)8%)
Metals (60% to Metals (60% to 90%)90%)
Semiconductors Semiconductors and crystals (15% and crystals (15%
to 50%)to 50%)
2%2%
5%5%
10%10%
20%20%
50%50%
80%80%
??
??
??
??
??
??
RealityReality RGB (gamma RGB (gamma 2.2)2.2)
Specular Color ChartSpecular Color Chart
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Non-metals (2% to Non-metals (2% to 8%)8%)
Metals (60% to Metals (60% to 90%)90%)
Semiconductors Semiconductors and crystals (15% and crystals (15%
to 50%)to 50%)
2%2%
5%5%
10%10%
20%20%
50%50%
80%80%
16%16%
25%25%
35%35%
48%48%
76%76%
90%90%
RealityReality RGB (gamma RGB (gamma 2.2)2.2)
Specular Color ChartSpecular Color Chart
PBS Ingredients → Fresnel ReflectancePBS Ingredients → Fresnel Reflectance
Further reading Further reading
•BlogsBlogshttp://seblagarde.wordpress.com/2012/04/30/dontnod-specular-and-glossinesshttp://seblagarde.wordpress.com/2012/04/30/dontnod-specular-and-glossiness-chart-chart//
•Real Time Rendering, 3rd EditionReal Time Rendering, 3rd Editionhttp://www.realtimerendering.comhttp://www.realtimerendering.com
•ShaderX 7ShaderX 7http://www.shaderx7.comhttp://www.shaderx7.com
•SIGGRAPH Course on PBS SIGGRAPH Course on PBS (2010)(2010) http://bit.ly/s10shadershttp://bit.ly/s10shaders(2012) (2012) http://bit.ly/s12shadershttp://bit.ly/s12shaders
ConclusionConclusion
ConclusionConclusion
ConclusionConclusion
normalizednormalizedBlinn/PhongBlinn/Phong
diffuse colordiffuse coloropacityopacityspecular specular colorcolorglossinessglossiness
normalizednormalizedBlinn/PhongBlinn/Phong
diffuse colordiffuse coloropacityopacityspecular specular colorcolorglossinessglossiness
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
normalizednormalizedBlinn/PhongBlinn/Phong
diffuse colordiffuse coloropacityopacityspecular specular colorcolorglossinessglossiness
normalizednormalizedBlinn/PhongBlinn/Phong
diffuse colordiffuse coloropacityopacityspecular specular colorcolorglossinessglossiness
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
TextureTexture
colorcoloralphaalpha
ConclusionConclusion
diffusediffuse speculspecularar
glossinglossinessess
Physically Based Shading Physically Based Shading
•Is going to be implemented in more and more Is going to be implemented in more and more enginesengines
•Affects content creation, mostly texturingAffects content creation, mostly texturing
•Affects how you think about colors and numbersAffects how you think about colors and numbers
ConclusionConclusion
Thank YouThank You
Contact InformationContact Information
[email protected]@mbldev.com
More information and links to related material on More information and links to related material on my blogmy blog
http://http://www.thetenthplanet.dewww.thetenthplanet.de
Bonus SlidesBonus Slides
PBS IngredientsPBS Ingredients
Other ingredients of Physically based lightingOther ingredients of Physically based lighting
•Image based reflectionsImage based reflectionsUse an environment map instead of a simple Use an environment map instead of a simple hemispherehemisphereAutomatic mipmap selection based on glossinessAutomatic mipmap selection based on glossiness
PBS IngredientsPBS Ingredients
Other ingredients of Physically based lightingOther ingredients of Physically based lighting
•Real-Time Microfacet ModelReal-Time Microfacet ModelUsually based on a Cook-Torrance approximationUsually based on a Cook-Torrance approximationGives more “oomph” in backlight scenarios than Gives more “oomph” in backlight scenarios than Fresnel onlyFresnel only
•(insert Velvet Assassin screenshot)(insert Velvet Assassin screenshot)
PBS Ingredients → Display Gamma and Linear LightingPBS Ingredients → Display Gamma and Linear Lighting
Linear Lighting TimelineLinear Lighting Timeline
Silicon Graphics, 3dfx Voodoo, etcSilicon Graphics, 3dfx Voodoo, etcfixed 1.8 gamma rampfixed 1.8 gamma ramppre 1996pre 1996
19961996 QuakeQuakeMicrosoft + HP define sRGB (gamma 2.2)Microsoft + HP define sRGB (gamma 2.2)
20022002Linear lighting becomes feasible with Linear lighting becomes feasible with DirectX 9DirectX 9
20082008 OpenGL supports sRGBOpenGL supports sRGB
20062006 Spellforce 2: Shadow WarsSpellforce 2: Shadow Wars
20072007 Crysis + CryEngineCrysis + CryEngine
20052005 Unreal Engine 3 announcedUnreal Engine 3 announced
20112011 Unity Engine 3.5Unity Engine 3.5
{{
Dark
D
ark
A
ges
Ag
es
PBS Ingredients → Energy Preserving SpecularPBS Ingredients → Energy Preserving Specular
Energy Preserving Specular TimelineEnergy Preserving Specular Timeline
19941994 Lafortune & WillemsLafortune & Willems“Modified Phong Reflectance Model”“Modified Phong Reflectance Model”
20062006 Spellforce 2: Shadow WarsSpellforce 2: Shadow Wars
20092009 Velvet AssassinVelvet Assassin
20112011
Unreal Engine 3 Unreal Engine 3 enabled as “Image Reflection Specular”enabled as “Image Reflection Specular”
CryEngine 3CryEngine 3enabled with alpha channel in specular textureenabled with alpha channel in specular texture
20102010 Call of Duty: Black OpsCall of Duty: Black Ops
20132013 Remember MeRemember Me
incoming lightincoming light
moleculesmolecules
diffuse reflectiondiffuse reflectionabsorption and re-absorption and re-emissionemission
PBS Ingredients → Metals and DielectricsPBS Ingredients → Metals and Dielectrics
Metals (electrical conductors) cannot have thisMetals (electrical conductors) cannot have this
Plasma is an electrical Plasma is an electrical conductor, too.conductor, too.
The sun: emissive + specularThe sun: emissive + specular
Bonus→ Energy Preserving SpecularBonus→ Energy Preserving Specular
20062006Per pixel varying glossinessPer pixel varying glossinessIce material in Spellforce 2Ice material in Spellforce 2