Page 1 of 1

could not draw triangles, too many vertices...with sibenik

Posted: Thu Jan 20, 2005 7:38 am
by oconv
doing a stress test for irrlicht with sibenik cathedral using lightmaps and ZDimitors my3d format, i'm getting the following error:
"could not draw triangles, too many vertices (99198), maximum is 65535"

the output is shown, but only partially.
any ideas? is this a limitation of irrlicht or of the my3d format?

Image

thanks oconv

Posted: Thu Jan 20, 2005 12:33 pm
by Spintz
It's actually a bug with Irrlicht. It's passing the vertex count to check how many primitives are being drawn. I've explained how to fix that here.

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=5176

Posted: Fri Jan 21, 2005 9:41 am
by oconv
thanks spintz :)

actually your code solved the problem for directx8/9. with opengl it still exists.
(probably my fault, i will have a look at this again.)

the sibenik model was just token as it is, a rough radiostiy solution was done in max and exported to my3d format with lightmaps included.

45fps with 45k triangels isn't too bad on a cheap fx 5200 card :)

Image

Posted: Wed Feb 23, 2005 6:43 am
by Hijacker
I have this problem with Irrlicht v0.8 (where this should be fixed)
But the string "Could not draw triangles, too many primitiv" i`ve found only in CVideoNull.cpp while this problen present in all devices.
Could anybody explain that?

Posted: Wed Feb 23, 2005 11:40 am
by Spintz
All devices derive from CVideoNull.cpp.

Change the line in CVideoNull.cpp that returns the MaxPrimitiveCount from 65536 to 1000000 or something very high.

Posted: Wed Feb 23, 2005 1:00 pm
by afecelis
Spintz:
are you exporting the MY3d file as a single mesh? (multitextured), cause it also seems like the engine is getting confused because of this. I got similar results in my first tests w/zdimitor's format so he told me each thing should be a separate mesh, and each mesh should have it's own texture. This way geometry shows up properly.

Posted: Wed Feb 23, 2005 1:58 pm
by Spintz
afecelis I don't even know what the MY3D format is! I wasn't the one that originally asked that question! :)

the MY3D file should have nothing to do with the drawPrimitive functions. The problem is in OpenGL, even if you use the proper fix ( which I believe Niko put into 0.8 ), OpenGL has a hardcoded limit for the number of vertices.

For instance, my DX CAPS tells me I have a MaxPrimitiveCount of 1,048,575 and a Max Vertex Index of 16,777,215. There is no way that I know of in OpenGL to determine this max, so it's hard coded as 65536 ( which is WAY TOO LOW ). That hard coding is in CVideoNull.cpp in the function - getMaximalPrimitiveCount.

Posted: Thu Feb 24, 2005 12:17 am
by oconv
afecelis:

yes, that was a single my3d file, and absolute no optimizing on the original sibenik file was done. i did several high poly architectural walkthroughs with max/my3d/irrlicht in a single mesh now, and never had this "confused engine" problem again.
in irrlicht 0.7, spintz advices solved the "too many vertices" problem also for opengl. i just overlooked some lines to change in the code.
seperate meshes make sense. so you have the ability to exclude things from collision detection, what speedups things quite a bit.