-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added staticBody test #303
Conversation
ok, I merged the first changes is line below in function BuildStaticBunny it should be the second is line that would work, but imply that each face has a unique material, I doubt that's what you meant, so I changes to this
faceMaterialId would be a series of ID painted by an artist in an visual authoring tool. |
I did have the materialID wrong in my own code and have fixed it. Thanks. Unfortunately it does fix the crashing problems I'm hitting on some but not all meshes. |
Where is the crash happening? Does it has a stack trace? |
It happens on line 339 of ndPolygonSoupBuilder.cpp in the Finalize()
function.
Here's a video of what I get. Some meshes work without crashing.
https://youtu.be/SNnMa52b3Gs
…On Sun, Nov 6, 2022 at 9:28 AM NewtonDynamics ***@***.***> wrote:
Where is the crash happening? Does it has a stack trace?
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PP6PTM56INWK5IJ2W7DWG6W6PANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
ah, that make a lot easy to debug it. assuming is reproducible with the same mesh. maybe you can do something like this.
them you can send the file to me so that I can debug it. I do not have a loader yet, but I can add that for the debug. before you send the mesh to me, try loading in some viewer, |
Definitely something weird going on. Here's the view's of the original mesh
and the ply mesh saved from ndPolygonSoupBuilder. I also am including the
ply mesh
…On Sun, Nov 6, 2022 at 12:28 PM NewtonDynamics ***@***.***> wrote:
ah, that make a lot easy to debug it.
form the video I see that it is no on teh optimization part. so that make
simpler.
It seems to happen on the function that compact the vertex array. probably
some memory overrun.
assuming is reproducible with the same mesh.
Ther is a debug function that In the pass I use to check the correctness
of intermediate meshes.
I just test to make sure still works.
maybe you can do something like this.
after you submit all the faces to the mesh builder and before you call the
end function,
you can save the mesh to a ply file.
something like this
ndPolygonSoupBuilder meshBuilder;
meshBuilder.Begin();
meshBuilder.AddFaceIndirect(&floor[0].m_x, sizeof(ndVector), 31, &index[0][0], 3);
meshBuilder.AddFaceIndirect(&floor[0].m_x, sizeof(ndVector), 31, &index[1][0], 3);
meshBuilder.SavePLY("xxxx.ply");
meshBuilder.End(optimized);
them you can send the file to me so that I can debug it. I do not have a
loader yet, but I can add that for the debug.
also tha could be useful for showing build to mesh for a file.
before you send the mesh to me, try loading in some viewer,
if you do no have one you can try https://www.meshlab.net/
it is free and very usefull for these kind of stuff
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PPZCPBHMW4P64AIRSULWG7L23ANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Here's the ply mesh |
ok I can see that the input mesh is already wrong. but I suspect the reason the mesh is missing face is because where are you getting the mesh from, can you save as a fbx, so that I can check the original? |
I just load the mesh, but I do not get any crash, in debug or release. |
ok when loading the mesh in https://www.meshlab.net/ |
ok I found the source of the mesh, it is a 3d paint mesh. I selected the node and translated them to see if was different. but is just repeat the same mesh for time you can still load mesh like that but you have to do some authoring like selecting a node that you want to use for collision. |
I have the mesh in glTF format. I think I probably got it from Sketchfab They have a lot of models that can be downloaded in many formats, including fbx. Let me see if I can find another model that crashes. |
Okay, here's one that crashes when I load the glTF version. It also has a .fbx version that you can download |
Here's the ply version saved from ndPolygonSoupBuilder. When I load it in my viewer it looks fine but crashes in Newton |
ther sword.zip I just pasted in teh new sandbox, like this
and is load just fine. I still do no see why it is crashing on your side. |
if you sync I added the code that load the PLY file, |
No crash for me either using meshBuilder.LoadPLY("sword.ply");
Here's the 2 sword meshes wireframe in my viewer.
![original_sword_gltf](https://user-images.githubusercontent.com/8120255/200196143-bce41af3-a508-4942-a3e3-fe0e571685f3.jpg)
![sword_ply](https://user-images.githubusercontent.com/8120255/200196151-4b56e064-dde1-4d82-8c2d-10ebd901f742.jpg)
…On Sun, Nov 6, 2022 at 3:15 PM NewtonDynamics ***@***.***> wrote:
if you sync I added the code that load the PLY file,
maybe you can try place some where, in teh code where is repro the crash.
I am probably no doing teh same way you are doing it.
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PPYWFYRBBJHPYAJSU3TWG77TFANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I stepped through in the latest git version and the crash happens in a different place. Here's a video |
That does not makes any sense. |
Yes, it definitely seems like memory corruption. It's odd that some models
work consistently and some crash.
Poly Haven has a bunch of free high quality models, many of which can be
downloaded in FBX format. Maybe you can find one that crashes too.
https://polyhaven.com/models
…On Sun, Nov 6, 2022 at 5:06 PM NewtonDynamics ***@***.***> wrote:
That does not makes any sense.
It is as if something is corrupting the memory heap, and tge code crash
ramdome.
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PP74WYLGOTUNCA4LGI3WHAMURANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Okay, I found a FBX mesh from PolyHaven( ceramic_vase_03_4k.fbx ) that
crashes in the "static mesh" Newton demo. It only crashes if optimize is
set to false (meshBuilder.End(false); )
I modified the BuildPlayArena
ndBodyKinematic* BuildPlayArena(ndDemoEntityManager* const scene)
{
ndMeshEffectNode* const meshEffectNode =
LoadFbxMeshEffectNode("ceramic_vase_03_4k.fbx");
ndDemoEntity* const entity = new ndDemoEntity(scene, meshEffectNode);
scene->AddEntity(entity);
Here's the file. I just unzipped into the "build/applications/media"
folder
ceramic_vase_03_4k.fbx.zip
<https://drive.google.com/file/d/1uaiCHTqjTR1l47ZIzJi9yv1dio62RlB0/view?usp=drive_web>
…On Sun, Nov 6, 2022 at 6:21 PM Hurleyworks ***@***.***> wrote:
Yes, it definitely seems like memory corruption. It's odd that some models
work consistently and some crash.
Poly Haven has a bunch of free high quality models, many of which can be
downloaded in FBX format. Maybe you can find one that crashes too.
https://polyhaven.com/models
On Sun, Nov 6, 2022 at 5:06 PM NewtonDynamics ***@***.***>
wrote:
> That does not makes any sense.
> It is as if something is corrupting the memory heap, and tge code crash
> ramdome.
>
> —
> Reply to this email directly, view it on GitHub
> <#303 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB56PP74WYLGOTUNCA4LGI3WHAMURANCNFSM6AAAAAARYFCSTE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
-Steve
http://berserko.hurleyworks.com/ <http://www.hurleyworks.com>
|
And here's the video of the crash in Newton Demos
https://youtu.be/vHcd2wprwFw
…On Mon, Nov 7, 2022 at 9:46 AM Hurleyworks ***@***.***> wrote:
Okay, I found a FBX mesh from PolyHaven( ceramic_vase_03_4k.fbx ) that
crashes in the "static mesh" Newton demo. It only crashes if optimize is
set to false (meshBuilder.End(false); )
I modified the BuildPlayArena
> ndBodyKinematic* BuildPlayArena(ndDemoEntityManager* const scene)
> {
> ndMeshEffectNode* const meshEffectNode =
> LoadFbxMeshEffectNode("ceramic_vase_03_4k.fbx");
> ndDemoEntity* const entity = new ndDemoEntity(scene, meshEffectNode);
> scene->AddEntity(entity);
Here's the file. I just unzipped into the "build/applications/media"
folder
ceramic_vase_03_4k.fbx.zip
<https://drive.google.com/file/d/1uaiCHTqjTR1l47ZIzJi9yv1dio62RlB0/view?usp=drive_web>
On Sun, Nov 6, 2022 at 6:21 PM Hurleyworks ***@***.***>
wrote:
> Yes, it definitely seems like memory corruption. It's odd that some
> models work consistently and some crash.
>
> Poly Haven has a bunch of free high quality models, many of which can be
> downloaded in FBX format. Maybe you can find one that crashes too.
> https://polyhaven.com/models
>
> On Sun, Nov 6, 2022 at 5:06 PM NewtonDynamics ***@***.***>
> wrote:
>
>> That does not makes any sense.
>> It is as if something is corrupting the memory heap, and tge code crash
>> ramdome.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#303 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AB56PP74WYLGOTUNCA4LGI3WHAMURANCNFSM6AAAAAARYFCSTE>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
>
> --
> -Steve
> http://berserko.hurleyworks.com/ <http://www.hurleyworks.com>
>
--
-Steve
http://berserko.hurleyworks.com/ <http://www.hurleyworks.com>
|
when I click teh link, I get this request access tell me I nee to be approved. |
can you just load the file to you site so that I can download it? |
request access tell me I nee to be approved.
I just approved you. The file was too big for email so I had to put on
GoogleDrive
…On Mon, Nov 7, 2022 at 10:13 AM NewtonDynamics ***@***.***> wrote:
when I click teh link, I get this
(https://drive.google.com/)
You need access
Request access, or switch to an account with access.
request access tell me I nee to be approved.
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PPZHFYLZQCINFFLQ743WHEL7JANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
ok, I download the mesh and place like you show in the video. if you sync, the sandbox is set to recreate what you did, maybe I am doing something different, but I am not getting a crash. The mesh looks weird, but the first thing is to see why it is crashing for everyone except for me. |
oh, nice. now I can work to get this fixed. |
I can't get back to my computer for a couple hours but just as a sanity
check did you remember to set the optimize off. If optimize is on I don't
get a crash either
…On Mon, Nov 7, 2022, 12:32 PM NewtonDynamics ***@***.***> wrote:
ok, I download the mesh and place like you show in the video.
I am not getting a crash, in my machine at home, nor I get a crash on my
work system
if you sync, the sandbox is set to recreate what you did, maybe I am doing
something different, but I am not getting a crash.
The mesh looks weird, but the first thing is to see why it is crashing for
everyone except for me.
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PP4VAVTAMI5J6F4EWXTWHE4KFANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Alright, it was a memory overrun in a vertex list to index list class.
You can sync and try again.
At least, I think that crash is resolved.
…On Mon, Nov 7, 2022, 9:40 AM Steve Hurley ***@***.***> wrote:
I can't get back to my computer for a couple hours but just as a sanity
check did you remember to set the optimize off. If optimize is on I don't
get a crash either
On Mon, Nov 7, 2022, 12:32 PM NewtonDynamics ***@***.***>
wrote:
> ok, I download the mesh and place like you show in the video.
> I am not getting a crash, in my machine at home, nor I get a crash on my
> work system
>
> if you sync, the sandbox is set to recreate what you did, maybe I am
doing
> something different, but I am not getting a crash.
>
> The mesh looks weird, but the first thing is to see why it is crashing
for
> everyone except for me.
>
> —
> Reply to this email directly, view it on GitHub
> <
#303 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AB56PP4VAVTAMI5J6F4EWXTWHE4KFANCNFSM6AAAAAARYFCSTE
>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6EPJFIUD2PDP2D4SYZP23WHE5HXANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Great, It's working now. Thanks!
On Mon, Nov 7, 2022 at 1:11 PM NewtonDynamics ***@***.***>
wrote:
… Alright, it was a memory overrun in a vertex list to index list class.
You can sync and try again.
At least, I think that crash is resolved.
On Mon, Nov 7, 2022, 9:40 AM Steve Hurley ***@***.***> wrote:
> I can't get back to my computer for a couple hours but just as a sanity
> check did you remember to set the optimize off. If optimize is on I don't
> get a crash either
>
> On Mon, Nov 7, 2022, 12:32 PM NewtonDynamics ***@***.***>
> wrote:
>
> > ok, I download the mesh and place like you show in the video.
> > I am not getting a crash, in my machine at home, nor I get a crash on
my
> > work system
> >
> > if you sync, the sandbox is set to recreate what you did, maybe I am
> doing
> > something different, but I am not getting a crash.
> >
> > The mesh looks weird, but the first thing is to see why it is crashing
> for
> > everyone except for me.
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
>
#303 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AB56PP4VAVTAMI5J6F4EWXTWHE4KFANCNFSM6AAAAAARYFCSTE
> >
> > .
> > You are receiving this because you authored the thread.Message ID:
> > ***@***.***>
> >
>
> —
> Reply to this email directly, view it on GitHub
> <
#303 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AB6EPJFIUD2PDP2D4SYZP23WHE5HXANCNFSM6AAAAAARYFCSTE
>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56PP64GI6MLIZSE2KC3UTWHFA5BANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes thatvwas a big one.
But I also found some other problems, when I was debugging that problem
yesterday.
I am fixing the tonight.
It has to do when a large object hit a ver small polygon.
It is generation contact outside the perimeter of the face.
I had a comment there, from a long time.
And I guess it is time to adressit now.
…On Mon, Nov 7, 2022, 11:45 AM Steve Hurley ***@***.***> wrote:
Great, It's working now. Thanks!
On Mon, Nov 7, 2022 at 1:11 PM NewtonDynamics ***@***.***>
wrote:
> Alright, it was a memory overrun in a vertex list to index list class.
> You can sync and try again.
> At least, I think that crash is resolved.
>
> On Mon, Nov 7, 2022, 9:40 AM Steve Hurley ***@***.***> wrote:
>
> > I can't get back to my computer for a couple hours but just as a sanity
> > check did you remember to set the optimize off. If optimize is on I
don't
> > get a crash either
> >
> > On Mon, Nov 7, 2022, 12:32 PM NewtonDynamics ***@***.***>
> > wrote:
> >
> > > ok, I download the mesh and place like you show in the video.
> > > I am not getting a crash, in my machine at home, nor I get a crash on
> my
> > > work system
> > >
> > > if you sync, the sandbox is set to recreate what you did, maybe I am
> > doing
> > > something different, but I am not getting a crash.
> > >
> > > The mesh looks weird, but the first thing is to see why it is
crashing
> > for
> > > everyone except for me.
> > >
> > > —
> > > Reply to this email directly, view it on GitHub
> > > <
> >
>
#303 (comment)
> > >,
> > > or unsubscribe
> > > <
> >
>
https://github.com/notifications/unsubscribe-auth/AB56PP4VAVTAMI5J6F4EWXTWHE4KFANCNFSM6AAAAAARYFCSTE
> > >
> > > .
> > > You are receiving this because you authored the thread.Message ID:
> > > ***@***.***>
> > >
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
>
#303 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AB6EPJFIUD2PDP2D4SYZP23WHE5HXANCNFSM6AAAAAARYFCSTE
> >
> > .
> > You are receiving this because you modified the open/close
state.Message
> > ID: ***@***.***>
> >
>
> —
> Reply to this email directly, view it on GitHub
> <
#303 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AB56PP64GI6MLIZSE2KC3UTWHFA5BANCNFSM6AAAAAARYFCSTE
>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
-Steve
http://berserko.hurleyworks.com/ <http://www.hurleyworks.com>
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6EPJH3MGDGKN6QA36QVLLWHFL4RANCNFSM6AAAAAARYFCSTE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I'm having problems with some static meshes crashing while using ndPolygonSoupBuilder. I tried to reproduce with this Newton test but there is no crash when using this Bunny mesh. Here's the test in case you want to add it to the pile.