Creating Fractals in Maya 2013

By , May 7, 2012 11:22 am


This is a fractal animation of a mandelbulb created using fluid effects in Autodesk Maya 2013. It took 12 hours to render this 16 second animation using an 8 core Mac Pro.

Overview

Autodesk Maya 2013 now includes a new 2D / 3D fractal system that can create fun and exciting fractal shapes like a mandelbox or mandelbulb right in your Maya viewport. The system works by using a Maya fluid effects "fluid container" to support rendering the fractal voxels with either a volume render or a hard surface render. You can also create fractal textures in the Hypershade.

Maya 2013 allows you to create complex fractal shapes using a fluid container.

Maya 2013 allows you to create complex fractal shapes using a fluid container.

This is a lantern shaped fractal mandelbulb inside a fluid container.

This is a lantern shaped fractal mandelbulb inside a fluid container.

How to create a 3D fractal in Maya

To use the new Maya 2013 fluid effects based fractals you need to add a 3D fluid container to your Maya scene.

Step 1.

Switch to the Dynamics menu set. From the Fluid Effects Menu, select Create 3D Container.

You need to start with a 3D fluid container.

You need to start with a 3D fluid container.

Step 2.

With the new fluidShape selected switch to the attribute editor. From the Presets* pop-up menu in the attribute editor select a fractal preset. After you apply a preset you can customize the fluidShape attributes to create the fractal look you are after.

Scale the fluid container to the correct size for your Maya scene.

Scale the fluid container to the correct size for your Maya scene.

Apply a fractal preset to your fluid container.

Apply a fractal preset to your fluid container.

At this point you can render the fluid container using Maya's software renderer. It is possible to animate a camera through the fractal shape volume or use Maya's stereo camera feature to render the fractal shape in stereoscopic 3D.

Step 3.

You can also convert a fluid effect based volumetric fractal into a polygon surface. To convert the fluidShape into a polygon mesh go to the Modify menu and select Convert > Fluid to Polygons.

Use the convert menu to convert the fluidShape into a polygon mesh.

Use the convert menu to convert the fluidShape into a polygon mesh.

The mesh is created with construction history enabled so you can edit the fractal settings and the polygon output will be updated parametrically.

The mandelbulb shape is now a standard polygon mesh

The mandelbulb shape is now a standard polygon mesh

Fractal Examples

You can create interesting mandelbox shapes in Maya and see the results interactively in the viewport.

You can create interesting mandelbox shapes in Maya and see the results interactively in the viewport.

This is a red / cyan anaglyph rendering of a mandelbox created using Maya's stereo camera feature. You can click to enlarge the image.

This is a red / cyan anaglyph rendering of a mandelbox created using Maya's stereo camera feature. You can click to enlarge the image.

I rendered the mandelbox stereoscopic 3D image using Maya's software renderer and composited it in Shake.

I rendered the mandelbox stereoscopic 3D image using Maya's software renderer and composited it in Shake.

You can also create 2D fractal textures in the Hypershade using the mandelbrot2D or mandelbrot3D texture nodes.

You can also create 2D fractal textures in the Hypershade using the mandelbrot2D or mandelbrot3D texture nodes.

The 2D textures can be previewed in the perspective view in real-time. Using the High Quality mode in the viewport you can specify the preview resolution of the fractal texture.

The 2D textures can be previewed in the perspective view in real-time. Using the High Quality mode in the viewport you can specify the preview resolution of the fractal texture.

Autodesk Maya includes quite a few fractal presets that show what is possible with the new fractal system.

Autodesk Maya includes quite a few fractal presets that show what is possible with the new fractal system.

You can also use the mandelbrot 2D and 3D fractal textures in the Hypershade as part of a shading network.

You can also use the mandelbrot 2D and 3D fractal textures in the Hypershade as part of a shading network.

This is a 2D fractal that was rendered using the Maya software renderer.

This is a 2D fractal that was rendered using the Maya software renderer.

Animating Fractal Attributes

You can create interesting effects by animating the fractal parameters in Maya. This pulsating mandelbulb fractal animation was created by keyframing the fractal lobe setting in Maya. It reminds me of a fractal heartbeat.

You can create interesting effects by animating the fractal parameters in Maya. This pulsating mandelbulb fractal animation was created by keyframing the fractal lobe setting in Maya. It reminds me of a fractal heartbeat.

If you have enough patience and render power you can animate the fractal attributes in Maya. During my initial tests it took my 8 core Mac Pro system 2 minutes to render a 1920x1080 fractal image using the Maya Software Renderer.

My first fractal animation test was to create a camera animation. I flew the camera close to the mandelbulb fractal surface and explored around the perimeter of the mandelbulb shape in a 384 frame sequence. You can view the animation at the top of this blog post.

You can keyframe animate fractal attributes in the attribute editor.

You can keyframe animate fractal attributes in the attribute editor.

My next test was to animate a the shape of the fractal. I keyframed a few attributes like the lobe attribute, the color ramp, and the frequency attribute. You can scale the size of the fractal inside the fluidShape node by changing the Zoom Factor attribute. The Zoom Factor will also change the color of the fractal if the fractal texturing is driven by the "Center Gradient" color input.

I found it helpful to adjust the Color Input Bias attribute over time to maintain the look of my fractal texture. When the scale of the fractal changed over time the tips of the fractal lobes would become brighter or darker based upon the point's distance from the fractal origin and the corresponding location applied from the color ramp texture.

When texturing fractals the Center Gradient Color Input is very flexible.

When texturing fractals the "Center Gradient" Color Input is very flexible.

It is possible to create dynamic shading on the fractal geometry by keyframe animating the selected color values on the fluidShape color ramp.

It is possible to create dynamic shading on the fractal geometry by keyframe animating the selected color values on the fluidShape color ramp.

You can move / scale the whole fractal object in your Maya scene by translating the fluid effects fluidShape node.

It is also possible to translate the raw fractal points inside the fluid shape by changing the Texture Origin attribute. You can rotate the fractal points inside the fluid shape by changing the Texture Rotate attribute. If you textured your fractal shape using the "Center Gradient" color input you will notice the texture origin / texture rotate options will move the raw fractal points separately from the color shading applied to the fluidShape node.

Don't forget to do a Playbast in Maya to test your fractal animation before committing to a final Maya Software render that will take hours!

Animating the fluidShape1.color Ramp Attribute

A nice feature of Maya's fluid based fractal system is the support for animated colors. With the help of keyframe animation techniques you can use keys to change the fractal color and texture placement over time.

let's start by selecting the fluid shape. Expand the fluid shapes' Shading section and then the Color section in the attribute editor window.

Fractal Color Attributes

Animating the Selected Color Attribute

Let's animate a ramp color value. The Selected Color attribute allows you to animated any of the colors shown in the ramp window.

To choose a color on the ramp, move your cursor over the gradient area and select the ramp's circular control handle for the color you want to animate. The current color that is shown in the Selected Color swatch updates based upon the last ramp control handle you clicked on.

Start the animation on frame one in the timebar.

To keyframe animate the color values, start by setting Maya's playhead to the starting frame of your animation. In this case the playhead is on frame 1.

In the attribute editor, right click on the words "Selected Color". In the popup menu select "Set Key". This will set a keyframe for the current color value shown in the swatch.

Set a key on the Selected Color attribute.

Set a key on the Selected Color attribute.

To animate a color value you need to have set two or more keyframes.

Let's move the playhead to the next point in our animation. In this case I set the playhead to frame 12.

Move the playhead to the next point in your animation.

Move the playhead to the next point in your animation.

Click on the selected color swatch and select a new color in the color picker. At this point a we haven't set the 2nd keyframe for the color value.

Select a new color in the color picker window.

Select a new color in the color picker window.

After you close the color picker, right click on the words "Selected Color". In the popup menu select "Set Key".

By setting two keyframes a new animation curve has been created for the Selected Color attribute. The first keyframe is on frame 1, and the 2nd is on frame 12.

Set a key on the Selected Color attribute.

Set a key on the Selected Color attribute.

When you drag the playhead in the timebar you will see the color values change in the viewport. If your fluid shape is set to a high resolution you may want to use a playblast to preview the effects of the color animation.

If you want more control over the Selected Color keyframes you can view the animation curves by clicking on the triangle shaped button to the right of the swatch. A new editor window will appear in the attribute editor that will let you change the keyframe time and value settings using a table style layout.

Also, if you want to visually edit the fractal color animation curves you can use the graph editor.

Animating the Selected Position Attribute

You can also animate the position of the colors in the ramp by keyframing the "Selected Position" attribute. It is possible to adjust the location of the colors in the ramp by by dragging the circular ramp control handle left or right or by changing the Selected Position value numerically (with a value ranging from 0 to 1.0) with the text field.

Let's animate the selected position attribute. Move the playhead in the Maya timebar to the starting frame of your animation. In this case I'm starting on frame 1.

Start the animation on frame one in the timebar.

Start the animation on frame one in the timebar.

Open up the attribute editor, and right click on the words "Selected Position".

In the popup menu select "Set Key". This has set the first key for the Selected Position attribute.

The selected position value can be used to move the location of the color on the fractal shape.

The selected position value can be used to move the location of the color on the fractal shape.

Advance the playhead to the next point in your animation. In this case I'm on frame 12.

Move the playhead to the next point in your animation.

Move the playhead to the next point in your animation.

Slide the ramp control handle to a new position on the ramp. Right click on the words "Selected Position". In the popup menu select "Set Key".

Set Key

This has set a 2nd key on the Selected Position attribute.

If you have a lot of gradient colors in your ramp texture the ramp window might be too small to use. You can click the arrow icon to the right of the ramp pattern to open the ramp up in a larger floating window.

You can expand the ramp window when you need more control.

You can expand the ramp window when you need more control.

When you use the expanded ramp control window, the keyframing controls work the same way as in the attribute editor. You can use the same right click technique with the Selected Position and Selects Color attributes to add your own keyframes.

The expanded ramp editor window makes it easier to add multiple ramp colors to a gradient.

The expanded ramp editor window makes it easier to add multiple ramp colors to a gradient.

At this point, when you scrub the playhead in the Maya timeline you will notice the changing color of the fluid shape.

If you want more control over the Selected Position keyframes you can view the animation curves by right clicking on the word "Selected Position" and selecting the first option in the pop-up menu which in this case is called fluidshape1_color_0_color_Position.output.

You can edit the keyframe values numerically in the animation curve editor.

You can edit the keyframe values numerically in the animation curve editor.

A new editor window will appear in the attribute editor that will let you change the keyframe time and value settings using a table style layout.

The curve editor will let you control the timing and keyframe values precisely.

The curve editor will let you control the timing and keyframe values precisely.

Rendering Animated Fractals

For the best results you need to render your fractals with the "Maya Software Renderer".

Also it appears you need to force Maya to recompute the fluidShape node between each frame of your animation if you keyframe animate the shape of the fractal. I haven't spent a lot of time exploring the best way to do this. For the pulsing fractal GIF animation above I opened the render settings and set the animation to skip frames when rendering with the by frame attribute. This automatically caused Maya to update the fluidShape on each rendered frame in the sequence because of the frame skipping.

I used the by frame option in the Render Settings to skip frames in the fractal pulse animation.

I used the by frame option in the Render Settings to skip frames in the fractal pulse animation.

Other solutions to force Maya to recalculate the fluidShape node on each frame of an animation would be:

  • In the render Settings window under Render Options you might be able to use the Pre render frame MEL field to update the FluidShape before rendering the next frame. (I haven't explored this option yet)
  • You could use batch rendering software like Smedge to reduce the size of your batch render "slices" to individual frames. This would relaunch the Maya "render" program on every single frame of your animation, which would force Maya to recalculate the fluidShape.

 

Print Friendly

flattr this!

7 Responses to “Creating Fractals in Maya 2013”

  1. Alex says:

    But the fluid do not support dome production, right?

    We need mental ray to set a fisheye view, most plugins are not supported. It's true

  2. Andrew says:

    If you wanted to render the volumetric fractal content to a fulldome fisheye format in Maya you have two options: You could use the Maya Software Renderer and render to a hemicubic format or convert the fractal fluidShape into a standard polygon mesh that could be rendered with any rendering engine in Maya.

  3. Matt says:

    Are these animate-able in any way?

  4. Andrew Hazelden says:

    Hi Matt.

    Thanks for your interest in my blog post about Creating Fractals in Maya 2013. I updated the blog post to include details on creating fractal animations in Maya.

    It is easy to animate flying camera paths around the fractal. However if you use keyframe animation to change the fractal shape over time you need to force the fluidShape node to update on each frame of the animation.

    Regards,
    Andrew

  5. [...] de fluides. Ci-dessous une animation de 16 secondes qui a nécessité tout de même à son auteur 12 heures de rendu sur un mac 8 [...]

  6. Fractal Freak says:

    Hi Matt.

    This is a great tutorial. But How did you get to the fractal lobe setting or the color input bias? I want to try animating the shapes. But I don't see it under my Fluid shape attributes.

    Thank you again for this post!

    Best,
    Chuck

  7. Andrew Hazelden says:

    Hi Chuck.

    I wanted to let you know that I updated the creating fractals in Maya blog post with more details on animating the fractal attributes. You should be able to access all of the fractal settings once you add a fractal preset to you fluid shape.