BRDF equation description

 The Rendering Equation and BRDFs – jackminnet (home.blog)


L_{o} = L_{e} + \int_\Omega L_{i} \cdot f_{r} \cdot cos\theta_{i}  \, \mathrm{d} \omega_{i}      Eq.1

Lo = radiance output : vector4 (x,y,z,w) : 0~1 data : radiance calculation

Le = emitter BRDF data : one direction only // from center

Li = raidance incomming

cosθ : light fluctuation calculation ( ex difference of perpendicular and slanted photon area )

dω = object area from the center








Cook torrance BRDF

https://prooveyourself.tistory.com/6


https://www.shadertoy.com/view/4ljcWm


https://en.wikibooks.org/wiki/GLSL_Programming/Unity/Brushed_Metal






Faking BRDF



CookTorrance equation


D(h)  : Distribution Function (분포함수)

G (l,v,h) : Geometry term (기하 항) light, viewDir, halfVector

F(l, h) : Fresnel (half vector)



float SchlickFresnel(float4 SpecColor, float3 LightDir, float3 HalfVector)
{
 return SpecColor + (1-SpecColor)*(pow((1 - dot( LightDir, HalfVector )), 5 ));
}

float k = sqr(_Roughness + 1) / 8;





s.Normal = normalize(s.Normal);

float NdotV = saturate(dot(s.Normal, viewDir));
float NdotL = saturate(dot(s.Normal, lightDir));
float NdotH = saturate(dot(s.Normal, halfV));
float NdotV = saturate(dot(s.Normal, viewDir));

float G1(float k, float NdotV)
{
   return NdotV / (NdotV * ( 1  - k ) + k );
}

float g1L = G1(k, NdotL);
float g1V = G1(k, NdotV);
G = g1L * g1V;


NDF : Normal Distribution Function (분포함수)
float alpahSqr = sqr(alpha);
float denominator = sqr(NdotH) * (sqr(alpah) - 1.0f) + 1.0f;
D = alphaSqr / (PI * sqr( denominator ));

NDF : Normal Distribution Function (분포함수)
float alpahSqr = sqr(alpha);
float denominator = sqr(NdotH) * (sqr(alpah) - 1.0f) + 1.0f;
D = alphaSqr / (PI * sqr( denominator ));

Dim MySqr
MySqr = Sqr(4) ' Returns 2.
MySqr = Sqr(23) ' Returns 4.79583152331272.
MySqr = Sqr(0) ' Returns 0.
MySqr = Sqr(-4) ' Generates a run-time error.

Graphics Compendium | Cook-Torrance Reflectance Model


댓글

이 블로그의 인기 게시물

About AActor!!! "UObject" has no member "BeginPlay"

UNREAL Android build information

C++ 생성자 위임 (delegating constructor)