I'm trying to build a toy path tracer using something similar to Disney's BSDF, where many materials can be represented as combinations of properties like color, metalness, roughness, transmission, ior.
I'd like to use the GGX microfacet BSDF, but without splitting the ray each time to get & sum the Fr and Ft terms for reflection and transmission. Is it normal/ok to use schlick's approximation to randomly choose between transmission and reflection (Ft vs Fr), and then to just use the BRDF and BTDF formulas separately depending on which path the system chooses?
For example, roughly:
On hit (into)
- Reflect or Transmit via Schlick(i, o, n)
- Reflect:
- Direct (N times):
- Choose point on disc of random light
- Calc transmission t via BRDF(i, o, n)
- Calc pdf by area of cone / area of hemisphere
- Add light * t / pdf
- Indirect (1 time):
- Choose direction o by BRDF.Sample(i, n)
- Calc transmission t via BRDF(i, o, n)
- Calc pdf by BRDF.PDF(i, o, n) ??
- Add trace(o) * t / pdf
- Transmit:
- Choose direction o by snell(i, n) + some kind of roughness * offset
- (how do you apply the BTDF here? Or is it important?)
On hit (out of)
- Choose direction o by snell(i, n) + some kind of roughness * offset
- Reduce transmission via beer(distance)
I also wonder how diffused reflections factor in. For instance, does GGX only provide specular reflection & refraction? In that case, how do you also handle diffusion?