bgfx implementation is similar to what we did in PBR sky. You can also have a look at https://github.com/pezcode/Cluster/blob/master/src/Renderer/Shaders/pbr.sh. IBL brdf can refer to https://github.com/DiligentGraphics/DiligentFX/blob/1c1a425d114e8f581267f22b0f02b32b2739cbf9/Shaders/PBR/private/PrecomputeBRDF.psh. Then you can define an BRDF type enum to support multiple kinds of BRDF functions to use.