高光BRDF化简公式总结(转)

:http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html

Specular BRDF Reference

While I worked on our  new shading model for UE4  I tried many different options for our specular BRDF. Specifically, I tried many different terms for to Cook-Torrance microfacet specular BRDF:
f(l,v)=D(h)F(v,h)G(l,v,h)4(nl)(nv)
Directly comparing different terms requires being able to swap them while still using the same input parameters. I thought it might be a useful reference to put these all in one place using the same symbols and same inputs. I will use the same form as Naty [1], so please look there for background and theory. I'd like to keep this as a living reference so if you have useful additions or suggestions let me know.

First let me define alpha that will be used for all following equations using UE4's roughness:
α=roughness2

Normal Distribution Function (NDF)

The NDF, also known as the specular distribution, describes the distribution of microfacets for the surface. It is normalized [12] such that:
ΩD(m)(nm)dωi=1
It is interesting to notice all models have  1πα2  for the normalization factor in the isotropic case.


Blinn-Phong [2]:
DBlinn(m)=1πα2(nm)(2α22)
This is not the common form but follows when  power=2α22 .

Beckmann [3]:
DBeckmann(m)=1πα2(nm)4exp((nm)21α2(nm)2)


GGX (Trowbridge-Reitz) [4]:
DGGX(m)=α2π((nm)2(α21)+1)2


GGX Anisotropic [5]:
DGGXaniso(m)=1παxαy1((xm)2α2x+(ym)2α2y+(nm)2)2



Geometric Shadowing

The geometric shadowing term describes the shadowing from the microfacets. This means ideally it should depend on roughness and the microfacet distribution.

Implicit [1]:
GImplicit(l,v,h)=(nl)(nv)


Neumann [6]:
GNeumann(l,v,h)=(nl)(nv)max(nl,nv)


Cook-Torrance [11]:
GCookTorrance(l,v,h)=min(1,2(nh)(nv)vh,2(nh)(nl)vh)


Kelemen [7]:
GKelemen(l,v,h)=(nl)(nv)(vh)2



Smith

The following geometric shadowing models use Smith's method[8] for their respective NDF. Smith breaks  G  into two components: light and view, and uses the same equation for both:
G(l,v,h)=G1(l)G1(v)
I will define  G1  below for each model and skip duplicating the above equation.


Beckmann [4]:
c=nvα1(nv)2
GBeckmann(v)={3.535c+2.181c21+2.276c+2.577c21if c<1.6if c1.6


Blinn-Phong:
The Smith integral has no closed form solution for Blinn-Phong. Walter [4] suggests using the same equation as Beckmann.


GGX [4]:
GGGX(v)=2(nv)(nv)+α2+(1α2)(nv)2
This is not the common form but is a simple refactor by multiplying by  nvnv .


Schlick-Beckmann:
Schlick [9] approximated the Smith equation for Beckmann. Naty [1] warns that Schlick approximated the wrong version of Smith, so be sure to compare to the Smith version before using.
k=α2π
GSchlick(v)=nv(nv)(1k)+k


Schlick-GGX:
For UE4, I used the Schlick approximation and matched it to the GGX Smith formulation by remapping  k  [10]:
k=α2



Fresnel

The Fresnel function describes the amount of light that reflects from a mirror surface given its index of refraction. Instead of using IOR we instead use the parameter or  F0  which is the reflectance at normal incidence.


None:
FNone(v,h)=F0


Schlick [9]:
FSchlick(v,h)=F0+(1F0)(1(vh))5


Cook-Torrance [11]:
η=1+F01F0
c=vh
g=η2+c21
FCookTorrance(v,h)=12(gcg+c)2(1+((g+c)c1(gc)c+1)2)



Optimize

Be sure to optimize the BRDF shader code as a whole. I choose these forms of the equations to either match the literature or to demonstrate some property. They are not in the optimal form to compute in a pixel shader. For example, grouping Smith GGX with the BRDF denominator we have this:
GGGX(l)GGGX(v)4(nl)(nv)
In optimized HLSL it looks like this:

float a2 = a*a;
float G_V = NoV + sqrt( (NoV - NoV * a2) * NoV + a2 );
float G_L = NoL + sqrt( (NoL - NoL * a2) * NoL + a2 );
return rcp( G_V * G_L );

If you are using this on an older non-scalar GPU you could vectorize it as well.

References

[1] Hoffman 2013,  "Background: Physics and Math of Shading"
[2] Blinn 1977, "Models of light reflection for computer synthesized pictures"
[3] Beckmann 1963, "The scattering of electromagnetic waves from rough surfaces"
[4] Walter et al. 2007,  "Microfacet models for refraction through rough surfaces"
[5] Burley 2012,  "Physically-Based Shading at Disney"
[6] Neumann et al. 1999,  "Compact metallic reflectance models"
[7] Kelemen 2001,  "A microfacet based coupled specular-matte brdf model with importance sampling"
[8] Smith 1967, "Geometrical shadowing of a random rough surface"
[9] Schlick 1994,  "An Inexpensive BRDF Model for Physically-Based Rendering"
[10] Karis 2013,  "Real Shading in Unreal Engine 4"
[11] Cook and Torrance 1982,  "A Reflectance Model for Computer Graphics"
[12] Reed 2013,  "How Is the NDF Really Defined?"
智慧旅游解决方案利用云计算、物联网和移动互联网技术,通过便携终端设备,实现对旅游资源、经济、活动和旅游者信息的智能感知和发布。这种技术的应用旨在提升游客在旅游各个环节的体验,使他们能够轻松获取信息、规划行程、预订票务和安排食宿。智慧旅游平台为旅游管理部门、企业和游客提供服务,包括政策发布、行政管理、景区安全、游客流量统计分析、投诉反馈等。此外,平台还提供广告促销、库存信息、景点介绍、电子门票、社交互动等功能。 智慧旅游的建设规划得到了国家政策的支持,如《国家中长期科技发展规划纲要》和国务院的《关于加快发展旅游业的意见》,这些政策强调了旅游信息服务平台的建设和信息化服务的重要性。随着技术的成熟和政策环境的优化,智慧旅游的时机已经到来。 智慧旅游平台采用SaaS、PaaS和IaaS等云服务模式,提供简化的软件开发、测试和部署环境,实现资源的按需配置和快速部署。这些服务模式支持旅游企业、消费者和管理部门开发高性能、高可扩展的应用服务。平台还整合了旅游信息资源,提供了丰富的旅游产品创意平台和统一的旅游综合信息库。 智慧旅游融合应用面向游客和景区景点主管机构,提供无线城市门户、智能导游、智能门票及优惠券、景区综合安防、车辆及停车场管理等服务。这些应用通过物联网和云计算技术,实现了旅游服务的智能化、个性化和协同化,提高了旅游服务的自由度和信息共享的动态性。 智慧旅游的发展标志着旅游信息化建设的智能化和应用多样化趋势,多种技术和应用交叉渗透至旅游行业的各个方面,预示着全面的智慧旅游时代已经到来。智慧旅游不仅提升了游客的旅游体验,也为旅游管理和服务提供了高效的技术支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值