🌒

BenSimonds.com

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.

>< ><

Left: Duplicated using the Array modifier: 7.51 seconds. Right: Duplicated with Duplifaces: 2.53 seconds.

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.

>< ><

Comments

| BERSERKER | (Jul 05, 2012)

I think the array modifies does not create true instances because it’s options allow for each “duplication” to be potentially different, if for example ‘vertex merging’ option is enabled, or if an object offset with transformations is used.

Anyway, nice tips, good to know how to reduce render times, and your images have a certain artistic and graphical quality to them to. I like it :)

Sebastian Castro Rojas (Jul 05, 2012)

Curious… I thought that the array modifier created instances and in my humble opinion, I think it should. Anyways, it really is useful to know.

kbosher (Jul 06, 2012)

Excellent! I have been just touching the surface of Cycles. Just learning the ins and outs of getting lighting correct and Cycles helps with real time renders.

Dedwarmo (Feb 28, 2013)

Not obvious to me! Thanks for the tip.

Reynante M. Martinez (Sep 04, 2012)

Cycles never fails to amaze me, even more so with experiments like these from artists like you. Thanks for sharing, Ben. :)

-Reyn

Brent Newton (Jun 01, 2013)

I think I understand what ur saying but a blend file would really be helpful.

, , , , , , , , — Jul 4, 2012