mis nee sah bvh pt (Multiple Importance Sampling, Next Event Estimation, Bounding Volume Hierarchy, Surface Area Heuristic, Pathtracer) please use turbowarp with turbomode https://turbowarp.org/1085231710 press space to render, then while rendering press space again to stop rendering, then press space to denoise (doesn't work in res 2 or above yet) i messed up on mixing specular and diffuse for dielectrics somewhere, i think i fixed it in the new version (which also has metals and RIS) but im prolly not gonna share that cause it's kinda in a hot mess Features ig multiple importance sampling (next event estimation) BVH (top down with SAH) GGX smith for dialectrics (uses vndf for importance sampling) solid angle sampling for sphere lights russian roulette (increases variance, but the performance boost is worth it) power heuristic for MIS obj importing 3 types of materials: lambert, (perfect) mirror, dielectrics (no metals sory) skysphere with bilinear interpolation (to help with aliasing) anti-aliasing with a gaussian approximation filter denoiser (pretty bad but still) R.I.P RIS, I spend too long trying to make you work with MIS some resources: inigo quilez's site for the ray vs sphere and triangle intersection test (scratch doesn't let me link) https://tavianator.com/2011/ray_box.html for the ray-aabb intersection (prolly not the best for scratch but oh well) https://www.pbr-book.org/ lots of cool stuff there https://link.springer.com/chapter/10.1007/978-1-4842-7185-8_20 for MIS https://jacco.ompf2.com/2022/04/13/how-to-build-a-bvh-part-1-basics/ for building top down BVH (with sah) https://jcgt.org/published/0007/04/01/paper.pdf for the VNDF sampling for GGX http://luthuli.cs.uiuc.edu/~daf/courses/Rendering/Papers-2/shirley96monte.pdf solid angle sampling for spheres It's slightly biased cause I added a check for fireflies (even then it's probably still slightly biased somewhere else) thanks to a bunch of people at 3dgas, graphics programming server, and @completeness also I think it's my 2year anniversary on scratch by the time I'm sharing this, crazy #ray #raymadness