使用RampTexture实现BRDF效果

  BRDF stands for bidirectional reflectance distribution function. While that is a mouthful, it simply means the way in which light is reflected off an opaque surface from both the view direction and the light direction.

  BRDF指光从view-direction、light-direction2个方向散射出去。

  首先,需要创建一张适用于BRDF的RampTexture。

  使用RampTexture实现BRDF效果-LMLPHP

  使用如下Shader来完成模拟:

  使用RampTexture实现BRDF效果-LMLPHP

  效果图如下:  

  使用RampTexture实现BRDF效果-LMLPHP

How it works

  The following image shows the dot product of the view direction and the surface normal.

  使用RampTexture实现BRDF效果-LMLPHP

  Since the diffLight calculation and the rimLight calculation both produce a linear range of values from 0 to 1, we can use both the ranges to pick different areas of the ramp texture.

  使用RampTexture实现BRDF效果-LMLPHP

  

  

05-12 08:57