added import of material properties (double sided and transparency) in glTF 1.0 importer.
parent
d33cc8ac5a
commit
978c156c2a
|
@ -193,9 +193,16 @@ void glTFImporter::ImportMaterials(glTF::Asset& r)
|
|||
aimat->AddProperty(&str, AI_MATKEY_NAME);
|
||||
}
|
||||
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.diffuse, aimat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE);
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.ambient, aimat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT );
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.diffuse, aimat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE );
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.specular, aimat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR);
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.ambient, aimat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT);
|
||||
SetMaterialColorProperty(embeddedTexIdxs, r, mat.emission, aimat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE);
|
||||
|
||||
aimat->AddProperty(&mat.doubleSided, 1, AI_MATKEY_TWOSIDED);
|
||||
|
||||
if (mat.transparent && (mat.transparency != 1.0f)) {
|
||||
aimat->AddProperty(&mat.transparency, 1, AI_MATKEY_OPACITY);
|
||||
}
|
||||
|
||||
if (mat.shininess > 0.f) {
|
||||
aimat->AddProperty(&mat.shininess, 1, AI_MATKEY_SHININESS);
|
||||
|
|
Loading…
Reference in New Issue