BVHView

01/11/2023

BVHView is a simple viewer for the .bvh animation file format written using raylib.

Download (Windows)GithubWeb Demo


About

I started work on BVHView trying to build a bvh viewer with the following goals in mind:

  • Must open files almost instantly and deal with large bvh files without issue.
  • Must be a desktop program which I can (in Windows) associate with .bvh files (i.e. not just a web-app).
  • Must visualize animations clearly and in a way that highlights any artifacts. That means:
    • Shadows and ambient occlusion to help judge ground contacts.
    • Checkerboard floor to help judge foot-sliding and noise.
    • Reasonable lighting beyond that of a single point light.
    • Capsules with texture on them to make joint twists visible.
    • Clear, crisp, anti-aliased debug rendering of lines and shapes.

I also hoped I could make the rendering good enough such that screenshots or recordings could be used for videos or figures in academic papers. And in a similar sense I wanted it to be hackable enough such that others in the research community could contribute toward it or build other (potentially interactive) applications using it as a base.

I think BVHView achieves most of those goals within some level of pragmatism - the rendering is a bit heavy on the CPU, and starts to get slow once you have about >400 capsules in the scene, but the whole thing fits into under 5000 lines of code and squeezing more out of it would mean quite a bit more code complexity from the optimizations and diverging further from raylib's normal setup. On the other hand, I did manage to include some nice-to-haves such as the ability to display multiple bvh files at once, semi-transparent rendering, and some auto-scaling features.

Raylib has been great for building this - it means it can be compiled for most platforms (given a few Makefile adjustments), can be easily hacked and made into an interactive application, and gives a fair bit of flexibility on the rendering given the glsl shaders. If you find this tool useful please consider contributing to raylib's development.

While I would still always encourage researchers serious about animation research to visualize their results on a skinned character (you could try this as a starting point), I hope the community can find this tool useful and perhaps we can stop wasting quite so much time debugging shadow mapping in our own little individual C++ OpenGL programs!

Happy hacking!