A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by PJani » Sat Jun 23, 2012 1:00 pm
Hey i have one problem. I am building my scene proceduraly(i realy can't serialize collision).
How many vertices can treecollision face contain 3,4 or even more?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sat Jun 23, 2012 1:44 pm
there are no limit as to the vertices in a face. what do you mean slow, slow doing what.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sat Jun 23, 2012 2:21 pm
Hmm if you have more than 4(3 is triangle which perfectly defines surface...4 verticles are quad) verticles in face how they are forming the "shape"/mesh...
I need to add circa 3k triangles into treecollision. and that takes 0.4sec to finish the build(i have multiple bodies each defining one chunk of the terrain). is there any faster method?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sat Jun 23, 2012 2:52 pm
do not use optimization when you call buildEnd.
of for vertices lie in the same plane, they will be saved as a four vetice face.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sat Jun 23, 2012 2:56 pm
Hmm actually i dont use optimisation.

| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sat Jun 23, 2012 3:22 pm
I never seen teh collsion tree taking 0.4 of a secud with 3000 vertices.
I use tow poblic domain mesh sibernic cathedral and, and the atrium pallace. one has way ove a hindred tousanbd verices. and the other over 70000.
and they work just fine.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sat Jun 23, 2012 4:00 pm
actually this function takes very long time to complete...about 0.47sec for collision with exacely 6144 verticles
NewtonTreeCollisionEndBuild(col,0);
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sat Jun 23, 2012 6:37 pm
I do not know what to say, tha function does lot of work.
It build and adjecendy list, remove degenerate faces, calculate normals, remove duplicate vertices. and a whole bunch of other things.
It is actually quite fast considering all the work it does.
why don't you serialize your output to memory, and simple load the seriliaze from and asset manager?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sat Jun 23, 2012 7:27 pm
Yeah the problem is i need to constantly update collision geometry when backend structure changes because of player actions, other players, explosions, etc.. The trick is i am already building quads, quads,triangles from adjecendy list and i have normals already calculated...but with tree collision it seems i am just redoing the samething over and over...
How would user mesh collision behave in this situation...Is there any performance hit using user mesh collision?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sat Jun 23, 2012 8:15 pm
But if you are not making deformable mesh, why cann't you pregenerate all the meshe offline. must game do just that for performance.
User mesh collision would be an option. yes. you lose the adjacency list, but that is not a big deal.
collision trees, all have simolar performance since they all use soem sort of spaceal partiction. People will tell you otehwise but is reality
the difference wodl be or teh oreder of few huder nanosecund to maybe a micorsecudn per querie. Th ediffrecne si teh quality of the queries.
I use collision trees for higmap collsion and they work just fine.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sun Jun 24, 2012 4:30 am
good question! If i prebuild everything then i will need to store 42535295865117307932921825928971026432(this is real number no joke) permutations for "prototype" terrain chunk on hdd. I will rather use usermesh than try to store whole universe on hdd.
collision generator will work using threads so it will be decoupled from main thread, using producer/consumer pattern.
edit: for what is NewtonUserMeshCollisionGetFacesInAABB used!?
Is there any example of usermesh collision?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sun Jun 24, 2012 7:06 am
that number of premutation do not seems correct, how did you arrive to that number?
before you try the user mesh let us see fi teh problem can be resolve, I am sure it can be precomputed.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sun Jun 24, 2012 8:37 am
Actually its correct! backend structure reflects binary code 2^125 for chunk prototype.
And because structure is structured using basic math i don't need any tree or anything i just check which coordinates of AABB intersect with query i put the general "matrix" array pointer and regenerate index array for that chunk.

| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Julio Jerez » Sun Jun 24, 2012 8:49 am
2^125 is a absurd number no matter who you get it. Ther si no way somethong can have that kind of interation. not even an nBody system
can you explain me hwo are you doing that maybe I can help you because that I beleive is the root of teh problem.
There are lot of poeful struture in newton than maybe can help yo uout at a higher level.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Sun Jun 24, 2012 9:01 am
In REALY worst case 16B structure(2^128 ... 2^125) produces 6144 vertexes for one terrain chunk(75kB for one chunk) in best case 0 vertexes.

Currently i cant say much what i am doing till release or at least at this stage.
2^125(16B) is just a configuration/permutation description for collision mask.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest