$$
L_o(p, \omega_o) = L_e(p, w_o) + \int_{\Omega}f(p, \omega_i\rightarrow\omega_o)L_i(p, \omega_i)\cos\theta\mathrm{d}\omega_i
$$
Multithread RayTracer(Cook-Torrance BRDF model, metallic workflow) implemented by C++.
The basic code frame comes from GAMES101.2020 Assignment7.
- Cook-Torrance BRDF model
- metallic workflow(material can be adjusted by [albedo, roughness, metallic], I've defined three materials(copper, silver, gold) in main.cpp as example)
- importance sampling microfacet-based BSDF for GGX NDF(normal distribution function)
- speed up intersection detection of triangle mesh with BVH
- implement anti-aliasing by create random ray inside one pixel.(not by filter)
spp16 |
spp32 |
|
|
spp128 |
spp512 |
|
|
spp512 rough metal |
spp512 marble floor |
|
|
- SOLVED
Rarely there will be particularly bright noise pointer, I think it's caused by dividing very small float(some pdf could be), maybe just spp is not high enough or algorithm's limitation?
- random number generation is very expensive
- the implementation of Multi-threading needs to be improved(divide into blocks)
- the code is untidy and needs cleaning
- support common types of textures(normal map, albedo/roughness/metallic map..)
- support transparent/anisotropic materials
- please run the program in release mode, make sure you are not in debug mode when testing your high spp result(otherwise it will be a disaster).
- It takes about 270 seconds to complete the rendering(mingw-w64/gcc) when spp=512 with cpu i7-9750H(2.60GHz,6c12t)