Since I got into game development, I discovered some very engaging new challenges and technologies that got me inspired to dive deeper into already familiar topics. One of these topics was Monte Carlo pathtracing and the microfacet theory.
I am not a programmer, but I do have some base coding knowledge that I've flexed on and off during my VFX career. I spent a bit of time getting up to speed with GLSL, and after doing a few practice shaders I set a lofty goal of writing a pathtraced Cornell Box from scratch.
I dissected and implemented a microfacet BRDF based on the Disney Principled BRDF model. I experimented with a subsurface scattering approximation implementation, as well as some refraction and caustics.
While this is just a work in progress or a "sketch" if you will, it allowed me to gain a far deeper understanding of techniques and theories that I am familiar with from years in VFX. This exercise generated many more questions, and made me appreciate how much i truly still don't know.
Here is the link to the full Shadertoy code. Peruse at your own risk :)
A few images generated by the code, after converging to a fairly clean result.
![](https://static.wixstatic.com/media/b6cadf_db8e627f383b4339b987be844167758f~mv2.png/v1/fill/w_980,h_552,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/b6cadf_db8e627f383b4339b987be844167758f~mv2.png)
![](https://static.wixstatic.com/media/b6cadf_bd72b46bae34456c9ad6b527ed99ad7a~mv2.jpg/v1/fill/w_980,h_550,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/b6cadf_bd72b46bae34456c9ad6b527ed99ad7a~mv2.jpg)
![](https://static.wixstatic.com/media/b6cadf_475400d03a0241dea67aa4269ddc4968~mv2.jpg/v1/fill/w_980,h_550,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/b6cadf_475400d03a0241dea67aa4269ddc4968~mv2.jpg)
Commentaires