Utility/MaterialData: Add Material name information
Former-commit-id: f680fd0d6e8c4a10a44ee8393e6b08e164fceabf [formerly b906d2ed5d98ee0bc0199f71d4955a93c18657f7] Former-commit-id: 50620f9c773ecadec81a257b9c3ad280a97f0c24
This commit is contained in:
parent
63ac80c7ff
commit
cc49b559c3
|
|
@ -41,6 +41,7 @@ namespace Nz
|
|||
static constexpr const char* HeightTexturePath = "MatHeightTexturePath";
|
||||
static constexpr const char* Lighting = "MatLighting";
|
||||
static constexpr const char* LineWidth = "MatLineWidth";
|
||||
static constexpr const char* Name = "MatName";
|
||||
static constexpr const char* NormalTexturePath = "MatNormalTexturePath";
|
||||
static constexpr const char* PointSize = "MatPointSize";
|
||||
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_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;
|
||||
if (aiGetMaterialInteger(aiMat, AI_MATKEY_TWOSIDED, &iValue))
|
||||
matData.SetParameter(MaterialData::FaceCulling, !iValue);
|
||||
|
|
|
|||
Loading…
Reference in New Issue