As mentioned in my previous question, I am trying to import/export glTF models in R. The R 3d graphics engine that I'm using (rgl) is really old, and the rendering within R is done using OpenGL 1.x methods: material colors like GL_DIFFUSE, GL_AMBIENT, GL_SPECULAR and GL_EMISSION colors, as well as GL_SHININESS. It also uses WebGL 1 in web output.
I need to translate existing code using these parameters into PBR parameters for output to glTF, and translate glTF PBR parameters into the older model when reading.
Currently I have the following:
baseColorFactorinmaterial.pbrMetallicRoughnessand textures corresponds to the diffuse color.emissiveFactorcorresponds to the emission color.
However, I have no idea how to approximate the other material components in the old style.
I'm hoping this has been done before; can anyone provide formulas for the conversions, or a pointer to a source so I can work them out myself?