Skip to content

Specular BRDF equation and the shader code #8448

Closed Answered by show50726
Ulalinowykaj asked this question in Q&A
Discussion options

You must be logged in to vote

You can refer to Normal distribution function (specular D).

Look at (10), we rewrite $G$ into a newly introduced visibility function $V$, which absorbs the $4(n\cdot v)(n\cdot l)$ term:

$$V(v,l,\alpha) = \frac{G(v, l, \alpha)}{4 (n\cdot v) (n\cdot l)} = V_1(l,\alpha) V_1(v,\alpha)$$

Then we can rewrite the original BRDF $f_r$ into

$$f_r(v,l) = D(h, \alpha) V(v, l, \alpha) F(v, h, f_0)$$

And after further taking the height of the microfacets into account, the formula will eventually become

$$V(v,l,\alpha) = \frac{0.5}{n \cdot l \sqrt{(n \cdot v)^2 (1 - \alpha^2) + \alpha^2} + n\cdot v \sqrt{(n \cdot l)^2 (1 - \alpha^2) + \alpha^2}}$$

You can refer to surface_brdf.fs for the implementation …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Ulalinowykaj
Comment options

Answer selected by Ulalinowykaj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants