Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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[0], diffuse[1], diffuse[2]]
 material.alpha = diffuse[3]

 ambient:
 material.mirror_color = [ambient[0], ambient[1],ambient[2]]
 material.ambient = ambient[3]

 specular:
 material.specular_color = [specular[0], specular[1], specular[2]]
 # 4th value (alpha) not used in Blender?

 emissive:
 material.emit = emissive[3]
 # only one value?

 shininess:
 material.specular_hardness = (int(shininess)) # in Blender a float is expected, is this enough?
share|improve this question
The entry for materials in the current (2.63) python api of blender can be found here: blender.org/documentation/blender_python_api_2_63_2/… – sarahm Aug 4 '12 at 17:15

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.