Skip to content

Instantly share code, notes, and snippets.

@dev-chee
Last active November 7, 2017 12:40
Show Gist options
  • Save dev-chee/080e1af9476ea9a08dcc0c84fdd6457c to your computer and use it in GitHub Desktop.
Save dev-chee/080e1af9476ea9a08dcc0c84fdd6457c to your computer and use it in GitHub Desktop.
PBR BRDF
$$Light Vector: \$l\$, View Vector: \$v\$ Halfway Vector: \$h=\frac{l+v}{\|l+v\|}\$ Radient Flux: \$\Phi\$, Radiance: \$L=\frac{\mathrm{d^2}\Phi}{\mathrm{d}A\mathrm{d}\omega\cos{\theta}}\$ Irradiance: \$E_i(\omega_{i})\$, Radiance: \$L_o(\omega_{o})\$ BRDF: \$f_{r}(\omega_{i},\omega_{o})=\frac{\mathrm{d}L_o(\omega_{o})}{\mathrm{d}E_i(\omega_{i})}=\frac{\mathrm{d}L_o(\omega_o)}{L_i(\omega_i)\cos\theta_i\mathrm{d}\omega_i}\$ Reflectance Equation: \$\$L_o(p,w_o)=\int\limits_\Omega\!f_{r}(p,\omega_{i},\omega_{o})L_{i}(p,\omega_{i})n\cdot{\omega_{i}}\mathrm{d}\omega{_i}\$\$ Cook-Torrance BRDF: \$\$f_r=k_df_{lambert}+k_sf_{cook-torrance}\$\$ \$\$f_{lambert}=\frac{c}{\pi}\$\$ \$\$f_{cook-torrance}=\frac{DFG}{4(\omega_o\cdot{n})(\omega_i\cdot{n})}\$\$ \$\$NDF_{GGXTR}(n,h,\alpha)=\frac{\alpha^2}{\pi((n\cdot{h})^2(\alpha^2-1)+1)^2}\$\$ \$\$G_{SchlickGGX}(n,v,k)=\frac{n\cdot{v}}{(n\cdot{v})(1-k)+k}\$\$ \$\$k_{direct}=\frac{(\alpha+1)^2}{8}\$\$ \$\$k_{IBL}=\frac{\alpha^2}{2}\$\$ \$\$G(n,v,l,k)=G_{sub}(n,v,k)G_{sub}(n,l,k)\$\$ \$\$F_{Schlick}(n,v,F_{0}) = F_{0} + (1 - F_{0})(1 - (n\cdot{v}))^5\$\$ Cook-Torrance Reflectance Equation \$\$L_o(p,w_o)=\$\$ \$\$\int_\limits{\Omega}(k_d\frac{c}{\pi}+k_s\frac{DFG}{4(\omega_o\cdot{n})(\omega_i\cdot{n})})L_i(p,w_i)n\cdot{\omega_i}\mathrm{d}\omega_i\$\$ Desney Diffuse Model: \$\$f_d=\frac{K_d}{\pi}(1+(F_{D90}-1)(1-\cos\theta_l)^5)(1+(F_{D90}-1)(1-\cos\theta_v)^5\$\$$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment