home about gallery publications education links contact

..::oil slick::..

The trick to get this effect looking realistic is getting the shape, colours and intensity correct, and this can only be achieved by actually viewing the effect in real life (and taking pictures if you have a camera handy!)... a quick jaunt down your local scrapyard (or stick some water in a tray and bung it under your car for an hour!). Alternatively, a quick Google image search will yield a scattering of results, some (obviously) better than others.

Analysing the reference material, we notice that the shape itself is quite inconsistent, with large patches of colour and, in contrast, thin streaks also. There is also quite a variation in colour distribution, but 9/10 times the colours that are distributed are in the same “order”. Now, you would think that you would get a kind of rainbow effect, and you do to a certain degree, however there are one or two additional colours to contend with; one which is normally central to the colour distribution and one normally situated on the outside of the “spectrum” which dissipates into surface water. Generally, the colour order (inside to out) is White/Cyan, Cyan, Blue, Purple, Red/Orange, Yellow, Yellow/White, with White/Cyan in the centre and Yellow/White on the exterior; this colour scene is included on the cover CD-ROM as a gradient settings file which can be loaded into a Gradient Ramp map, as illustrated in the Walkthrough steps opposite.

To distribute the colours properly, we are going to be using a Mapped gradient type, which distributes the gradient’s colours depending on the underlying map colour intensity. In order to get this looking right (with the large patches of colour variation and streaks) we are going to be using two types of underlying map – a Noise map to generate the patches and a Perlin Marble sub-map contained within the Noise map to mask out areas of the Noise map and additionally generate the desired streaking effect.

By going back to the reference material, we notice that some colours are more intense than others; this is normally due to their brightness – lighter colours (yellow, cyan etc) will be more prominent than darker (purple etc) colours. To simulate this we will use a Mask map to mask out the designed Gradient Ramp map with itself. This therefore ensures that lighter colours will be more prominent in the final render.

The oily water material will also have a high specularity and reflections (masked with a Falloff map) and will be overlaid directly onto the desired surface – in this case an asphalt material, using a Shellac material set to a value of 100 so there is no additional material addition (intensity) to the base material. To confine the oily water material to a specific area, therefore creating a puddle, we will have to introduce an additional map or two to mask certain aspects of the water material. The colour swirls themselves will have to masked out, else the colour will continue outside the puddle boundary, as will the reflection map and Specular Level; we will get a continuance of specular highlight and reflection over the rest of the Asphalt material, even if we reduced the opacity of the material right down to 0! We can also use this map in the Bump’s map slot with a negative setting (therefore creating a raised bump effect) to suggest an edge to the water and a slight bleed into the underlying surface thanks to a dithered “edge” to the noisy radial gradient used to create the puddle.

The final scene, complete with skydome, sunlight and skylight, generates an effective result thanks to the subtle use of oil-swirl colour (thanks to our reference material) and reflected environment objects which complete the effect. For added realism, try adding some oily rocks or stones on the surface and try to collate some of the colour effect around these objects, bearing in mind that the effect will be more intense around these areas.

Enlarge Screenshot Open the oilslick_start.max file included in the resources zip file below. Our basic scene consists of a single plane with an asphalt material assigned, a pitted chrome teapot and a skydome to so that any reflections assigned will reflect the environment. We also have a basic exterior lighting setup with a single direct light and a skylight.
Enlarge Screenshot Open the material editor, add a Shellac material to the Concrete_Asphalt material and select Keep old material as sub-material when prompted. Set the Shellac Amount to 100. In the Shellac material slot, label the material Rainbow Slick, set the Specular Level to 150, Glossiness to 100 and Opacity to 15. Add a Mask map to the Diffuse slot and label it Swirl Puddle.
Enlarge Screenshot Add a Gradient Ramp map to the Mask slot and label it Puddle Mask. Set the Map Channel to 2, turn off U and V tiling, set the flag at position 0 to white, move the flag at position 50 to position 55 and set it to white, add a flag to position 60 and set it and the one at position 100 to black. Set the Gradient Type to Radial, Interpolation to Ease Out, Noise Amount to 0.2 and Size to 2.5.
Enlarge Screenshot Add a Mask map to the Swirl Puddle Mask map’s Map slot and label it Swirl Puddle. In the Map slot of this new Mask map, add a Gradient Ramp map and label it Swirl. Right-click the gradient and load in the designed oilslick_gradient file. Set the Gradient Type to Mapped, Noise Amount to 0.1 Type to Turbulence, Levels to 10, and Size to 1.76. Add a Noise map to the Source Map slot and label it Swirl Shape.
Enlarge Screenshot Set the Noise Type to Turbulence, Size to 100, High to 0.6, Low to 0.2 and Levels to 10. Add a Perlin Marble map to the Color 2 slot and label it Swirl Streaks. Set the Size to 107, Levels to 10 and set Color 1 to white and Color 2 to black. Instance the Swirl Gradient Ramp map in the Mask slot of the Swirl Puddle Mask map. Back at the top of the Rainbow Slick material, set the Diffuse colour to black.
Enlarge Screenshot Instance the Puddle Mask map into the Specular Level and Bump slots, and set the Bump amount to -50. Add a Mask map to the Reflection slot and set its amount to 60. Add the Puddle Mask map to the Mask slot and add a Falloff map to the Map slot. In the Falloff map, add a Raytrace map to its Side slot.
Enlarge Screenshot The final rendered image, complete with wheels in situ, gives a nice result when mixed with a shellac material to create an oily puddle.
Download the max file! Zip file to accompany.


Map Channel ID 2 was used so that we can position the puddle wherever we want to in the scene by simply amending the position of the UVW Map modifier’s Gizmo; otherwise we would have to offset the position of the puddle mask which is more difficult and may also result in clipping...

... however, if you wanted to apply the oil slick effect to an entire surface, this UVW Map modifier could be removed as we would not need the additional masking to confine the diffuse, specular level, bump and reflection to a certain areas. A slight re-work of the material’s structure would be required to remove the masking, but it is not all that taxing.

To add additional realism to the effect, try distorting or animating the rainbow effect as it grows over the surface of the puddle. To simulate this, try animating the Phase of the Swirl Gradient Ramp map and the Swirl Shape and Swirl Streaks maps ever so slightly as this effect should be very subtle!

Not simply confined to a liquid surface, try applying this effect to other materials, such as a soap bubble or a chrome metal with oil applied. Again, the material setup will be very similar, although you will need to remove the puddle masking. As the entire setup is procedural and dependant on Object XYZ mapping coordinates, you won’t get any texture stretching, but you may need to resize the maps that drive the shape of the rainbow effect depending on the size and scale of the object the material is applied to.

Initially published: 3D World magazine, Issue 57, November 2004.

Copyright Pete Draper, November 2004. Reproduction without permission prohibited.