Skip to content

Multithread RayTracer(Cook-Torrance BRDF model, metallic workflow) implemented by C++

Notifications You must be signed in to change notification settings

undersilence/MiniRayTracerPBR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniRayTracerPBR

$$ 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.

Features

  • 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)

Results

spp16 spp32
pic1 pic2
spp128 spp512
pic3 pic4
spp512 rough metal spp512 marble floor
pic5 pic6

Bugs

  • 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?

Future work

  • 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

References

Tips

  • 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)

About

Multithread RayTracer(Cook-Torrance BRDF model, metallic workflow) implemented by C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published