- Collada dae-loader now set's the vertex colors (thx @sf17k for report and test-models)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4727 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-03-15 21:08:54 +00:00
parent 0dbead2597
commit 008f14bcdf
3 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Collada dae-loader now set's the vertex colors (thx @sf17k for report and test-models)
- IAttributes interface changed. Parameters are now passed by const-ref instead of per value.
- Fix c::b project obj folder names. Some static builds had used the shared folders (thx @ gerdb for reporting)
- Add ITexture::getSource which can be used to check where the last IVideoDriver::getTexture call found the texture.

View File

@ -124,7 +124,7 @@ namespace
const core::stringc profileCOMMONAttributeName = "COMMON";
const char* const inputSemanticNames[] = {"POSITION", "VERTEX", "NORMAL", "TEXCOORD",
"UV", "TANGENT", "IMAGE", "TEXTURE", 0};
"UV", "TANGENT", "IMAGE", "TEXTURE", "COLOR", 0};
// We have to read ambient lights like other light types here, so we need a type for it
const video::E_LIGHT_TYPE ELT_AMBIENT = video::E_LIGHT_TYPE(video::ELT_COUNT+1);
@ -2192,6 +2192,15 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
break;
case ECIS_TANGENT:
break;
case ECIS_COLOR:
{
video::SColorf col;
col.r = localInputs[k].Data[idx+0];
col.g = localInputs[k].Data[idx+1];
col.b = localInputs[k].Data[idx+2];
vtx.Color = col.toSColor();
break;
}
default:
break;
}
@ -2326,6 +2335,15 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
break;
case ECIS_TANGENT:
break;
case ECIS_COLOR:
{
video::SColorf col;
col.r = localInputs[k].Data[idx+0];
col.g = localInputs[k].Data[idx+1];
col.b = localInputs[k].Data[idx+2];
vtx.Color = col.toSColor();
break;
}
default:
break;
}

View File

@ -76,6 +76,7 @@ enum ECOLLADA_INPUT_SEMANTIC
ECIS_TANGENT,
ECIS_IMAGE,
ECIS_TEXTURE,
ECIS_COLOR,
ECIS_COUNT
};