Fix Obj texture parsing error: where obj texture map statement contains texture option, it will fail to parse the correct image url, as a result, the texture won't be shown. Besides, we also add clamp texture mode for obj

This commit is contained in:
gongwei
2013-11-29 10:47:30 +08:00
committed by Gongwei Zhang
parent 08cbc0974b
commit 0860254a2b
4 changed files with 175 additions and 1 deletions

View File

@@ -161,6 +161,19 @@ struct Material
aiString textureSpecularity;
aiString textureOpacity;
aiString textureDisp;
enum TextureType
{
TextureDiffuseType = 0,
TextureSpecularType,
TextureAmbientType,
TextureBumpType,
TextureNormalType,
TextureSpecularityType,
TextureOpacityType,
TextureDispType,
TextureTypeCount
};
bool clamp[TextureTypeCount];
//! Ambient color
aiColor3D ambient;
@@ -186,6 +199,10 @@ struct Material
, ior (1.f)
{
// empty
for (size_t i = 0; i < TextureTypeCount; ++i)
{
clamp[i] = false;
}
}
// Destructor