The Nebula Challenge

One of the most difficult types of space imagery to create is a volumetric nebula. There are three main styles of nebulae to imitate: diffuse nebulae, planetary nebulae, and supernova remnants. The fluid framework within Maya is extremely flexible but it can be very tricky to just get a fluid/emitter set up with settings that are repeatable.

So to ease the cumbersome setup, below is a maya scene for the interactive creation of a fluid nebula. While experimenting with the attributes its important to have a real nebula reference image in mind; or else you’ll just continue tweaking attributes without any real measure of when its done. With fluids its quite easy to run down endless rabbit holes… There are just so many attributes that are interlocked. But its not impossible to tame fluids, you just need to have a goal in mind.

The nebula maker template is initially set up to have the look of a supernova shell because its actually more useful to experiment with. But I’ll share how to adjust the opacity ramp to create a diffuse nebula.

Wade Sylvester, a Science Visualizer here in the planetarium, is a master of fluids, particles, and environment creation. All of this work has been pioneered by his endless experiments and dreams. So with this fluid container/emitter you can create a smörgåsbord of nebulae. Below I’ll outline some of the specific attributes to experiment with.

If you find yourself wondering what a specific attribute does then you should check out the fluidShape article. It is very detailed and thorough.

Progressive experiments with various attributes.
nebula-experiment-progression

DOWNLOAD
maya scene – nebula maker template

What’s Going On Here?
Basically the ‘FluidEmitter’ is emitting a very simple fluid into the ‘NebulaFluid’ container. The ‘NebulaFluid’ container then is further refining that fluid with tons of available attributes. So this tutorial is a deep explanation of how to best control the ‘NebulaFluid’ container attributes.

After the fluid is emitted, it can then be shaded by defining its color, incandescence, and opacity. Then you can further refine the look of the fluid by adding a texture. This is a volumetric texture that is cutting out the fluid to make it look irregular and organic. The texture is not created by the emitted fluid, but is instead a separate fractal system overlaid into the fluid.

First Steps
1) Lets make sure you can preview the fluid in the viewport as best as possible. In the viewport menubar: Shading / click ‘Smooth Shade All’ AND check ‘Hardware Texturing’. This really helps to directly see some of the attributes being changed in the viewport.
2) Lets also make sure to let the fluid computation control how fast the timeline moves: Right-click on timeline / Playback Speed / select: ‘Play Every Frame, Free’
3) Rewind the timeline to 1. Then let it play until around frame 18. You’re welcome to explore anywhere in the timeline. But something to remember with fluids is that they have the most intricate of details right when their emitted. So frame 18 is a place where it has nice density and detail.
4) Experiment with the attributes outlined in the tutorial below.

nebula-fluid-attributes-tutorial

Done? Finalize It
So you’re done experimenting and want to freeze the nebula into place. Now we are going to give the fluid container an initial state and stop emitting fluid.
1) Its very important to make sure that you have a project set. The initial state is NOT stored within the maya scene file. So if you don’t have your project set, then you will likely lose your initial state when next opening Maya and your fluid will instead look blank.
(example location: project/cache/SceneName.mb_fluidShape1.mcfi)
2) If you want to change your fluid Resolution then this is the last chance. But be sure to re-emit via the timeline!
3) Select the NebulaFluid container. Then in the menubar, go to Fluid Effects and click Set Initial State.
(If this doesn’t work then try: Solvers / Initial State / Set For Selected)
4) Then in the NebulaFluidShape tab of the attribute editor and check the box for Disable Evaluation.
5) DONE! Now you can animate a camera and the nebula is locked in place. If you want to animate the nebula, I would suggest experimenting with Texture Time. But any of the shading & texture attributes are still editable and key-able.
(Note: to see any keyed textures in the viewport, you must have the NebulaFluid selected and the attribute editor open!)

Examples of the different types of nebulae that can be created.
nebula-example-renders

About these ads

3 thoughts on “The Nebula Challenge

  1. Wonderful work, Jason and Wade! I’m sure it goes without saying that fluid rendering can be pretty hefty, do you have any particular tricks to speed up the output? I’m usually using 1-4 sample AA, half resolution relative to final output and sometimes getting better results using rasterizer over ray-tracing if volume shadows aren’t necessary (and always hope they won’t be!) but it’s always the most time-intensive of any involved elements when I have fluids in a scene.

    • Thanks Troy! Indeed rendering fluids can be heavy in render times. We only half the resolution if the camera has to actually enter the fluid, which really puts a spike in the render time. But occasionally we will render at 3k instead of 4k for where multiple overlapping fluids are used. Especially since fluids are already blurry and hazy, so not much of any detail is lost in the up-rezzing.

      Yeah I agree, 1-4 sample anti-aliasing is ideal (preview quality presets). Anything higher is wasted render time without any image quality improvement. You are spot on about internal volume shadows (self shadow), those add a huge overhead to render times. I don’t think we even really consider it an option anymore and instead try to add extra texturing details with this in mind. I’ll have to test using the rasterizer as the primary renderer, thats an interesting idea.

      But the main culprit in render times is striking a balance with the shading quality of the fluidshape. This is what helps to remove any flickering or moiré patterns, but it quickly increases render times. So tests are important to understand when any flickering is eliminated. There is a delicate relationship with contrast tolerance in this respect.

    • Also, I recently found some excellent suggustions from an Autodesk rep:

      Optimize fluid render times
      — Use the internal light on the fluid instead of a Maya light, especially if you have a lot of lights, or you are using expensive light types (like area lights). To use the internal light, turn Real Lights off in the Lighting section of the fluidShape Attribute Editor.
      — Lower the Quality setting as needed to speed up preview renders. In general, lower the Quality until you see dotty artifacts, especially along the fluid edges, then increase it a bit. You can then try increasing the Contrast Tolerance. A low adaptive tolerance is useful when you have a fluid with sudden boundaries. Both Quality and Contrast Tolerance affect the shadow quality.
      — Raytracing with Receive Shadows turned on in the Render Stats section of the fluidShape Attribute Editor can increase rendering time.
      — Avoid the Billow Texture Type. Use Perlin Noise instead, with Inflection turned on.
      — Try using the Shading Samples Override attribute in the Render Stats section of the Attribute Editor of the fluid. This may work well when you have a soft edged fluid (a hard edge will need anti aliasing). The fluid might look acceptable with Shading Samples and Max Shading Samples both set to 1. In some cases, this could half the render time.

      Improve fluid render quality
      — Under Shading Quality, set Render Interpolator to smooth for a better rendered look.
      — If you see chatter when rendering an animation, increase the Quality attribute until the chatter goes away (expect renders in the order of 40 minutes for NTSC frames).
      — To eliminate software render artifacts, lower the Density Scale until the artifacts are no longer completely opaque, and the adjust the Opacity curve so that the relative densities of the different parts of the fluid are satisfactory.
      — To eliminate artifacts when rendering with mental ray for Maya, increase the Quality factor under Shading Quality to 2.5, or switch the Sample Method to Adaptive.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s