material cleanup
This commit is contained in:
@@ -190,8 +190,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st
|
||||
currentMat->refMapName=ss.str();
|
||||
currentMat->refMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str());
|
||||
}
|
||||
if(currentMat->refMap!=0)
|
||||
currentMat->hasRefMap = true;
|
||||
break;
|
||||
case 'n':
|
||||
{
|
||||
@@ -202,8 +200,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st
|
||||
currentMat->normalMapName=ss.str();
|
||||
currentMat->normalMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str());
|
||||
}
|
||||
if(currentMat->normalMap!=0)
|
||||
currentMat->hasNormalMap = true;
|
||||
break;
|
||||
case 't':
|
||||
{
|
||||
@@ -214,8 +210,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st
|
||||
currentMat->textureName=ss.str();
|
||||
currentMat->texture = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str());
|
||||
}
|
||||
if(currentMat->texture!=0)
|
||||
currentMat->hasTexture=true;
|
||||
file>>currentMat->premultipliedTexture;
|
||||
break;
|
||||
case 'D':
|
||||
@@ -227,8 +221,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st
|
||||
currentMat->displacementMapName=ss.str();
|
||||
currentMat->displacementMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str());
|
||||
}
|
||||
if(currentMat->displacementMap!=0)
|
||||
currentMat->hasDisplacementMap=true;
|
||||
break;
|
||||
case 'S':
|
||||
{
|
||||
@@ -239,8 +231,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st
|
||||
currentMat->specularMapName=ss.str();
|
||||
currentMat->specularMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str());
|
||||
}
|
||||
if(currentMat->specularMap!=0)
|
||||
currentMat->hasSpecularMap=true;
|
||||
break;
|
||||
case 'a':
|
||||
file>>currentMat->alpha;
|
||||
|
||||
+5
-16
@@ -98,25 +98,20 @@ struct Material
|
||||
string name;
|
||||
XMFLOAT3 diffuseColor;
|
||||
|
||||
bool hasRefMap;
|
||||
string refMapName;
|
||||
wiGraphicsTypes::Texture2D* refMap;
|
||||
|
||||
bool hasTexture;
|
||||
string textureName;
|
||||
wiGraphicsTypes::Texture2D* texture;
|
||||
bool premultipliedTexture;
|
||||
BLENDMODE blendFlag;
|
||||
|
||||
bool hasNormalMap;
|
||||
string normalMapName;
|
||||
wiGraphicsTypes::Texture2D* normalMap;
|
||||
|
||||
bool hasDisplacementMap;
|
||||
string displacementMapName;
|
||||
wiGraphicsTypes::Texture2D* displacementMap;
|
||||
|
||||
bool hasSpecularMap;
|
||||
string specularMapName;
|
||||
wiGraphicsTypes::Texture2D* specularMap;
|
||||
|
||||
@@ -144,28 +139,22 @@ struct Material
|
||||
name=newName;
|
||||
diffuseColor = XMFLOAT3(1,1,1);
|
||||
|
||||
hasRefMap=false;
|
||||
refMapName="";
|
||||
refMap=0;
|
||||
refMap = nullptr;
|
||||
|
||||
hasTexture=false;
|
||||
textureName="";
|
||||
texture=0;
|
||||
texture = nullptr;
|
||||
premultipliedTexture=false;
|
||||
blendFlag=BLENDMODE::BLENDMODE_ALPHA;
|
||||
|
||||
hasNormalMap=false;
|
||||
normalMapName="";
|
||||
normalMap=0;
|
||||
normalMap = nullptr;
|
||||
|
||||
hasDisplacementMap=false;
|
||||
displacementMapName="";
|
||||
displacementMap=0;
|
||||
displacementMap = nullptr;
|
||||
|
||||
|
||||
hasSpecularMap=false;
|
||||
specularMapName="";
|
||||
specularMap=0;
|
||||
specularMap = nullptr;
|
||||
|
||||
subsurface_scattering=toonshading=water=false;
|
||||
alpha=1.0f;
|
||||
|
||||
Reference in New Issue
Block a user