Fun with Instancing in Cycles
I’ve been experimenting more with cycles lately, and one thing I’m really impressed with already is the speed with which it handles instanced objects. I thought I’d share some silly experiments I made in the process and also a tip for using instances.
It’s great fun to use instancing to create fractal-like structures out of repeating objects. The image above I call the monkeybulb – after the mandelbulb fractal – and is made up of over 9000 suzannes (though even this is small fry compared to Agus3D’s instanced forest). It’s made by repeatedly extruding all the individual faces of a cube, and then smoothing the results. I then create a suzanne object that I parent to the fractal mesh, and turn on Dupli Faces to create repeated instances of suzanne. The image below uses a similar strategy, using a few array modifiers to duplicate a plane.
One thing that’s important to note is that I dont use an array modifier to duplicate the cubes seen in the image. This would result in a non-instanced verison of the scene that would render slower – as the array modifier generates new geometry rather than instancing the same cuber over and over. Instead I use array modifiers to duplicate a plane, then apply these modifiers, and parent the cube to the applied mesh, once again using Dupli Faces to handle the duplication of the cube. The difference in render time that this produces is quite something, as demonstrated by the renders below. Because the array modifier doesn’t produce instances, both rendering and creation of the bvh structure are significantly slower than when using Dupli Faces.
Anyway, just thought it was a fun thing to experiment with and also a worthwhile tip to know. So far as I know, both duplifaces/verts and particle systems create genuine duplicates, whilst the array modifier does not. Hope it’s useful and not trivially obvious to all but me!
Edit: Here’s one more fractal-like render. This time an apollonian gasket made up of spheres. I used a development build to get use of the Object Data node, so that I could randomise the colour of each sphere.