【发布时间】:2014-12-26 07:50:02
【问题描述】:
我在我的 Ogre 程序中加载了一个实体。然后在 vertexDeclaration 中列出 Elements,如下所示。
Ogre::VertexDeclaration::VertexElementList lst = vertex_data->vertexDeclaration->getElements();
在列表中,我只看到了 VES_POSITION 和 VES_NORMAL。因此,当我运行以下代码时,
const Ogre::VertexElement* posElem = vertex_data->vertexDeclaration->findElementBySemantic(Ogre::VES_DIFFUSE);
posElem 不包含任何内容或为空。如何访问这种不存在的元素?有可能吗?然后我在我的实体中添加了如下材料。这次模型成功加载了材质和漫反射属性。但问题仍然存在。这意味着 VertexDeclaration 不包含具有 VES_DEFFUSE 语义的元素(仅 VES_POSITION 和 VES_NORMAL)。我还加载了一些其他模型,但它们都没有具有 VES_DEFFUSE 语义的元素。
material base_mesh
{
technique
{
pass
{
lighting on
ambient 0.3 0.3 0.3 1
diffuse 0.1 0.7 0.2 1
emissive 0 0 0 1
}
}
}
【问题讨论】:
-
如果网格没有特定属性 - 为什么它会出现在运行时?您的网格数据和具体问题是什么?