(I remember early on sketching out the development plan for v2 and coming up with like 9 months of work... Things escalated.)
313 karma · joined June 20, 2018
here's a twitter thing???? https://twitter.com/RossNordby
(I remember early on sketching out the development plan for v2 and coming up with like 9 months of work... Things escalated.)
And then everything went open source, some fruits of Midori started getting rolled in, and a focus on performance appeared. Stack that on top of the fact that C# has some pretty darn good tools, and I was comfortable jumping in more deeply. Notably, I did not just start making bepuphysics v2 at that point. It's sort of the tip of the iceberg- bepuphysics v2 is C# because all the other private stuff I've built is C#, and it's nice to minimize the developmental and runtime overheads between projects when possible.
The library is .NET Standard 2.0 compliant, though, so in theory it should work. It may require some extra work on the runtime side of things. As time goes on, I'd hope that mono/CoreRT or whatever the AOT story ends up being/CoreCLR converge and Unity can embrace them for all their target platforms. (Burst is also an option, but that would require a massive rework in bepuphysics that I can't really afford to do given that my projects aren't on Unity.)
The work in Unity's Burst/HPC# is very recent, though, and the CoreCLR/language features I rely on in bepuphysics are still pretty obscure. I wouldn't expect most people outside of the weird niche I live in to know about the ecosystem's progress.
In other words, I was just trying to get an unaware visitor to raise an eyebrow.
So not a big deal, just a notable quirk.
I did build it for a reason, though- over the coming weeks I'll be diving into actually making stuff with it. That'll be a nice change of pace.
Regarding GPGPU, you're correct that bepuphysics v2 is strictly CPU-side, and also that I could likely make a GPGPU version faster. I wrote a blog post about why I chose to go with CPU-only: https://www.bepuentertainment.com/blog/2019/1/16/-but-gpus-a...
The short version is comparative advantage. I have other things to use the GPU on, and the GPU is even better at those things. And driver bugs.
Also, as I've mentioned elsewhere, while I have not done rigorous benchmarking, a casual evaluation showed that bepuphysics v2 on the CPU compares well with physX 4.1 running on a GPU of similar cost. Collision detection heavy scenes tend to favor GPU physX, while solver-heavy scenes tend to favor bepuphysics v2.
(Except for AMD's Threadripper CPUs unclear reasons. I suspect inter-CCX communication kills effective memory bandwidth in the solver. A 1700x is about as fast as a 2950x, and modern Intel cpus with full rate AVX2 can be much faster. Zen 2 should change things significantly.)
The current safety progress certainly isn't ideal (where ideal would be "oh hey we figured it out, boy that was easy"), but it is roughly in line with what I'd expect for a smallish new field trying to lay foundations. No one knows what to do; there may not be any other option than to flounder for a while.
Ray tracing has a good shot at getting there (and probably in less than 5-10 years), and developers who can afford the suffering will hopefully pave the way, but early adopters should be very wary.
To be clear, I'm not catastrophically pessimistic. I intend to do some work with it, but I'm not under any illusions. I once encountered five distinct blocking driver bugs in the span of a single week. I just assume everything is broken until proven otherwise.
Any developer who is in the awkward middle ground of building their own technology without the resources of a major engine (both in terms of manpower and in relevance to hardware vendors) should expect everything on the bleeding edge to be partially or fully broken, often with no timely recourse. I'm not faulting the vendors too much- the software x hardware situation is absurdly complicated, and spending limited driver resources on a smaller company's use case instead of, say, Unreal and Unity, doesn't make a lot of sense.
But if you're one of those smaller companies, you pretty much have to build the fallback implementation first using common low level primitives that have been tested a million times across the industry. If you don't, your product simply won't work for many (and sometimes most) users. Even when their hardware is supposed to support it.
And speaking from unfortunate experience, the up-front cost of building the fallbacks is often less than trying to make the fancier things work consistently, even though the fancier thing is ostensibly doing the work for you.
It's remarkable how fast the language and runtime have evolved for performance. It wasn't that long ago that I was manually inlining Vector3 operators to try to get a few extra cycles out of XNA on the Xbox360.