Utility/MaterialData: Add Material name information
Former-commit-id: ac5a76bc840c2a826af196a9c55c4c390b17770b [formerly 74fa853856dc4720d97b4f66b60dda49d81047a9] Former-commit-id: 83bc618ad6cb7ee4fe420d8acffe496cd3157742
This commit is contained in:
parent
b0c4bcff67
commit
eadd21c52a
|
|
@ -41,6 +41,7 @@ namespace Nz
|
||||||
static constexpr const char* HeightTexturePath = "MatHeightTexturePath";
|
static constexpr const char* HeightTexturePath = "MatHeightTexturePath";
|
||||||
static constexpr const char* Lighting = "MatLighting";
|
static constexpr const char* Lighting = "MatLighting";
|
||||||
static constexpr const char* LineWidth = "MatLineWidth";
|
static constexpr const char* LineWidth = "MatLineWidth";
|
||||||
|
static constexpr const char* Name = "MatName";
|
||||||
static constexpr const char* NormalTexturePath = "MatNormalTexturePath";
|
static constexpr const char* NormalTexturePath = "MatNormalTexturePath";
|
||||||
static constexpr const char* PointSize = "MatPointSize";
|
static constexpr const char* PointSize = "MatPointSize";
|
||||||
static constexpr const char* ScissorTest = "MatScissorTest";
|
static constexpr const char* ScissorTest = "MatScissorTest";
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,10 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||||
ConvertTexture(aiTextureType_OPACITY, MaterialData::AlphaTexturePath);
|
ConvertTexture(aiTextureType_OPACITY, MaterialData::AlphaTexturePath);
|
||||||
ConvertTexture(aiTextureType_SPECULAR, MaterialData::SpecularTexturePath, MaterialData::SpecularWrap);
|
ConvertTexture(aiTextureType_SPECULAR, MaterialData::SpecularTexturePath, MaterialData::SpecularWrap);
|
||||||
|
|
||||||
|
aiString name;
|
||||||
|
if (aiGetMaterialString(aiMat, AI_MATKEY_NAME, &name) == aiReturn_SUCCESS)
|
||||||
|
matData.SetParameter(MaterialData::Name, String(name.data, name.length));
|
||||||
|
|
||||||
int iValue;
|
int iValue;
|
||||||
if (aiGetMaterialInteger(aiMat, AI_MATKEY_TWOSIDED, &iValue))
|
if (aiGetMaterialInteger(aiMat, AI_MATKEY_TWOSIDED, &iValue))
|
||||||
matData.SetParameter(MaterialData::FaceCulling, !iValue);
|
matData.SetParameter(MaterialData::FaceCulling, !iValue);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue