I don't have this problem with other maps, but what to think ? Is there a vertex count limit for the maps concerning the shadows ??
For information: the map was running well without the shadows, the GENERIC scene manager is used, and the number of polygons that 3dsmax's polygon counter display is 82450 triangles or 39839 polygons.
Thank you for any help !
Last edited by Reverse on Mon Apr 23, 2007 7:50 am, edited 4 times in total.
Well, 2^16 = 65536. 82450 triangles means you have at least 82450 vertices, which is greater than 2^16. Therefore you're exceeding the 16-bit vertex count limit, as the assertion is telling you. Are you trying to load the whole map as a single mesh?
So why is the OgreShadowCaster using a 2 bytes variable to store that information ? I could make several mesh from the original one but what's the point ? And how to handle high resolution meshes ?
Where did the mesh come from? The exporter should have set the mesh to use 16 or 32-bit indices when the data was exported. If you exported to a .mesh.xml file, go into the file and change the index size(s) (it will be highly obvious which attribute to change).
Your mesh is over the limit for shadow volumes. You could probably change Ogre to support 32 bit vertex counts for shadow volumes, but it's not a good idea, because you'll get really bad performance using stencil shadows with such big meshes anyway. I'd suggest switching to texture shadows or reducing the number of vertices significantly.
The the mesh is an old map from another project with everything collapsed into one edit poly. I did export it with the oFusion exporter.
But what if my mesh was splitted up in several meshes ? Will I obtain bad performance with stencil shadows too ?
I'm not sure yet what kind of shadows I'll use, because my scenes' lighting will probably be precomputed (lightmap) but I'll need shadows casted by the car and it would be great the car receives shadows too.
Having level geometry in a single mesh is generally a bad idea -- the whole level will render always even if only a tiny portion is visible. Break it up.
I've heard many questions having to do with oFusion and index size -- ask or search over in the oFusion forum if you continue with the large mesh.