my beautiful ashtray
I've frequently been asked to explain how I created the ashtray in this shot, with people being quite surprised at the apparent level of complexity and organic randomness in the various cigarette butts and ash. So I thought I'd share some of my process, and in so doing show that with a bit of planning it's not that hard to create a lot of organic detail! I'm always looking for ways to work efficiently in 3D -- working smart and thinking out of the box are perhaps my greatest strengths.
One of the most obvious ways that this thinking can help reduce workload is looking for scenarios that lend themselves to a modular or template-based approach. The ashtray is a great example of this. By modular, I mean creating a complex asset that can then be duplicated and further modified to create variations. I used this approach here on the cigarettes, ash and matches to get what looks like a massive amount of work (not that it still wasn’t a lot of work!), but in reality wasn’t as much as it might appear.
STARTING WITH THE MASH ASH
The project really began with some experiments in creating the ash. I wanted to see how realistically I could create ash using Maya’s MASH system. So it's MASH ash. MASH is often presented as Maya’s motion graphics module, but it’s an incredibly powerful modeling tool as well.
Every single piece of ash in the scene is created with flecks made from a plain polygonal cube, which I flattened, then mangled using a simple vertex randomization script. This one piece of geometry was then piped into a MASH network. Scale, position and rotation values were randomized with a Random node, while ID and Color nodes were added to allow me to get a variety of shades of gray on individual flecks. With this one piece of geo, and a lot of randomization, I was able to get some pretty convincing looking lumps of ash.
Once I had established this overall methodology, and having saved out a live MASH scene as my source "maker" file, I then further experimented with ways to create pieces of ash that more closely resembled the shapes that you might see in an ashtray. I variously tried using Volume, Grid and Mesh distribution types.
This process was really three steps forward, two steps back, as I honed in on the best method. Using Mesh distribution involved modeling simple shapes and filling them, but I found this wasn’t really necessary. There were pros and cons to all approaches, but in the end the simplicity of a spherical volume worked just fine.
I'd hoped to retain the instancing of the source cube geo, keeping these MASH networks live and nesting them inside a parent MASH network to distribute lumps into the scene. However I discovered a limitation to the MASH system whereby I could not do this and still retain the color randomization on the individual flecks — the parent network treated each lump from the first network as a single point and therefore could not pass along the per-point shading randomization.
Using my MASH “ash maker” I output a bunch of differently shaped lumps of ash. Because they were no longer instances, I was able to create additional variations just by deleting handfuls of individual flecks.
It was therefore necessary to bake/export the variety of ash lumps from the maker file as geometry. This enabled me to keep the vertex ID info and color variations, which was important for the ash shading. This led to heavier scenes than had I been able to keep instancing live, but had the advantage of then letting me duplicate lumps and create further variants by deleting random chunks of individual flecks to create more shapes without having to do it through MASH.
BUILDING THE CIGARETTE RIG
Prior to being smoked, cigarettes are actually all very uniform and similar, the most obvious difference just being their branding and differences in filter pattern and coloration. Since in Maya these things were all going to be handled with texture maps, if I built a master template cigarette that could have texture maps switched out I could create multiple brands from just one model.
But what about all the variations in the butts? I realized if I built a rig into the template that would allow me to bend and distort each cigarette, I could then create multiples and build variations quite quickly.
Modeling the cigarette was straightforward, and the rig itself pretty simple. The main body of the cigarette is just a simple cylinder with lots of edge loops to give me the ability to bend and scrunch pretty much anywhere along its length. A fairly high resolution lattice deformer was added directly to cigarette and filter.
I then created a simple joint chain, to which the lattice was then bound. This gave me the ability to bend the cigarette manually with the joints anywhere up and down its length, in any direction, while I was also further able to pull lattice points around to get more localized deformations for things like squashing the butts. The lump of ash on the end is not inside the lattice but simply parented to the last joint in the chain.
Once I'd settled on five brands of cigarettes, and finished creating the master cig-rig, it was a simple case of saving out a "maker" version of each type of cigarette, editing each to link to the correct texture maps. I then started to build a scene containing a variety of cigarette butts. Importing my various brands of cigarette with namespaces and incrementing as I went (KOOL1, KOOL2 etc.) to avoid naming conflicts, I then set about mangling and "burning" the cigarettes.
First of all I moved the dead ash lump in the hierarchy to figure out how far up the cigarette I wanted it burned. This was simple enough by just sliding it along the length of the joint chain. The position of the ash lump then dictated what adjustments needed making to the shader to create a burned end to the cigarette, and how much of the main body needed to be edited.
I created 10 versions of my five types of cigarettes in one file, deleting history on the rigs as I went to allow me to finish the process of “burning” them and making them all unique with geometry and shader edits.
The master cig-rig was set up to create all five types of cigarette and the ability to “burn” and “stub”.
I'd built in two ramps to the shader to "burn" the cigarette -- one to simply create a black area right at the end of the remaining geo on the cig's body, and another with some noise plugged in to create a second area behind this with falloff for a little bit of sooty dirt to fade off into the unburned section. These were easy to adjust, setting both ramps’ black to white falloff just behind the ash lump.
Next stage was bending the cigarette, if desired, and adding some "stubbed out" deformations to it by scaling the lattice or pulling some of its points around.
It was a very free form organic process, and the only thing I had to be aware of was keeping the deformations looking as hard-edged and paper-like as possible, since in some cases they could look a little soft and rounded, more like cloth than paper folds or creases.
Once I was satisfied with these deformations, I deleted all the history on the cigarette, removed the joint hierarchy, and grouped the geometry and the shader’s 3D texture placement nodes under a locator.
The last stage was simply to edit and remove parts of the cigarette body that were effectively burned away. This just involved deleting faces en masse up to an edge loop just behind the ash, then vertex editing the remaining open end of the body to make it messy and mangled, often using my vertex randomization script. Since these areas were all going to be completely black and burned, they blended in with the ash nicely, so it was not necessary to worry too much about super fine detail.
I ended up with a file containing 10 completely unique cigarette butts — two for each brand of cigarette — and determined that this would be plenty enough to create the illusion of complete randomness in my scene due to different orientations, butts being obscured by the ash, and all the other elements in the scene.
Each one had its own completely unique shading network, so it was then possible to add a further bit of randomization to things such as the noise driving the tar on the filter, since visible duplicates of this may have been noticeable. In the one case of the broken but mostly unburned cigarette, I simply created a lump of ash with a different tobacco-colored shader applied to it and inserted it at the break.
I used a very similar technique to create the burned matches, only this time with a flare deformer built into the rig so that I could create the tapered burned sections. I similarly created four variants of the burned match into a single scene, with history deleted. The unburned match was a separate model.
building the ashtray out
I referenced in my master collection of 10 butts twice, using namespaces to avoid node naming conflicts. Using referencing allowed me to keep the cigarette butts organized and outside of the animation file in case further edits were necessary, as well as keeping the animation file lighter to save and giving me the ability to completely unload all the cigarettes when needed.
It was then just a case of grabbing each butt’s controller locator and positioning it into the ashtray. This was a very organic and free form process — it really didn’t matter what the values were on any of the transforms as placement was arbitrary and nothing was going to animate, so zeroing things out or keeping reproducible values weren’t important. However, I set translate and rotation key frames on the locators, a good best-practice I have found when dealing with a lot of referenced assets.
I repeated this process for the matches, referencing in two copies of the scene containing four variants and placing them roughly throughout the scene. With both cigarettes and matches there were some that I decided I didn’t need, and these were just positioned out of the camera’s view, then placed on a display layer and hidden.
I imported my ash lumps into the scene, and grouped them, duplicated the group, then applied a copy of the original shading network to the second group. The shading network’s diffuse color is driven by a Sampler Info node plugged into the VCoord attribute of a ramp, which reads the color set info from the original MASH Color node. By editing the colors of the ramp in the shader copy, I created a lighter colored version of the ash.
The individual lumps from both groups were then loaded into a MASH network with an ID node set to random. Using a Placer node, I started painting lumps onto the ashtray. I realized it would be better to have a proxy surface to do this, both for efficiency’s sake (it could be a slow process), and to give me control over the overall position of the lumps.
This was the easiest way to avoid too many penetrations of the rendering ashtray. Again, this was not a linear process as I figured out the best workflow, and I circled back several times until I hit on the best approach.
I then created some additional variants of my original ash fleck cube, and plugged these into another MASH network. Again using a Placer node, I painted onto various surfaces in the scene to create finer dust-type ash. With the ashtray I again determined it was better to create a non-rendering copy of the ashtray to paint on, so duplicated it and deleted all of the outside faces, leaving only the interior, the cigarette rest indents, and top edge.
It was sometimes difficult to control where the Placer brush put flecks, and after some testing I found that the simplest way to deal with this is to only keep the faces of your paintable objects that you know you want to paint on.
This keeps things more efficient and avoids having unwanted flecks in places like the outside sides of the ashtray. I really wanted to make the ash dust look as if it had been randomly dropped as much as possible, and also kept in mind that in a real ashtray there would be an order in which the butts had been left and the ash dropped, so some cigarettes and matches would have more of this random ash dust on them than others.
The layout took time, and was a somewhat cyclical process as I painted ash around the basic layout of the cigarettes and matches, then adjusted those to avoid unwanted penetrations. Rinse, repeat. I didn’t get too fixed on a particular result, just on making sure the ashtray looked convincingly full and the layout appeared truly random and organic.
I used a MASH network with a Placer node to paint the large lumps of ash onto a non-rendering copy of the bottom of the ashtray. This allowed me to interactively place the overall level of the ash to avoid penetrations with the ashtray. A separate MASH network, also with a Placer node, was used to paint individual flecks.
WHAT I learned
Overall I’m really happy with the result of this project, however as usual there’s a few things I’d approach differently if I were to do it over.
In particular I could have been more efficient with the ash. I had already output the collection of lumps when I faced up to the fact that I needed to be more efficient and not have hundreds of interior flecks of ash that nobody would see but which were making the scene heavy and slow to render. I did find ways to cull a lot of these interior faces, but it was far from perfect.
If I did it again I would spend more time developing a way to create lumps that only had a layer of ash flecks on the outside thick enough to give the illusion of a solid volume. That said, although the scene became quite heavy, the live MASH distribution of the ash stopped things getting unmanageable, and I was able to render the scene even with millions of faces in it.
If any of this breakdown doesn’t make sense, or you have questions then please feel free to contact me!