I'm writing an importer for a format with standard DirectX materials. The material values are:
diffuse - r,g,b,a (floats) ambient - r,g,b,a (floats) specular - r,g,b,a (floats) emissive - r,g,b,a (floats) shininess - value (integer)
I think its the same for OpenGL.
I understand that Blender is not a realtime 3d engine, so the material values aren't limited to these and might not be named the same way. But what is the “correct” mapping? What I have currently is just an educated guess:
diffuse: material.diffuse_color = [diffuse, diffuse, diffuse] material.alpha = diffuse ambient: material.mirror_color = [ambient, ambient,ambient] material.ambient = ambient specular: material.specular_color = [specular, specular, specular] # 4th value (alpha) not used in Blender? emissive: material.emit = emissive # only one value? shininess: material.specular_hardness = (int(shininess)) # in Blender a float is expected, is this enough?