[Solved] Shadows problem : vertex count > 16-bit limit

Problems building or running the engine, queries about how to use features etc.
User avatar
Reverse
Kobold
Posts: 28
Joined: Fri Mar 23, 2007 3:08 pm
Location: Paris - France
Contact:

[Solved] Shadows problem : vertex count > 16-bit limit

Postby Reverse » Fri Apr 20, 2007 2:07 pm

Hi there,

I'm having troubles with one particular map in my project when I'm enabling shadows.

Here is the error :

Code: Select all

Assertion failed: v1 < 65536 && v0 < 65536 && (v0 + originalVertexCount) < 65536 && "Vertex count exceeds 16-bit index limit!", file e:\projects\ogrecvs\branches\eihort_vc8_clean\ogrenew\ogremain\src\ogreshadowcaster.cpp, line 116


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.
0 x

lodi
Greenskin
Posts: 103
Joined: Sat Jul 24, 2004 7:06 pm

Postby lodi » Sat Apr 21, 2007 7:03 pm

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?
0 x

User avatar
Reverse
Kobold
Posts: 28
Joined: Fri Mar 23, 2007 3:08 pm
Location: Paris - France
Contact:

Postby Reverse » Sun Apr 22, 2007 4:12 am

Yes.

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 ?
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Postby xavier » Sun Apr 22, 2007 6:57 am

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).
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Postby DWORD » Sun Apr 22, 2007 10:50 am

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.
0 x

User avatar
Reverse
Kobold
Posts: 28
Joined: Fri Mar 23, 2007 3:08 pm
Location: Paris - France
Contact:

Postby Reverse » Sun Apr 22, 2007 2:47 pm

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.

Thank you !
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Postby xavier » Sun Apr 22, 2007 5:06 pm

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.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Reverse
Kobold
Posts: 28
Joined: Fri Mar 23, 2007 3:08 pm
Location: Paris - France
Contact:

Postby Reverse » Sun Apr 22, 2007 5:13 pm

I'll definitely break up my meshes if it's always rendered when everything is collapsed into 1 mesh, that's a big issue.

Thanks a lot.
0 x


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 7 guests