yuphin / Lumen

A Vulkan Raytracing framework for various bidirectional path tracing techniques
MIT License
449 stars 29 forks source link

Unknown constant #18

Closed tigrazone closed 9 months ago

tigrazone commented 9 months ago

Hello. I readed sources and I understand const float cos_width = cos(PI / 6); const float cos_faloff = cos(25 PI / 180); And PI / 6 is 30 PI / 180 and 30 and 25 is hardcoded angles of light. Is this correct? But I dont understand what is https://github.com/yuphin/Lumen/blob/051b10f15dc0c2e2561a8eb8d1b7d5febe252197/src/shaders/bsdf_commons.glsl#L102 ?

yuphin commented 9 months ago

The constants are from the paper An Anisotropic Phong Light Reflection Model by Ashikhmin and Shirley. It's quite an outdated model by today's standards and it's also the same model that is used to implement the FresnelBlend BSDF in PBRT-v3.

Related PBRT-v3 link: https://www.pbr-book.org/3ed-2018/Reflection_Models/Fresnel_Incidence_Effects