-
Notifications
You must be signed in to change notification settings - Fork 0
/
MIS.txt
23 lines (19 loc) · 812 Bytes
/
MIS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
After we do hit checking, get a hitObj, and add emission to L.
Handle the very special case: Mirror
We don't consider light in the scene at all.
We don't do any sample direction either.
We have a determinsitic mirror_reflection ray
do recursion
flip a coin to decide BRDF sample (get a direction) or light sample (get a position from the light)
***** if BRDF:
get a sample_dir (w_o), could be directly or indirectly (from half-vector h)
***** if light:
uniformly choose a light source (each with Probability 1/n)
sample a position on the light
turn this position into sample_dir
**********
compute BRDF, the f_r
compute pdf_BRDF
compute pdf_light, remember to include the Jacobian
blended_pdf = their average
call recursion: return L_emmision + BRDF * (1 / blended_pdf) * f_radiance(......);