qdtk / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

add refractive microfacet closures #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add a version of microfacet_beckmann/microfacet_ggx that performs refraction as 
well.

12/22/09 10:39:23 changed by ckulla 

My current plan is to add:

microfacet_ggx_refraction()
microfacet_beckmann_refraction()
Both will take the same arguments as the existing reflective closure.

We could make a dielectric version of these closures too, that would ensure 
that reflection and 
refraction get the proper balance. This is how the model is described in Bruce 
Walter's paper. 
However - the sampling becomes a bit tricky: you have to generate a microfacet 
normal, and 
then choose between reflection and refraction based on the fresnel coefficient 
implied by that 
normal. This means that you need 3 random numbers for sampling instead of 2, 
which is not 
currently available in our setup.

Another side note: these will be glossy transmissive closures, and therefore be 
included in light 
loops. For objects with thickness (ie: not modeled as a single plane), this 
means lots of shadow 
rays will be traced for nothing (as they will almost all intersect the other 
side of the object). We 
may need more hacks in the integrator to cut these out.

12/22/09 17:38:15 changed by ckulla 

I suspect that what will be most useful is microfacet_*_dielectric(). And 
really, since there are so 
many shared terms, we could probably get away with just adding a new flag like 
this:

   microfacet_ggx(N, roughness, ior, "transmissive", 1);
The presence of this flag (set to a non-zero value) would enable glossy 
transmission, otherwise 
you would just get the reflection part (as you do now).

12/22/09 17:46:07 changed by aconty 

I understand that with the "transmissive" flag you would get both reflection 
and transmission. 
Right?

12/22/09 17:46:53 changed by ckulla 

Correct.

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 7:13

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Going to add microfacet_ggx_refraction() and microfacet_beckmann_refraction().

Original comment by cku...@gmail.com on 21 Jan 2010 at 1:02

GoogleCodeExporter commented 9 years ago
Fixed in r540.

Original comment by cku...@gmail.com on 22 Jan 2010 at 9:53