@Secrop i understand.To make things clear,you are talking about implementing the shader to the source code not OSL?
you a talking about some points that need solutions
-thin film tickness roughness
-structural iridescence
-Diffraction gratings
are the main points if im not wrong
diffraction grating could be implemented in the anisotropic BRDF if i read your posting right.
i guess building a new shader for the iriscence is the better way.the reason for this is,if you like to stack more layer,this could not be possible or tougher to implement in the principled shader.
for easy understand.i have posted some UIs from plugins or shader solutions from other renderengines ,see post #211
i think this could be the same way the UI could look,based on the features that become implemented of course.
i think one problems for the thickness roughness would be the scaling,im not sure atm.
the thin film code itself could be easy implemented as you sayed a few post before.maybe the best way is to keep it stupid simple as possible, to make it work first.
i have a idea of 3 shader solutions :
one would be the basic thinfilm code as seen in the other renderengines
second would be the thinfilm code with an option for multiscattering (could be implemented in shader one as well)
third would be a seperate shader for structural iridescence.
the structural shader could be work like a subsurface scattering shader.
for the shader basis i would chosse an glossy brdf shader.on top of it if would implemeting the thinfilm code.all the transmission that goes trough the layer underneath the thinfilm would be simply scattered by the roughness from the glossy code (with custom ior for the mat of course).
the reason to bulid the thinfilm on top of a glossy shader for the strucural iridesence,is to keep the calulation trough the layers if that makes sence.
like in this picture
just some ideas