-
Notifications
You must be signed in to change notification settings - Fork 466
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
Replace sphere and cylinder with smooth meshes #1463
Replace sphere and cylinder with smooth meshes #1463
Conversation
I have no idea what drawbacks this might have, but I imagine it's fine. My main concern would be performance implications, but I have no evidence or experience to say one way or the other. |
@wxmerkt, could you measure the time to render NxNx3 spheres/cylinders/cones (with N being a reasonable number e.g. 100 or 1000) to learn about the slowdown on Mesa / nvidia setups? |
I did a test with 18 spheres with 100 Hz update and I didn't see a difference in GPU load as measured by I just ran a test with 100x100x3 spheres (so that is 30k Markers - not a sphere list!):
In practice, I think robot models are in general way more complex than the basic shape introduced here. As an alternative, I am happy to use the |
Thanks, looks good. To reduce CPU load, it should be fine to use a sphere list. |
Okay - is the PR good to go ahead or is there something else I should take a look at? :-) |
Sorry that I was not clear enough: I think the PR is ready to be accepted. |
One more thing: Could you please extend the main post of this PR and describe what you have actually changed in the .mesh files? I guess the original files didn't define surface normals and you just added correct ones, right? In this case (i.e. you didn't add more vertices), there shouldn't be any performance difference, because normal interpolation should have been in place before as well - trivially resulting in the same normal per surface. |
Thank you. I have updated the first post. I think the cone and cylinder have the same number of vertices; the sphere may have more. I initially modelled it in Blender but this showed to cause issues with the correct export of the normals. As a result a colleague created new files with Autodesk 3DS form scratch. I did not compare the number of vertices for all of them. |
This would be important to judge impact on performance. |
Here is the breakdown:
|
Thanks for this detailed breakdown. I think that cylinder and cone are fine. |
Default sphere in blender
The difference in vertices is that the original meshes did not reuse vertices for faces. The new ones do. I've remodeled the sphere from scratch in Blender just now. The default sphere has 482 vertices and 512 original faces, with 960 triangles. I switched to using a SPHERE_LIST and tried the above outlined test for N=1000 (3M spheres). Both the sphere currently in master and the one in this PR reached 162fps with 3M spheres on my workstation, i.e., no difference. |
Thanks for your effort. |
Thank you for the feedback and time in reviewing this PR. Is there a plan for a new release/something else waiting for a patch release? |
I just prepared a new release by the end of the last year. Don't expect a new release anytime soon. |
Okay, thanks for the heads-up. If I could help out with it, happy to do so |
Fixes #1461 by replacing the existing meshes with meshes that have correct normals and flat shading turned on.
Changes
I first used Blender and the blender2ogre exporter to work export a new model of a sphere. However, due to bugs with the export this did not work with the cylinder which is why the cylinder and cone were created from scratch in Autodesk 3DS Max.
Sphere
Before
After
Cylinder
Before
After