BRDF

  • Bidirectional reflectance distribution function

BRDF Texture

  • BRDF Fake라고도 함.

BRDF_dir.jpg

half u = dot(L, N) * 0.5 + 0.5;
half v = dot(V, N);

half3 brdfTex = SAMPLE_TEXTURE2D(_BrdfTex, sampler_BrdfTex, half2(u, v)).rgb;

TODO - Ambient BRDF

  • Gotanda 2010
xdot(V, N)
yShininess

TODO - Environment IBL Map

  • Schlick's approximation // fresnel
  • Lazarov 2013
xdot(V, N) // cosθv
yRoughness

DFG LUT

DFG
DDistrubution
FFresnel
GGeometry

Color c = diffuse * intensity + fresnelReflectionColor * fresnelTerm + translucentColor * t + Color(0, 0 ,0, specular);
c *= intensity;
half u = dot(L, N) * 0.5 + 0.5;
half v = dot(H, N);

half3 brdfTex = SAMPLE_TEXTURE2D(_BrdfTex, sampler_BrdfTex, half2(u, v)).rgb;
half3 color = albedo * (brdfTex.rgb + gloss * brdfTex.a) * 2;
//   +--- B ---+    A : 빛과 마주치는 면
//   |         |    B : 빛과 반대방향의 면
//   D         C    C : 카메라와 마주치는 면
//   |         |    D : 카메라와 90도 되는 면
//   +--- A ---+ 

OffsetU // [-1, 1]
OffsetV // [-1, 1]

half2 brdfUV = float2(saturate(NdotV + OffsetU), saturate((LdotN + 1) * 0.5) + OffsetV);
brdfUV.y = 1 - brdfUV.y;
half3 brdfTex = tex2D(BRDFSampler, brdfUV).rgb;

half3 color = ambient + brdfTex;

Ref