I need help creating the Principled BSDF node from other Blender nodes

I’m attempting to re-create the Principled BSDF node using other Blender nodes, specifically for Cycles.

I started by looking at the Principled BSDF OSL file (linked below). I read the code and started constructing a node tree based on that using math nodes and shaders, making small corrections where needed.

Link to the Principled BSDF OSL: node_principled_bsdf.osl · rB

However, I’ve encountered an issue. When adding the specular component to the Prinicpled BSDF, the OSL file uses this:

BSDF = BSDF + specular_weight * microfacet_ggx_aniso_fresnel(...) //This is simplified to make it smaller 

I can not figure out how to recreate this part in nodes.
specular_weight is easy to calculate. It’s here:
But I can’t seem to figure out how to recreate microfacet_ggx_aniso_fresnel(). And so I’ve come here to ask for help.

Is anyone able to help by showing me a node setup that can recreate this shader?

1 Like

I have done some further investigation and it seems it isn’t possible to create the principled BSDF from other nodes unless new nodes are added.

On the plus side, the reason I wanted to create the Principled BSDF out of other nodes can be achieved by using multiple Principled BSDFs with add shaders and certain parameters tweaked.