Mass Aggregate Physics Engine

Novus-MassAggregates

I ended up putting together a bit more of an interesting looking demo of mass aggregates over the past week. It helped me get out of a lull in development I’ve been in over the past two weeks. In the end it ended up also being a nice demo of physically based shading with IBL and tiled deferred shading. Though it does end up also being the worst case situation for tiled deferred shading where you can see some of the culling tiles very clearly at some angles since there are so many dim lights grouped together. I want to get around to improving the culling and modifying the falloff of lights to avoid the culling issues at some point when I have free time. Though at its current point there are some pretty screen-shotable stuff.

In this demo you can control gravity by using the arrow keys and the space bar. You can spawn various shapes in the level using the Z, X, C, and V keys.

The actual physics part of it was not that bad since I was able to carry over a bit of code from my previous implementation, though I did go through all of the code again to get resting contacts actually working and refactor a bit. Also mass aggregates are pretty expensive to evaluate so you end up getting issues once you exceed around 30 aggregates. I made an interesting ball and spring demo a while ago that demonstrates springs pretty decently using a Razer Hydra as input. I made a mass aggregate box a while ago too, though it does not look quite as good because of the simplistic shading model. Rigid bodies are going to be fun to balance with voxel traced global illumination and my senior production project.

I’m not really that happy about the architecture since I did not spend as much time as I wanted to on the engine before doing this project. The original plan was to have an actor for each aggregate that would spawn other actors and connect them using rods and such. In order to get a tech demo put together I ended up just rendering a sphere at each particle position, some lines on constraints, and some point lights at the points.

The lights were a last minute thing; I had started with just rendering some debug lights at random positions with random colors as a leftover from when I implemented the tiled deferred lighting. This was inside the renderer and was pretty rigid about not allowing any application-specific light placements. They worked decently for lighting the spheres interestingly, but were a kind of poor demo of the lighting in this case. The attached point lights ended up helping a lot with indicating where the ground was relative to the particles.

Here’s a video of the tech demo.

Some more screen shots:

Novus-MassAggregates2Novus-MassAggregates3Novus-MassAggregates4

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>