COLLADA: Add support for <reflectivity> elements. This maps to AI_MATKEY_REFLECTIVITY.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@504 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
f85d7b63ef
commit
46809f0dfa
|
@ -493,7 +493,7 @@ struct Effect
|
||||||
mTexTransparent, mTexBump, mTexReflective;
|
mTexTransparent, mTexBump, mTexReflective;
|
||||||
|
|
||||||
// Scalar factory
|
// Scalar factory
|
||||||
float mShininess, mRefractIndex;
|
float mShininess, mRefractIndex, mReflectivity;
|
||||||
float mTransparency;
|
float mTransparency;
|
||||||
|
|
||||||
// local params referring to each other by their SID
|
// local params referring to each other by their SID
|
||||||
|
@ -518,6 +518,7 @@ struct Effect
|
||||||
, mDoubleSided (false)
|
, mDoubleSided (false)
|
||||||
, mWireframe (false)
|
, mWireframe (false)
|
||||||
, mFaceted (false)
|
, mFaceted (false)
|
||||||
|
, mReflectivity (1.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1147,6 +1147,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* pScene
|
||||||
|
|
||||||
// scalar properties
|
// scalar properties
|
||||||
mat.AddProperty( &effect.mShininess, 1, AI_MATKEY_SHININESS);
|
mat.AddProperty( &effect.mShininess, 1, AI_MATKEY_SHININESS);
|
||||||
|
mat.AddProperty( &effect.mReflectivity, 1, AI_MATKEY_REFLECTIVITY);
|
||||||
mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
|
mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
|
||||||
|
|
||||||
// transparency, a very hard one. seemingly not all files are following the
|
// transparency, a very hard one. seemingly not all files are following the
|
||||||
|
|
|
@ -1135,6 +1135,8 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
|
||||||
}
|
}
|
||||||
else if( IsElement( "shininess"))
|
else if( IsElement( "shininess"))
|
||||||
ReadEffectFloat( pEffect.mShininess);
|
ReadEffectFloat( pEffect.mShininess);
|
||||||
|
else if( IsElement( "reflectivity"))
|
||||||
|
ReadEffectFloat( pEffect.mReflectivity);
|
||||||
|
|
||||||
/* Single scalar properties */
|
/* Single scalar properties */
|
||||||
else if( IsElement( "transparency"))
|
else if( IsElement( "transparency"))
|
||||||
|
|
|
@ -754,6 +754,7 @@ extern "C" {
|
||||||
#define AI_MATKEY_OPACITY "$mat.opacity",0,0
|
#define AI_MATKEY_OPACITY "$mat.opacity",0,0
|
||||||
#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
|
#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
|
||||||
#define AI_MATKEY_SHININESS "$mat.shininess",0,0
|
#define AI_MATKEY_SHININESS "$mat.shininess",0,0
|
||||||
|
#define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
|
||||||
#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
|
#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
|
||||||
#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
|
#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
|
||||||
#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
|
#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
|
||||||
|
|
Loading…
Reference in New Issue