Softbody Grass
I finally added grass to Cargo. It took a long time to do!
I have been wanting to do this for ages. The island looked quite bare without it, but I knew that it would be a hard task to render the blades in real time. A couple of tests showed that the blades could be rendered if they were all part of one big object, but as individual objects it was too slow. Individual objects is what I need though: it’s the only way to have each blade react when touched.
I ended up doing both: blades far from the snail are drawn in large clusters, while the near blades are drawn individually, and will wobble about when bumped into. Clusters are determined by putting the blades into a KD-tree. I hope to have time to write about this in detail later.
This took such a long time (about three months of my spare time). I am really glad that it ended up working. It was a big risk, and I felt bad about not making more progress on the story-side of the game, but the grass adds so much. Now I can get back to those parts that I have neglected.
Edit: Some rough statistics: There are more than 2000 blades of grass in the level, and it now runs at a frame rate of more than 40fps on my aged laptop. Drawing every blade individually (though without any dynamics) drops the frame rate below 20fps.
