Commits

dark_sylinc committed fa3d229

Fixed nasty bug in HWInstancingVTF: meshes with more than one blend weight would not remove the original blend weight & indices and create an invalid vertex declaration by adding an invalid extra blend weight. This error was apparent when using skeletally animated meshes with more than 1 blend weight with linear animation (non-dual-quaternion).

  • Participants
  • Parent commits 882784c
  • Branches v1-8

Comments (0)

Files changed (1)

File OgreMain/src/OgreInstanceBatchHW_VTF.cpp

 			else
 			{
 				retrieveBoneIdx( baseVertexData, hwBoneIdx );
-			const VertexElement* pElement = thisVertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_INDICES);
+			}
+
+			const VertexElement* pElement = thisVertexData->vertexDeclaration->findElementBySemantic
+																					(VES_BLEND_INDICES);
 			if (pElement) 
 			{
 				unsigned short skelDataSource = pElement->getSource();
 					thisVertexData->vertexBufferBinding->closeGaps(tmpMap);
 				}
 			}
-			}
 		}
 
 		createVertexTexture( baseSubMesh );
 		if(mWeightCount > 1)
 		{
 			offset += thisVertexData->vertexDeclaration->addElement(newSource, offset, VET_FLOAT4, VES_BLEND_WEIGHTS,
-										thisVertexData->vertexDeclaration->getNextFreeTextureCoordinate() ).getSize();
+										0 ).getSize();
 		}
 		
 		//Create our own vertex buffer