0
$\begingroup$

I am loading an OBJ file using the ASSIMP library. Following is the MTL file associated with the obj file.

newmtl initialShadingGroup
Kd 0.50 0.50 0.50
Ka 0.09 0.09 0.09
Tf 1.00 1.00 1.00
Ns 10.0
map_Ka sphere_roughness.jpg
map_Kd sphere_albedo.jpg
map_Ks sphere_metallic.jpg
bump sphere_normal.jpg
disp sphere_bump.jpg
illum 7

I want to read the illum value so that I can choose an appropriate sharding model in my shaders. The code I'm using is

int shadingModel;
material->Get(AI_MATKEY_SHADING_MODEL, shadingModel);
std::cout << "ShadingModel: " << shadingModel<< std::endl;

But the output I'm getting is

ShadingModel: 2

when the value is 7. Is there something that I'm doing it wrong or is it the wrong way to retrieve the shading model. Thanks for your help!

$\endgroup$
  • $\begingroup$ AI_MATKEY_SHADING_MODEL is going to return the shading model type (e.g. flat shading/smooth shading). I don't think there is a "Illum" defined in AssImps material definitions, but there is AI_MATKEY_COLOR_EMISSIVE. You should check if that key is filled, maybe the MTL Illum data is loaded into the emmisive colour, at a guess.. $\endgroup$ – PaulHK Apr 16 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.