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
The Current Popular Model A physically based model for specular –Microfacet model GGX (Trowbridge-Reitz) (D) Schlick approximation (F) Smith (G)
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?
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( )
Need Approximation? Do we have to approximate Fresnel for new generation consoles? –Fresnel equation w.r.t. reflectance ( f 0 ) It is easier to handle than refractive index
(IOR = i ) Blue : Fresnel equation with the refractive index Purple : Fresnel equation with the real reflectance Fresnel with Reflectance This Fresnel equation is inaccurate for large f 0 –A large real f 0 is calculated from a complex refractive index –The Fresnel equation should take complex numbers –The complex version is more complicated F( )
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
Improved Spherical Gaussian (IOR = 1.5) Blue : Schlick approximation Purple : Fresnel equation Yellow : Improved Spherical Gaussian Schlick Improved Spherical Gaussian F( )
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 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
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 : 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 if otherwise Blue : Original Oren-Nayar Purple : Improved one (SIGGRAPH 2012) LrLr ee
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 Lambertian View-dependent factor (microfacet effect) Blending factor (with roughness)
Diffuse Fresnel Term Using “A Practitioners’ Assesment of Light Reflection Models” [PG 1997]
Add Fresnel Term
Result Lambert Improved Oren-Nayar [SIGGRAPH 2012] Oren-Nayar with Fresnel roughness = 0.7
Analysis Blue : Oren-Nayar, roughness = 0.0 Purple: Oren-Nayar w/ Fresnel, roughness = 0.0 Yellow: Oren-Nayar, roughness = 1.0 Green : Oren-Nayar w/ Fresnel, roughness = 1.0 ll n·e 1 (0 ) cos 1 (0 ) f0f LrLr
Analysis Blue : Oren-Nayar, roughness = 0.0 Purple: Oren-Nayar w/ Fresnel, roughness = 0.0 Yellow: Oren-Nayar, roughness = 1.0 Green : Oren-Nayar w/ Fresnel, roughness = 1.0 ll n·e (45 ) cos 1 (0 ) f0f LrLr
Analysis Blue : Oren-Nayar, roughness = 0.0 Purple: Oren-Nayar w/ Fresnel, roughness = 0.0 Yellow: Oren-Nayar, roughness = 1.0 Green : Oren-Nayar w/ Fresnel, roughness = 1.0 ll n·e 0.174(80 ) cos 1 (0 ) f0f LrLr
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
Deriving a New Model The model doesn’t have a closed form –It is numerically integrated
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·e 1.0 (0 ) cos 1.0 (0 ) roughness 0.0 f0f ll LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·e 1.0 (0 ) cos 1.0 (0 ) roughness 0.5 f0f ll LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·e 1.0 (0 ) cos 1.0 (0 ) roughness 1.0 f0f ll LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·e 0.5 (60 ) cos 1.0 (0 ) roughness 0.8 f0f ll LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·e (70 ) cos 0.5 (60 ) roughness 0.6 f0f ll LrLr
Analysis Blue : Oren-Nayar Puprle: Oren-Nayar w/ Fresnel Green : New model n·l (30 ) cos 1.0 (0 ) roughness 0.0 f0f ee LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·l (30 ) cos 1.0 (0 ) roughness 0.3 f0f ee LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·l (30 ) cos 1.0 (0 ) roughness 0.7 f0f ee LrLr
Analysis Blue : Oren-Nayar Purple: Oren-Nayar w/ Fresnel Green : New model n·l (75 ) cos (10 ) roughness 0.8 f0f ee LrLr
Implementation of the New Model Baking the model to a texture is the simplest way –3 vectors and 2 scalars f 0 can be factored out of texture –It is difficult to bake the model directly
ALU implementation When your shader is texture-bound –Typically, it is texture-bound –Complex fitted model is better than texture reads
Fitted Shading Model
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 Analysis n·e 1.0 (0 ) cos 1.0 (0 ) roughness 0.0 f0f Blue : Fitted model Orange Dash : Numerically integrated ll LrLr
Fitted Model Analysis n·e 1.0 (0 ) cos 1.0 (0 ) roughness 0.5 f0f Blue : Fitted model Orange Dash : Numerically integrated ll LrLr
Fitted Model Analysis n·e 1.0 (0 ) cos 1.0 (0 ) roughness 1.0 f0f Blue : Fitted model Orange Dash : Numerically integrated ll LrLr
Fitted Model Analysis n·e 0.5 (60 ) cos 1.0 (0 ) roughness 0.8 f0f Blue : Fitted model Orange Dash : Numerically integrated n·l LrLr
Fitted Model Analysis n·e (70 ) cos 0.5 (60 ) roughness 0.6 f0f Blue : Fitted model Orange Dash : Numerically integrated ll LrLr
Fitted Model Analysis n·l (30 ) cos 1.0 (0 ) roughness 0.0 f0f Blue : Fitted model Orange Dash : Numerically integrated ee LrLr
Fitted Model Analysis n·l (30 ) cos 1.0 (0 ) roughness 0.3 f0f Blue : Fitted model Orange Dash : Numerically integrated ee LrLr
Fitted Model Analysis n·l (30 ) cos 1.0 (0 ) roughness 0.7 f0f Blue : Fitted model Orange Dash : Numerically integrated ee LrLr
Fitted Model Analysis n·l 0.259(75 ) cos (10 ) roughness 0.8 f0f Blue : Fitted model Orange Dash : Numerically integrated ee LrLr
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 LambertOren-Nayar w/FresnelNew model Roughness 0.0
Results LambertOren-Nayar w/FresnelNew model Roughness 0.05
Results LambertOren-Nayar w/FresnelNew model Roughness 0.1
Results LambertOren-Nayar w/FresnelNew model Roughness 0.3
Results LambertOren-Nayar w/FresnelNew model Roughness 1.0
Results LambertOren-Nayar w/FresnelNew model Roughness 1.0 (diffuse only)
LambertOren-Nayar w/FresnelNew model
LambertOren-Nayar w/FresnelNew model
LambertOren-Nayar w/FresnelNew 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
Questions? You can find these slides, including past presentations, at