Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 25th May 2010 13:16
I don't know if this is the right place to post the request but i don't know where else. So, dbpro has one stupid limitation - maximum number of indices in a mesh is 2^32. This can easily be fixed by reming out some part of the code. What you have to do in visual studio is go to Edit->Find and replace->find in files and search for this: dwIndexCount > 0x0000FFFF and rem out every occurence. Can you do this for me please?

"After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrash
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th May 2010 16:26
1) The limit is not 2^32, it is 2^16
2) The limit is there for a reason! The indices are 16 bits each which means that you cannot have more than 2^16 vertices per mesh. You can get 32 bit index buffers but some graphics cards don't support them. There is no reason why you should need that many vertices in a single mesh anyway, it is only going to be bad for performance. You should split them up into limbs or objects instead.

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 25th May 2010 16:28
I don't think IanM has access to the DarkBASIC source anyway.

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 25th May 2010 21:18
Just don`t tell anyone!Please!

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Slayer93
21
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 25th May 2010 21:28
Quote: "I don't think IanM has access to the DarkBASIC source anyway."


It's open source now - http://www.thegamecreators.com/pages/newsletters/newsletter_issue_87.html#9.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th May 2010 23:49
I'm also one of the few with the ability to check-in code to the repository, although I've been a little remiss in updating code lately.

Anyway, before someone trots off to change the code to allow 32 bit indices, remember that doing so will not also break compatibility as noted above by Diggsey, but will also disable every plug-in that accesses the index buffer, including the official plug-ins. Y'know the ones - sparky's, loads of my own, darkphysics and ODE, and likely dark shader too, plus others.

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th May 2010 02:08
Ah, very good to know.

Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 26th May 2010 02:33 Edited at: 26th May 2010 02:34
Quote: "The limit is not 2^32, it is 2^16"

After i posted that and went to sleep i realised the mistake. The limit is 2^16.

Quote: "You can get 32 bit index buffers but some graphics cards don't support them. There is no reason why you should need that many vertices in a single mesh anyway, it is only going to be bad for performance. You should split them up into limbs or objects instead."

All graphic card manufactured in the last decade support 32 bit index buffers. And if you don't have that kind of a card you probably aren't using dbpro (because it's slow). I don't see how can it be bad for performance. When you have more limbs you need more draw calls to render the same amount of triangles. More limbs also means more vertex buffers->redundancy. More limbs also means more world matrices to calculate->this all slows things down.
Splitting one index buffer into many is slow and complex process.

Quote: "Anyway, before someone trots off to change the code to allow 32 bit indices, remember that doing so will not also break compatibility as noted above by Diggsey, but will also disable every plug-in that accesses the index buffer, including the official plug-ins. Y'know the ones - sparky's, loads of my own, darkphysics and ODE, and likely dark shader too, plus others."

Do you know that for a fact?
When you load object in x format with more than 22000 triangles dbpro doens't complain and creates 32bit index buffers. I haven't heard that anyone had problem with that king of objects. And i don't think that any of that plugins actually accesses index buffers - more likely they access index array so changing index buffer to 32 bit should be a problem.

Why do i need this? I'm creating a modeling program and i want to be able to import meshes from various formats without the need to split them. I can change that my self and compile my version of dbpro but i want that objects made in my program can be loaded with standard version of dbpro so it would be cool i you (IanM) make that changed for the official release of dbpro.

"After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrash
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th May 2010 02:43 Edited at: 26th May 2010 02:51
Quote: "When you load object in x format with more than 22000 triangles dbpro doens't complain and creates 32bit index buffers."

Are you sure? I've had DB crash on me with very detailed objects, though I don't know the exact size.

Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 26th May 2010 02:48
Quote: "Are you sure?"

Yeah, i tryed objects where every limb had more than 50000 triangles and it worked well

"After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrash
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th May 2010 14:19
It's bad for performance because it's impossible to draw only part of the mesh. Often only one part of the mesh will be visible so if it is split up into objects DBPro can automatically not draw the hidden parts.

Also, even load object does not support limbs with 32-bit index buffers. You can see this straight from the code:
Quote: "pFrame->pMesh->pIndices = new WORD[pFrame->pMesh->dwIndexCount]; // allocate index memory"


Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 26th May 2010 14:52
Quote: "Also, even load object does not support limbs with 32-bit index buffers."

Then why am i able to load x object with 32bit index buffers?

And something else:
If IanM removes the 2^16 limit it won't break anything. All objects that have less than 2^16 indices will be made the same way they used to be, only the object with more than 2^16 indices will be made with 32bit index buffers instead of not being made at all what happens now. Try loading x object with more than 2^16 indices and then try to make mesh from it->impossible. I just want to be able to make a mesh from bunch of objects, attach that meshes as limbs to another object and then save that object to dbo. I just want to have possibility to do that and not to be limited be the engine.

"After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrash
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th May 2010 15:30
Quote: "Do you know that for a fact?"

Yes.
Not only do I have full access to the standard DBPro libraries, but I also have have access to the code for the TGC plug-ins too.

Quote: "I don't see how can it be bad for performance."

Bigger data means longer to transfer to the graphics card, and more memory taken up.

Quote: "All graphic card manufactured in the last decade support 32 bit index buffers."

DBPro still runs on graphics cards with only 32MB of memory on board and that only allow 16 bit index buffers. This isn't just about your system, but everyone's.

That said, feel free to chcek out a copy of the source code and make the changes yourself - there'll be a lot, and remember that the addition plug-ins won't work.

Login to post a reply

Server time is: 2026-07-25 08:30:04
Your offset time is: 2026-07-25 08:30:04