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 it’s important to have a real nebula reference image in mind; or else you’ll just continue tweaking attributes without any real measure of when it’s done. With fluids it’s quite easy to run down endless rabbit holes… There are just so many attributes that are interlocked. But it’s 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 it’s 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.

maya scene (using mental ray, vray, maya software) – nebula maker template

Progressive experiments with various attributes.

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.


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) It’s 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.

15 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.

  2. Hi Jason,
    The Nebula scene you created is really awsome. May I know if I can use this Maya scene in our fulldome show? We are now producing our first fulldome show. There may has a scene of nebula fly-by. It will be great if we can use your Maya file.

    • Hi Alex,
      Yes you are welcome to use the nebula in your show. I released this nebula maker template to empower you to create your own nebulae; so I would prefer that you customize it and make it your own instead of just using the nebula included. But its up to you. Also please include a credit to the ‘Charles Hayden Planetarium, Museum of Science, Boston’.

      The nebula maker template is released under Creative Commons: Attribution-ShareAlike license. So this makes the usage terms simple.

  3. Hi Jason,
    Thank you so much and you are so kind for giving us many useful advises and suggestions. I will try to explore your Maya file and create one for ours. By the way, wishing you a very Merry Christmas and a wonderful Happy New Year! May all your dreams for the coming year be fulfilled…. cheers.

    • I’m not familiar with Arnold for Maya, but it looks like Maya fluids are pretty well supported. Check out this collection of helpful tips in the link below.

      It might be that one of the textures is a 3D texture and it may not be supported for use in fluids. So it’s hard to say… But try changing the ‘Texture Type’ within the ‘Textures’ tab of the NebulaFluidShape.

      Also I’m not sure how Arnold for Maya deals with the internal lights of fluids. Check out the ‘Lighting’ tab of the NebulaFluidShape.

      Please share your findings here if you figure it out. Cheers!

      • Hi

        Many thanks for getting back to me

        I took a screen shot of every attribute and rebuilt it in maya 2018.1 and it sort of looks the similar I need more time and I don’t understand all the settings!

        Its never going to work but just fixing Arnold I think unless its my computer which is having issues with fluids

        All the best I will let you know if I make anything interesting

        Kind regards thomas

  4. Hello Jason,
    I love this piece. It looks like the real thing! May I use it as part of my scholarship video and blog posts in the future?

Leave a Reply to Vadim Androussoff Cancel reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s