Upload
gwenda-anthony
View
230
Download
1
Tags:
Embed Size (px)
Citation preview
Definition• Platforms for this talk
– Windows / DirectX11– OpenGL 4 / OpenGL ES 3.0– PlayStation 4– Xbox One
ALU Budgets• What do you use higher ALU performance for?
– Full HD resolution(1920x1080)• 2.25 times larger than half HD resolution(1280x720)
– Post-processing• High quality post-processing with existing algorithms
– High resolution post-processing– Glare, de-focus blur, motion blur– Screen-space anti-aliasing
• New post-processing– Screen-space lighting (reflections), ambient obscurance, sub-surface
scattering, volume rendering
Recent GPU Trend• ALU free
– Current GPU performance doesn’t depend on the number of ALU cycles
• B/W of cache / texture / render targets• Register / multi-threading• Limitations of render backend resources
– Increasing the number of ALU instructions doesn’t tend to decrease performance
• ALU is typically used to save B/W by encoding and decoding• It depends on the design of rendering passes
How About Shading?• Many texture samples
– For both forward and deferred techniques• The only difference is the rendering pass
– Albedo, Reflectance– Normal / Height, Roughness, AO– G-Buffer– Light source (IBL / SSL) / accumulation, GI info.
– Do we have a budget to use more ALU?
More ALU?• Can we use more ALU instructions for shading?
– Old normalized Blinn-Phong model uses 20 to 30 instructions
– 100 instructions / light are affordable for new generation consoles
– Using more instructions for shading is a good candidate to use ALU efficiently
),max(
))(()(1 0
210 enln
hn
n
specdFF
cncFR
The Current Popular Model• A physically based model for specular
– Microfacet model• GGX (Trowbridge-Reitz) (D)• Schlick approximation (F)• Smith (G)
))((4
),(),(),(),(
enln
elelelel
GFDfr
Better Model for Fresnel?• Spherical Gaussian Approximation
– This model approximates the Schlick approximation
– Should we approximate the Fresnel equation?– Should we use more a accurate
approximation?
hehehe 98316.6)(55473.500 2)1(),( ffF
Evaluation
Yellow : Fresnel equation (IOR = aluminum at 610nm)Green : Schlick approximation (IOR = aluminum at 610nm)Blue : Fresnel equation (IOR = 1.5)Purple : Schlick approximation (IOR = 1.5)
F( q)
q
Need Approximation?• Do we have to approximate Fresnel for
new generation consoles?– Fresnel equation w.r.t. reflectance ( f0 )
• It is easier to handle than refractive index
2
00
00
2
00
00
)1(cos)1(
)1(cos)1(
)1(cos)1(
)1(cos)1(5.0
ff
ff
ff
ffF
20
220
)1(
)cos1()1(1
f
f
(IOR = 1.3 + 7.48i)Blue : Fresnel equation with the refractive indexPurple : Fresnel equation with the real reflectance
Fresnel with Reflectance• This Fresnel equation is inaccurate for large f0
– A large real f0 is calculatedfrom a complex refractive index
– The Fresnel equation should take complex numbers
– The complex version is more complicated
F( q)
q
Improved Spherical Gaussian• Fresnel behavior is complicated
– Need a complex approximation to represent the behavior
– Try to improve accuracy with most useful value IOR = 1.5
cos58092.8cos60232.900
8
2)1()( ffF
Improved Spherical Gaussian
(IOR = 1.5)Blue : Schlick approximation Purple : Fresnel equationYellow : Improved Spherical Gaussian
Schlick
Improved SphericalGaussian
F( q)
q
Conclusion for F Term• Schlick is a good enough approximation
– It still has a problem with complex refractive indices with a large imaginary part
• It can be improved with Fresnel Term Approximations for Metals [WSCG 2005]
– It requires a complex refractive index as a parameter
– This difference is difficult to distinguish with punctual lights, but is more visible with image based lighting
• We use the Schlick approximation in this talk, though you can choose better approximations (including improved Spherical Gaussian) as you like
How about Diffuse?• Lambert?
– It is not realistic– We use microfacet models for specular, so
why not for diffuse?
Oren-Nayar?• Use Oren-Nayar [SIGGRAPH 1994]
– Diffuse model taking into account the microfacet model and roughness
• View dependent component• Matte-look depending on roughness• Retro-reflective effect
• NDF is not GGX– NDF of Oren-Nayar is
• G term is not Smith– Torrance-Sparrow V-cavity model
• Oren-Nayar doesn’t conserve energy with specular on each facet– Not a physically based model
2
2
2)( l
ecD
l
Problems with Oren-Nayar
Our Goal• Better diffuse model
– Using the same microfacet model as specular– Physically based diffuse model
Microfacet Model for Specular• A reflectance model for specular can be
simple– You only take reflection in view direction into
account
))((4
),(),(),(),(
enln
elelelel
GFDfr
Microfacet Model for Diffuse• Since diffuse reflects incident light in all
directions, a reflectance model is complex– If we assume all facets are Lambertian– All facets reflect toward view direction
mdiffr dGFDf
),,(),,()())(())((
1)( elmelmmemlm
enlnel,n,
W : Hemisphere around the geometry normal(n)m : Microfacet normal
Try to Improve Oren-Nayar• The first problem is that Oren-Nayar
doesn’t take Fresnel into account– See “Improved Diffuse Reflection Models for
Computer Vision” [WOLFF et al. 1998]
Starting Point
if0)))((( lnenle
otherwise
),1Min()))(()(09.0
45.0()65.0
5.00.1)((2
2
2
2
0 en
lnlnenleln
E
rL
)))()(()(
09.045.0()
65.05.00.1)((
2
2
2
2
0 lnlnenleln
E
Blue : Original Oren-NayarPurple : Improved one (SIGGRAPH 2012)
Lr
qe
Intuition• When surface gets rougher
– Microfacet model behaves like a blur filter– When roughness = 0
• Fresnel effect with Lambertian
– When roughness increases• Fresnel effect gets blurrier
Oren-Nayar analysis
),1Min()))(()(09.0
45.0()65.0
5.00.1)((2
2
2
2
0 en
lnlnenleln
E
Lambertian View-dependent factor(microfacet effect)
Blending factor(with roughness)
Diffuse Fresnel Term• Using “A Practitioners’ Assesment of Light
Reflection Models” [PG 1997]
550 )1(1)1(1)1(
20
21)( enlnel, fFdiff
Add Fresnel Term
),1Min()))(()(09.0
45.0()65.0
5.00.1)()(,()1(2
2
2
2
00 en
lnlnenlelnel
diffFfE
55 )1(1)1(120
21)( enlnel, diffF
550 )1(1)1(1
20
21)1()( enlnel, fFdiff
Result
Lambert Improved Oren-Nayar[SIGGRAPH 2012]
Oren-Nayar with Fresnel
roughness = 0.7
AnalysisBlue : Oren-Nayar, roughness = 0.0Purple: Oren-Nayar w/ Fresnel, roughness = 0.0Yellow: Oren-Nayar, roughness = 1.0Green : Oren-Nayar w/ Fresnel, roughness = 1.0
ql
n·e 1 (0)
cos 1 (0)
f0 0.04
Lr
AnalysisBlue : Oren-Nayar, roughness = 0.0Purple: Oren-Nayar w/ Fresnel, roughness = 0.0Yellow: Oren-Nayar, roughness = 1.0Green : Oren-Nayar w/ Fresnel, roughness = 1.0
ql
n·e 0.707 (45)
cos 1 (0)
f0 0.04
Lr
AnalysisBlue : Oren-Nayar, roughness = 0.0Purple: Oren-Nayar w/ Fresnel, roughness = 0.0Yellow: Oren-Nayar, roughness = 1.0Green : Oren-Nayar w/ Fresnel, roughness = 1.0
ql
n·e 0.174(80)
cos 1 (0)
f0 0.04
Lr
Is This Physically Based Diffuse?
• This is still a compromise– F term
• In reality, each facet must follow Fresnel• Integrate Fresnel (with other terms) over facets
– D and G terms• Still not GGX and Smith
Try to Derive a New Diffuse Model
• Simply, integrating the diffuse microfacet model with given D, F and G functions– Not modifying Oren-Nayar
mdiffr dGFDf
),,()),,()(())(())((
1)( elmelmmemlm
enlnel,n,
Deriving a New Model• The model doesn’t have a closed form
– It is numerically integrated
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·e 1.0 (0)
cos 1.0 (0)roughness 0.0
f0 0.04
ql
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·e 1.0 (0)
cos 1.0 (0)roughness 0.5
f0 0.04
ql
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·e 1.0 (0)
cos 1.0 (0)roughness 1.0
f0 0.04
ql
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·e 0.5 (60)
cos 1.0 (0)roughness 0.8
f0 0.04
ql
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·e 0.342 (70)
cos 0.5 (60)roughness 0.6
f0 0.04
ql
Lr
AnalysisBlue : Oren-NayarPuprle: Oren-Nayar w/ FresnelGreen : New model
n·l 0.866 (30)
cos 1.0 (0)roughness 0.0
f0 0.04
qe
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·l 0.866 (30)
cos 1.0 (0)roughness 0.3
f0 0.04
qe
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·l 0.866 (30)
cos 1.0 (0)roughness 0.7
f0 0.04
qe
Lr
AnalysisBlue : Oren-NayarPurple: Oren-Nayar w/ FresnelGreen : New model
n·l 0.259 (75)
cos 0.985 (10)roughness 0.8
f0 0.04
qe
Lr
Implementation of the New Model
• Baking the model to a texture is the simplest way– 3 vectors and 2 scalars
• f0 can be factored out of texture
– It is difficult to bake the model directly
mdiffr drGfFrDrff
),,,(),,,(),())(())((
1),,( 00 elmelmmemlm
enlnel,n,
ALU implementation• When your shader is texture-bound
– Typically, it is texture-bound– Complex fitted model is better than texture
reads
Fitted Shading Model
1116402.150912.1733996.036053.1
)1(1
36053.1
303573.0542026.01),,( 1
139
123
2
45
2
24
2
enen
lerF
0)))((( if lnenle
25 )(5.05.011,2Min110,21Max),( lnlnlnl mL
en
en
lnen
le,388410.0188566.0
2)(3726732.01
11))(995584.031072.1)(09.0(
),(2
2
dV
)(),(),(),(120
21),,( 00 le,le,lle,le, pdmrr BVLFffL
))((
))(())((4.1)(
lnenle
lnenlelnenle,pB
otherwise
Complexity• The model is very complicated
– Only a slight performance difference between our new model and Oren-Nayar in typical scenes
– ALU is free!
Fitted Model Analysisn·e 1.0 (0)
cos 1.0 (0)roughness 0.0
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
ql
Lr
Fitted Model Analysisn·e 1.0 (0)
cos 1.0 (0)roughness 0.5
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
ql
Lr
Fitted Model Analysisn·e 1.0 (0)
cos 1.0 (0)roughness 1.0
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
ql
Lr
Fitted Model Analysisn·e 0.5 (60)
cos 1.0 (0)roughness 0.8
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
n·l
Lr
Fitted Model Analysisn·e 0.342 (70)
cos 0.5 (60)roughness 0.6
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
ql
Lr
Fitted Model Analysisn·l 0.866 (30)
cos 1.0 (0)roughness 0.0
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
qe
Lr
Fitted Model Analysisn·l 0.866 (30)
cos 1.0 (0)roughness 0.3
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
qe
Lr
Fitted Model Analysisn·l 0.866 (30)
cos 1.0 (0)roughness 0.7
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
qe
Lr
Fitted Model Analysisn·l 0.259(75)
cos 0.985 (10)roughness 0.8
f0 0.04
Blue : Fitted modelOrange Dash : Numerically integrated
qe
Lr
Limitation• Accuracy at grazing angles for both view and
light vectors is not enough with this model– It may be noticeable on the edges
• Roughness is assumed to be from 0 to 1• The fitting model shouldn’t be used to
compute AmbientBRDF texture
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 0.0
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 0.05
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 0.1
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 0.3
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 1.0
Results
Lambert Oren-Nayar w/Fresnel New model
Roughness 1.0 (diffuse only)
Lambert Oren-Nayar w/Fresnel New model
Lambert Oren-Nayar w/Fresnel New model
Lambert Oren-Nayar w/Fresnel New model
Conclusion• From a physically based perspective, the
same microfacet model should be used for both diffuse and specular– It makes more persuasive visuals– New consoles have enough computational
power to implement such complex models
Acknowledgements• Tatsuya Shoji• Stephen McAuley• Stephen Hill
Questions?
http://research.tri-ace.com/
You can find these slides, including past presentations, at