https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
https://www.ea.com/frostbite/news/moving-frostbite-to-pb
https://blog.csdn.net/poem_qianmo/article/details/100652463 参考毛星云的博客,非常有帮助

3.1 material models
3.1.1 appearance
surface appearance results from the interaction between incoming light and the material properties of a surface. the variety of appearances observable in the real world is quite wide, ranging from simple uniform materials to complex layered and heterogeneous 异构的 materials, see figure 4.

figure 4: various surface appearance showing the diversity多样性 of interaction between light and matter.

these different appearances can be categorized by certain intrinstic physical properties such as conductivity, mean-free-path, and absoption. baesd on these material properties, the literature has exposed various material models capable of representing a certain range of appearances amongst the full spectrum. material model literature is extensive, and a lot of different models exist with various trade-offs and accuracies. a material model, referred to as a BSDF (Bidirectional Scattering Distribution Function), can be decomposed into two parts: a Reflectance part (BRDF) and a Transmittance part (BTDF). in this document we will focuse on the reflective part and in particular on a material model capable of representing “standard” appearances i.e. the vase majority of surfaces we encounter in our every day life. hence, we will limit ourselves to reflective, isotropic, dielectric/conductor surfaces with short mean-free-paths.

3.1.2 Material models
in the context of this standard material model, a surface response f is often decomposed into two different terms: a low angular frequency signal called “diffuse” (fd) and a low to high angular frequency part called “specular” (fr), see figure 5.

figure 5: light interaction with a slab of “standard” matter. left:light interactions. right: a BSDF model of the interaction with a diffuse term fd and a specular fr.

an interface sepearates two media: the air and the matter. surfaces made of a flat interface can easily be represented by the Fresnel law [Wikd] for both dieletric and conductor surfaces. when the interface is irregular, see figure 6,

figure 6: shows surfaces of different roughness, modeled by D term. top: light interactions with the microfacets. middle: resulting BRDF fr lobe. bottom: resulting appearance on spheres.

the literature shows that microfacet based models[CT82] are well adapted to characterize the light interaction for these types of surfaces. a microfacet model is described by Equation 1, for more details about the derivations see [Hei14]:

the term D models the microfacet distribution (i.e. the NDF, normal distribution function). the G term models the occlusion (shadow-masking) of the microfacets. this formulation is valid for both the diffuse term fd and the specular term fr. the difference between these two term lies in the microfacet BRDF fm. for the specular term, fm is a perfect mirror and thus is modeled with the Fresnel F law, which leads to the well-known following formulation:

the term 我们把term翻译成系数的意思 D plays an important role in the appearance of surfaces, as shown by figure 6. the literature, [Wal+; Bur12] has recently pointed out that “long-tailed” NDFs, like the GGX distribution, are good at capturing real world surfaces. the G term also plays an important role for high roughness values. Heitz [Hei14] has recently shown that the Smith visibility function is the correct and exact G term to use. he also points out that the literature often tends to use an approximated version of the Smith visibility function, while a more accurate form of the masking-shadowing function models the correleation between the masking and shadowing due to the height of the microsurface, see equation 3. figure 7 shows the difference between the simple Smith function and the height-correlated Smith function.

For the diffuse term, fm follows a Lambertian model and Equation 1 can be simpli ed into:

Until recently the diffuse term fd was assumed to be a simple Lambertian model. However, except for layered materials, the diffuse part needs to be coherent with the specular term and must take into account the roughness of the surface [Bur12] (i.e specular and diffuse term should use same roughness term3), see Figure 8. The Equation 4 does not have an analytic solution. Oren et al. [ON94] found
an empirical approximation of this equation using a Gaussian NDF distribution and a V-cavity G term know as the Oren-Nayar model. To correctly support our model we should make an equivalent approximation for Equation 4 with a GGX NDF as describe in Gotanda [Got14]. Appendix B details some of our analysis about such a diffuse model, but further research is required.

Figure 8: Shows a view of the interaction at the micro scale for both the specular fr term, which has a mirror BRDF fm (left), and the diffuse term fd, which has a diffuse BRDF fm (right).

Burley [Bur12] has presented another diffuse model built on real world surface observations, see Equation 5. While this model is empirical, it allows us to reproduce the main features of the MERL database’s materials http://www.merl.com/brdf/. For this reason and because of its simplicity, we have chosen to use this model in Frostbite. This diffuse term takes into account the roughness of the material and creates some retro-reflection at grazing angles.

3.1.3 energy conservation
energy conservation is important to consider in order to not add more energy than received. in addition it allows us to correctly handle the behavior at grazing angles, for which the light tends to be scattered more by the specular term than the diffuse term. in frostbite 寒霜引擎 we have chosen to keep the computation simple and only ensure the preservation of energy, by ensuring that the hemispherical directional reflectance, which gives the total reflecance in a given direction due to constant illumination over the hemisphere, is below for our whole BRDF (diffuse+specular term):


3.1.5 frostbite standard model
to summarize, frostbite’s “standard” material model is close to the one used by other game engines [Kar13;NP13;Bur12]. it is composed of:

  1. specular term fr: a specular microfacet model (see equation 2) with a smith coorelated visibility function and a GGX NDF.
  2. diffuse term fd: the Disney diffuse term with energy renormalization.

for both parts, we apply our dominant direction correction (off-specular peak handling) when integrating lighting. the parameters for manipulating these models will be described in the next section.

forstbite also supports other types of material such as clear coat 漆 and materials with subsurface scattering, but we will focus only on the standard material model in this document.
插入一条消息:菲涅尔近似公式,F0就是当入射角为0的时候,其反射系数。详细可参考:https://blog.csdn.net/wodownload2/article/details/100096281

D_GGX——法线分布函数是:https://blog.csdn.net/wodownload2/article/details/100096281

float3 F_Schlick (in float3 f0 , in float f90 , in float u)
{return f0 + (f90 - f0) * pow (1. f - u, 5.f);
}float V_SmithGGXCorrelated ( float NdotL , float NdotV , float alphaG )
{// Original formulation of G_SmithGGX Correlated// lambda_v = (-1 + sqrt ( alphaG2 * (1 - NdotL2 ) / NdotL2 + 1)) * 0.5 f;// lambda_l = (-1 + sqrt ( alphaG2 * (1 - NdotV2 ) / NdotV2 + 1)) * 0.5 f;// G_SmithGGXCorrelated = 1 / (1 + lambda_v + lambda_l );// V_SmithGGXCorrelated = G_SmithGGXCorrelated / (4.0 f * NdotL * NdotV );// This is the optimize versionfloat alphaG2 = alphaG * alphaG ;// Caution : the " NdotL *" and " NdotV *" are explicitely inversed , this is not a mistake .float Lambda_GGXV = NdotL * sqrt ((- NdotV * alphaG2 + NdotV ) * NdotV + alphaG2 );float Lambda_GGXL = NdotV * sqrt ((- NdotL * alphaG2 + NdotL ) * NdotL + alphaG2 );return 0.5 f / ( Lambda_GGXV + Lambda_GGXL );}float D_GGX ( float NdotH , float m){// Divide by PI is apply laterfloat m2 = m * m;float f = ( NdotH * m2 - NdotH ) * NdotH + 1;return m2 / (f * f);}// This code is an example of call of previous functionsfloat NdotV = abs( dot (N, V)) + 1e -5f; // avoid artifactfloat3 H = normalize (V + L);float LdotH = saturate ( dot (L, H));float NdotH = saturate ( dot (N, H));float NdotL = saturate ( dot (N, L));// Specular BRDFfloat3 F = F_Schlick (f0 , f90 , LdotH );float Vis = V_SmithGGXCorrelated (NdotV , NdotL , roughness );float D = D_GGX (NdotH , roughness );float Fr = D * F * Vis / PI;// Diffuse BRDFfloat Fd = Fr_DisneyDiffuse (NdotV , NdotL , LdotH , linearRoughness ) / PI;

Listing 2: BSDF evaluation code.

关于Vis系数的来历,在函数V_SmithGGXCorrelated 中的注释部分已经给出了,考虑到fr的公式,分母除以了4倍的pi,还有ndol,ndov,那么,和公式:


那么将这部分:

那么,则会得到上面的V_SmithGGXCorrelated 中的方法体了。
而且在毛星云的博客中:https://blog.csdn.net/poem_qianmo/article/details/100652463
提到:Frostbite的Lagarde[Lagarde 2014 ]观察到对GGX高度相关的Smith G2(height-correlated Smith G2)具有与镜面微平面BRDF的分母组合时抵消的项, 因此可以简化组合项为:


所以你会发现:

fr的计算,就只除以了pi,原因就是上面已经将分母的4NdotLNdotV,考虑过了。

3.2 material system

3.2.1 material

frostbite is used in a wide variety of games, from sports to racing, from first person shooters to open world games. in order to satisfy the different requriements that these games have, the engine needs to offer flexible controls regarding lighting and material support. in addition, one of the constraints during the move to PBR was to ensure compatibility with our old non-PBR lighting model in order to ease the transition. the lighting path is controllable, supporting: deferred, forward, or hybrid. this path will be detailed in section 4.11.

In Frostbite a “material” is defined by:
1) A lighting path: deferred, forward or both.
A set of input parameters: diuse, smoothness, thickness, etc.
A material model: rough surface, translucency, skin, hair, etc., as well as non-PBR rough
surface. This is the shader code.
A GBuffer layout in case of deferred path support. The number of buffers is variable.

a game team can choose a set of materials from those available for a given light path. each material is identified with a materialD attribute for the game. a base material covering the most common cases (which we call the “standard material”) is always present and defines parameters shared with other material (e.g. roughness). for deferred shading the base material is commonly set to the “Disney” model, referring to Burley’s model [Bur12]. however, we also support two other base material: a “two-color” material and an “old” material.

Disney base material: our disney material uses the following parameters:
normal: standard normals
basecolor: defines the diffuse albedo for non-metallic objects and Fresnel reflectance at normal incidence (f0) for metallic ones, as suggested by Burley’s presentation. for metallic objects the lower part of this attribute defines a micro-specular occlusion.

Moving Frostbite to Physically Based Rendering 3.0相关推荐

  1. Article - Physically Based Rendering

    http://www.codinglabs.net/article_physically_based_rendering.aspx Radiance 辐射率--用L表示 Irradiance 辐照度 ...

  2. AMD Cubemapgen for physically based rendering

    JUNE 10, 2012 57 COMMENTS Version : 1.67 – Living blog – First version was 4 September 2011 AMD Cube ...

  3. opengl-PBR基于物理的渲染(Physically Based Rendering):理论基础

    PBR文档链接 PBR-learnOpengl官方文档 理论基础 PBR概念 PBR基于物理的渲染(Physically Based Rendering),它指的是一些在不同程度上都基于与现实世界的物 ...

  4. Physically Based Rendering——史上最容易理解的BRDF中D函数NDF的中文资料

    粗糙度决定了D函数的分布,一般粗糙度是D函数的方差 本文假定读者已经对PBR即Physcially Based Rendering 基于物理的渲染有了初步的了解,对于PBR的入门有很多文章都介绍的不错 ...

  5. PBR (Physically Based Rendering)概念篇

    一.PBR是什么? Physically Based Rendering:基于物理的渲染 PBR:是一套框架,通过PBR保证整体的色调以及画面的统一 什么是基于物理渲染? 对现实世界中的一种近似,而不 ...

  6. Physically Based Rendering,PBRT(光线跟踪:基于物理的渲染) 笔记

     提起PBRT(Physically Based Rendering: From Theory to Implementation)这本书, 在图形学业界可是鼎鼎大名, 该书获得2005年软件界J ...

  7. Physically Based Rendering阅读

    关于3D渲染方面很好的一本书. 下面是它的官网, http://www.pbrt.org/index.html 以下是详细记录阅读的笔记,习题也需要做. 书本上的例子在 https://github. ...

  8. Learn OpenGL 笔记7.1 PBR Theory(physically based rendering基于物理的渲染 理论)

    PBR,或更通常称为基于物理的渲染,是一组渲染技术,它们或多或少基于与物理世界更接近的相同基础理论.由于基于物理的渲染旨在以物理上合理的方式模拟光线,因此与我们的原始光照算法(如 Phong 和 Bl ...

  9. 【《Unity 2018 Shaders and Effects Cookbook》翻译提炼】(九)Physically - Based Rendering

    制作过程中最重要的方面时效率,实时着色很昂贵,而Lambertian或BlinnPhong等技术是计算成本和现实之间的折中. 拥有更   强大的GPU允许我们逐步写更强大的光照模型和渲染引擎,目的是模 ...

最新文章

  1. 快速排序实现以及时间复杂度分析
  2. anaconda换成制定清华的源:一键解决外网下载慢的烦恼
  3. 【图像处理面试题】——1
  4. PHP Token(令牌)设计
  5. 【渝粤教育】广东开放大学 大学英语1 形成性考核 (43)
  6. python turtle 怎么设计背景颜色_Python, turtle海龟作图,如何添加背景图片?
  7. [CentOS7] - CentOS7设置开机启动
  8. 分布式事务实践 解决数据一致性 分布式事务实现,模式和技术
  9. googlehelper手机版ios_nba2K17中文手机版下载_nba2K17官方中文IOS手机版V1.07下载
  10. 如何在苹果Mac上的分屏浏览视图中使用 App?
  11. C#使用Minidump导出内存快照Minidumper
  12. 塑料管检测内容有那些
  13. linux 电驴,开源电驴 MLDonkey 3.0.7 发布
  14. java 异常 ppt_Java程序设计基础与实践 第6章 异常处理.ppt
  15. PCB板的绘制原来是这样完成的——布线
  16. 英特尔第十代处理器为什么不支持win7_Intel的7代酷睿CPU可以安装Win7系统吗?能不能完美支持呢?为什么有人说不能使用Win7系统...
  17. Day 7(云计算-zsn)
  18. 【Postman】Postman的请求方式
  19. Linux内核中喂狗,m3352linux内核中看门狗喂狗和应用层喂狗方法
  20. RC专题:阻容串并联电路

热门文章

  1. cocos2d-js(一)引擎的工作原理和文件的调用顺序
  2. vue element-ui 暗黑主题应用到若依框架
  3. Android 崩溃优化之Java篇(二)
  4. 95、民用建筑的耐火等级
  5. 华为nova3 计算机,荣耀v10与华为nova3区别对比
  6. gitee配置SSH公钥
  7. 组织过程资产和事业环境因素的区别
  8. python复制excel到另一个excel_Python自动化办公Excel-从表中批量复制粘贴数据到新表...
  9. 当老外骂你时,你就这样...
  10. 8月第3周业务风控关注 |广电总局对快手抖音等警告罚款