view
Tweet
hifi: #20305 Physics: V-HACD convex decomposition utilities

Write some code that reads a simple FBX model (using our own FBX parsing code) then uses V-HACD-2.2 to compute a convex decomposition.

https://code.google.com/p/v-hacd/

The V-HACD parameters need to be explicitly set (not default values) but it is OK if they are hard-coded (picking the right values and providing a system for exploring the parameter space will be a separate project).

This would be a new executable in our project: a utility that can load a model (can be hard-coded), compute he HACD decomposition, and then prints out a summary of the results: model complexity input, decompoition output: time of run, number of hulls, number of points per hull.

We'll use this utility to explore how long it takes to solve models and how the results change when the HACD algorithm's parameters are changed.

Comments & Activity

  • 4 yrs, 1 mnth ago

    #20305 created by AndrewMeadows Status set to Bidding.

  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Labels updated: C++.

  • 4 yrs, 1 mnth ago

    A bid was placed on #20305

  • Note: we're not looking for an original HACD implementation. Instead we want someone to use the V-HACD-2.2 library found here:

    https://code.google.com/p/v-hacd/

    You can find blog posts about the project here:

    http://kmamou.blogspot.com/
  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Notes changed.

  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Labels updated: C++.

  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Labels updated: C++, Hifi Interface.

  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Labels updated: C++.

  • 4 yrs, 1 mnth ago

    #20305 updated by AndrewMeadows Changes: Notes changed.

  • I have familiarized myself with that HACD implementation. I will use that instead of making it from scratch.
  • Kodey, sorry I let your bid expire. I'm new to managing worklist jobs. Go ahead and bid again and I'll accept it.
  • 4 yrs, 1 mnth ago

    Bid updated on #20305

  • 4 yrs, 1 mnth ago

    AndrewMeadows accepted 200.00 from Kodey on #20305 Status set to In Progress.

  • Hi @AndrewMeadows ,
    Just a quick question.
    Can I include OpenCl dependency in V-HACD for supporting GPU acceleration ?
    I am asking this because if I do this then, opencl will become a dependency for whole HiFi tree.
    However V-HACD can work without OpenCl , so it is not required. Just let me know.
    I have completed the rest of the development.
  • Don't add an OpenCL dependency yet. I think we will eventually use OpenCL in the hifi project for other reasons, but it will probably be optional. If you have OpenCL dependent code in your V-HACD utility just wrap it in an #ifdef USE_OPENCL and provide a non-OpenCL implementation in the #else case. There are ways to configure CMake to add -DUSE_OPENCL to the CXX_FLAGS when OpenCL is detected but I view that work as outside the scope of this project.
  • 4 yrs ago

    #20305 updated by virneo Changes: Status set to QA Ready.

  • Please add vhacd dependency from my git repo.
    https://github.com/virneo/v-hacd

    I have build.md mentioning the required steps.
  • Excellent. I'll clone it now and look it over.
  • I'm still in the process of trying to evaluate. The FindVHACD.cmake script did not work for me on linux. I've been dismantling it (and acquiring more CMake knowledge in the process) to figure out why. Stand by...
  • It seems that we build 64-bit on linux so the 32-bit VHACD build is not going to work (BTW, we'd prefer to build 64-bit on windows too but there is something holding us back there... I forget what). I'll switch my VHACD build to 64-bit and try again.
  • @AndrewMeadows It is working for me. I will test it another linux distro and let you know. May be I can figure out the problem. Did it work on windows ?
  • I'm using Kubuntu-14.10. I haven't tried Windows yet. So far my problems have been:

    (1) FindVHACD.cmake would fail to find "VHACD_LIB" at line 48. Needed to change it to "libVHACD.a"

    (2) Change "Qvector.h" to be "QVector.h" at line 12 of ../tools/vhacd/src/VHACDUtil.cpp

    (3) Link error on vhacd executable that looks like this:
    Linking CXX executable vhacd
    /usr/bin/ld: /home/andrew/work/hifi_lib_dir/vhacd/lib/libVHACD.a(VHACD.cpp.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
    //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status

    I'm still working on (3).
  • My tests were on a 32 bit distro and I made the vhacd cmake specific to 32 bit builds. My bad. I will change the cmake in vhacd tree and commit again. I do not have to change anything in Hifi branch though.
  • I'm getting case sensitive errors even in V-HACD:

    I cloned a fresh copy of V-HACD and found that it didn't compile for trying to include "OCLHelper.h" instead of "oclHelper.h"

    Odd... I thought linux was case sensitive by default. How does anyone configure it to be case-insensitive?

    Meanwhile, I built the official V-HACD (after modifying the cmake files to NOT include OpenCL) and it produced a library called: libVHACD_LIB.a (instead of libVHACD.a). I suspect that if I had the VHACD_LIB file in the right place the CMakeLists.txt files would have worked for your vhacd utility executable in hifi -- if everything is working on your end I wonder if you accidentally left a copy of libVHACD_LIB.a around and are linking to that without realizing it, instead of the modified version?
  • I will look in to it immediately and I will make the necessary changes in a fresh environment.
  • After researching online I've learned that a gcc compile will be case-insensitive if the filesystem it is using is case-insensitive. Good to know but I wonder what filesystems people are using on linux that are case-insensitive?
  • Yes, I guess we need to consider that as well while authoring. I am using Ubuntu 14.04. I did not face any of these issues. Only thing I missed to commit is

    if(NOT WIN32)
    find_package( Threads)
    target_link_libraries(${TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT})
    endif()

    in CMakeLists.txt of tools/vhacd in hifi branch. This should solve the pthread link error.
  • But its used by VHACD_LIB and not the VHACDUtil. so if you have built that then I guess you do not need to add it anyways. I am cleaning the git clone of VHACD_LIB.
  • Ok, I was able to get the vhacd utility to run and process an FBX model that I hard-coded. The vhacd util is pretty much exactly what I asked for, so great work. Here's my feedback:

    (1) The output of the util needs to measure and print out the "time of run", that is: the total number of seconds it took to compute the convex decomposition. Otherwise the output is good.

    (2) The code of the vhacd util needs a little cleanup before we can accept it. In particular we're using K&R formatting on logic blocks so this is good:

    if (foo) {
    // do something
    }

    but this is not:

    if (foo)
    {
    // do something
    }

    (3) I've decided that the hard-coded filename for the FBX model is pain -- it would be much better for us if the executable were to accept a filename argument and try to open that.

    Item (3) is optional -- if you'd like to do it then add a fee for it at the top of this project and I'll accept it when it is done, otherwise don't worry about it and I'll accept this once items (1) and (2) are done.
  • No need for a fee for this change. I am on top of all this cleanup work.
  • Everything is updated. I have cleaned up the cmake files and verified build on linux 64bit and windows. My V-HACD github tree is also sane now.
    Also added elapsed time information and commandline argument.
    Please evaluate.
  • Please also check job number
    #20304 Physics: utilities for computing mass properties of mesh models
  • Excellent, your hifi branch builds on linux without a problem once the v-hacd dependency in met. I was able to supply a filename at the command line and the vhacd-util measured the time of run.

    This job is complete, except for one thing (sorry, I'm not trying to move the goalstick on this job, but this is the first worklist job I've managed and I too am still learning the ropes of the process). The next step would normally be for you to create pull request on github for your hifi branch but unfortunately we wouldn't be able to merge it because it wouldn't build -- your v-hacd repo is a _required_ dependency and our build farm isn't set up for it yet. Therefore, we'll have to somehow make the vhacd-util an optional part of the build that only succeeds if VHACD_FOUND is set in the CMake config.

    Again, feel free to add a fee for this extra work at the top of this project or else we can accept this as done and I'll do the final CMake wrangle myself.
  • It was not much of a change. So no problem. Updated the tree.
  • Yup, that works. Ok, next step is for you to create a pull request (PR) for the highfidelity/hifi repo using the github web ui. When that is posted it should show up here:

    https://github.com/highfidelity/hifi/pulls

    And we'll merge it.
  • 4 yrs ago

    #20305 updated by AndrewMeadows Changes: Status set to Code Review.

  • 4 yrs ago

    #20305 updated by AndrewMeadows Changes: Status set to Merged.

  • 4 yrs ago

    #20305 updated by AndrewMeadows Changes: Status set to Done.

  • 3 yrs, 9 mnths ago

    #20305 updated by AndrewMeadows Changes: Status set to Bidding.

  • 3 yrs, 9 mnths ago

    #20305 updated by AndrewMeadows Changes: Status set to Pass.

  • 3 yrs, 9 mnths ago

    #20305 updated by AndrewMeadows Changes: Status set to Done.

Labels Saved!

Bids

Login to bid
Who Amount Done in ...
*name hidden*$ ***2 days