Motion Graphics by Jeremy Clark

Author Archive

Recent Radio silence?

Wow, it’s been a very long time since my last post here – my last post was way back in March 2012.

Rest assured that there is indeed a good reason – For in March 2012 I landed myself a full time CG job! I now work at a local Computer Graphics and production house based in Dunedin, New Zealand, doing all sorts of tasks including 3d modelling, texturing, digital painting, planar tracking and compositing. I’m very excited about the experiences I’ve been having, the people I’ve been meeting and the new skills I’ve been acquiring.

Admittedly, this has meant that my own personal projects have taken a back seat. This year I hope to change that though! With the skills and experience I’ve gained within my new professional environment, I’ll hopefully be able to  streamline my own personal workflows, which will in turn make the turnover of my own projects a much more frequent occurrence.

I appreciate anyone who has taken time to stop by and browse my blog. Please know that I’m still very much in love with 3D graphics and digital artwork, despite my radio silence throughout 2012. Stay tuned, there’s more to come this year I promise!



Custom Shaders in Mental Ray and Maya

My “Survival Horror” interior project is quickly becoming an exercise in new lighting techniques in Maya.

I have moved on to experiment with utilizing the Mental Ray renderer’s full funtionality within Maya – not just using it for the final renders of my scenes, but now also using Mental Ray specific Materials, Shaders and Over-rides in the attributes of the objects within my scene.

My first foray into increased Mental Ray implimentation was through using Custom Light and Lens shaders on the lights and cameras in my scene.

Mental Ray Light Shaders

It’s possible to replace the the standard Maya light shaders in a scene with Mental Ray ones. Mental Ray light shaders control light in a way that mimics real world lighting more closely than standard Maya lights.

(Left) A light with standard Maya light shader & (Right) A light source with a Mental Ray custom shader applied. Note the difference in dropoff around the light source.

In order to replace a standard light with a mental ray one:

1.) Open the attributes for any Maya light, and under the Mental Ray > Custom Shaders panels, select to input a new node in the “Light Shaders” box.

2.) With the “Create New Render Node” window open , select Mental Ray Lights > Physical Light.

3.) The original light’s attributes are now overridden by the newly created Mental Ray Light Shader. It is still possible to change the type of light (Spot, Point, Area etc) within the original light’s shape node. To make adjustments to the Mental Ray light’s intensity, dropoff etc, locate the “Physical_Light1” node’s attribute tab.

“Colour” controls both the colour and Intensity of the Mental Ray light. (Intensity set by altering the colour’s “Value” setting.) Increasing the “Threshold” value tightenes the area of darkness surrounding the Mental Ray light. If, for a large scene, an intensity of 1000 is till too dark, you can apply a Mib_Color_Cie_D node into the Colour input of your physical light. This will allow you to overdrive the intensity of the Physical light further.

Mental Ray Lens Shaders

Custom Mental Shaders can also be applied to Cameras to add greater contol to how your Maya scene’s virtual camera interprets light information. To apply a custom Lense Shader:

1.) Select your camera, and in it’s attribues tab go Mental Ray > Custom Shaders. Select to create a new render node next to the “Lesnse Shaders’ box.

2.) From the “Create Render Nodes” window, go Mental Ray Lenses > (Select desired MR Lense Shader).

An example of a useful Mental Ray Lense shader is the Mia_Exposure_Simple node. This node attaches to the camera and offers greater control over exposure, gamma, knee and other settings.

Another is the Mental Ray Bokeh Lens Shader. This is an alternative way to created depth of field in your renders.

This illustrates use of Mental Ray "Bokeh" custom lens shader. The Bokeh shader is a great way of achieving Depth of Field in a render.


Combining Custom Mental RayShaders

It’s also possible to combine custom shaders within a scene. That is, have a custom shader attached to a lens (Lens Shader), and another attached to a Material’s Surface Shader.

For example, by adding a Mental Ray Phsical Light node to a light source, and shine it through a volume that has a Mental Ray Material and Custom Shader Applied, we can achieve the appearance of light passing through “Participating Media”, or airborne particles.

An example of using both custom Mental Ray Light and Material Shaders to render "Participating Media" with a lightsource

One thing worth noting is that volumetric light effects take allot of time to render. For that reason it’s a good idea to utilize render layers, and separate the volumentric effects onto it’s own layer. This way you can isolate it and gain better control, without having to do lots of time consuming renders.

Another example of Volumetric Lighting through the use of Mental Ray Light and Material shaders. Here I rendered the volumetric effects on their own render layer and composited them back into the final image afterwards.

More Indirect Lighting In Maya – Caustics

Within my Film Noir Inspired Lounge scene I also set about learning how to render “Caustics” in Maya and Mental Ray.

“Caustic lighting” generally refers to the patterns of light that are formed when rays of light pass through a transparent material, and are refracted  in a way that patterns appear projected onto surrounding objects. Think of shining a light through a glass of water, and seeing the patterns of light that are produced on the table.

Within Maya, “Caustics” are considered a form of Indirect lighting, as they rely on the use of Global Illumination Photons. For this reason, the workflow for including Caustics in a scene is similar to that of enabling Global Illumination within a render.

Though somewhat straighforward to enable, caustics can be tricky to fine tune, and there are a number of variables that dictate their appearance and quality in a render. Here’s how I implimented them within my scene:

1.) Just like when setting up my Global Illumination lighting, I wanted to keep my Caustic Photon emmitting lights separate from my scene lights. For each light that I wished to appear as if casting the Caustics, I duplicated the light, dropped the cloned light’s “Intensity” to zero, and enabled “Emit Photons” under the new lights “Mental Ray –> Global Illumination and Caustics” attribute editor tab.

2.) Next I jumped into Maya’s “Render Sttings” tab and under the “Indirect Light” tab, I opened the”Caustics” tab and clicked to enable them.

3.) Now came the hard part – fine tuning them to achive a decent enough look. Key settings I tweaked included:

– From the Caustic Light’s shape node Attributes Editor  –> “Mental Ray” –> “Caustic and Global Illumination” dropdown: Photon Intensity (A lower than default value worked well here), “Caustic Photons” (I increaded the number of Photons by 10x the default here), and “Exponent” (I decreased the value from 2.0 to 1.5 here to increase the brightnes of my Caustics patterning.

– Under the “Render Settings” –>”Indirect Lighting” –> “Caustics” tab I set to lower the accuracy from 100 (Default) down to 40. Apparently decreasing the value here is better.

The following depicts two renders of the same lamp, one without , and one with Caustics enabled. Note the patterns formed by the light on the wall behind the glass of the lamp.

This shows a render of one of the lamps in my scene without Caustics enabled.

.. And this is the same lamp, rendered again but with Caustics eneabled.

Though in this scene the effects of Caustics appear somewhat minimal, I still wished to learn about how to use them for a greater understanding of how Indirect lighting works in Maya.

Global Illumination In Maya

My Introduction to Indirect Lighting

Continuing with my Survival-Horror inspired scene in Maya, I’ve started experimenting with different lighting techniques. Having up until this point only utilized simple direct lighting setups to light my scenes, I’ve now moved on to learn more about how to use “Indirect Lighting” to improve the look of my renders.

“Indirect Lighting” occurs when light that is emitted from a direct source (A “Light” in Maya, for example) bounces off of surfaces in the scene. It is from this behavior that this kind of light can also be referred to as “Secondary Light”.

When the light contacts a surface it can take colour from this surface along with it. This newly coloured “secondary” light then lights other objects in our scene.

Global Illumination

The first type of Indirect Lighting that I’ve started to play with in Maya is known as “Global Illumination”. Here light sources are created, and set to “Emit Photons”. These “Photons” travel from the light source and bounce around our scene just like light does in the real world.

It seems that Global Illumination works best if you separate the Direct and Indirect light sources within a scence. Leave the “Direct” lights to provide basic light on objects and cast the scene’s shadows,  and create seperate lights that will emit the Photons required for our Global Illumination.

Therefore we select our “Secondary Light” sources, set their standard “Intensity” to zero (So they do not cast any direct light), but enable “Emit Photons” instead.

Here are two renders of the same scene – one with Global Illumination enabled and one without.

Render withough Global Illumination - Relying only on direct scene lighting.

Render with Global Illumination enabled

Planar Tracking – Mocha Workflows: Part 3

This is my final post about Mocha for a while, I promise. I feel that after honing these skills I’ll have a decent enough grasp on Mocha and Planar tracking to use it freely within my own projects.

Anyways, the following explains my methods for countering two more situations that can make Planar tracking within a shot difficult – both are based around the tracked plane leaving and entering the shot.

Fortunately, Mocha includes several visual aids that can help allign a surface even when it out of shot. (Either partially or even fully.)

Situation 1: Our Tracked Plane Partially Leaves Frame

1.) First, I moved to a point in the footage where the entire plane I wished to track is in Shot. In the case of the first example this was fortunately the first frame.

2.) Next I drew out a spline and carried out the initial track. On the frame where I began the track I then switched on “Surface” and positioned corner pins over corners of the plane. Under “Layer Properties” in Mocha I selected the checker surface pattern. This is a great way to check for distortion.

3.) Next, I switched on Mocha’s “Grid” overlay. (Via the “View Options” panel). The pink overlay grid’s position is relative to the blue “Surface” corner pins.

4.) I positioned the Blue corner pins so that the pink grid was lined up with the edges of my plane. The surface corner points no longer matched the corners of my surface as a result but that’s okay. The pink grid lines form an excellent reference for perspective within the shot.

5.) After playing back the sequence I identified areas where distortion was occurring and found the last frame prior to this where the grid was still alligned with my plane.

6.) I switched on “Adjust Track”, and position my 4 red corner markers on top of the 4 corners of my plane. This created a master frame for my following Adjust Track keyframes.

7.) Next I selected the point in my footage where movement out of frame was at it greatest. Using the pink grid lines and checkered surface patterns as a guide, I positioned the 4 red “adjust Track” markers so that the grid lined up with my surface plane, and that the squares on the checkered surface remained constant with my original reference frame.  An adjust track keyframe was then set.

8.) I moved forward in my footage until  all 4 corners of my plane are back in shot. Here I re-aligned once again, with all four red markers placed once again on top of the corners of my plane.  I set another “Adjust Track” key.

9.) I repeated steps 5-9 every time some of my corner pins left my shot. (Only twice in this example.)

Situation 2: Our Tracked Plane Begins outside the shot, or completely leaves the frame.

This was simple enough to work around:

1.) Instead of tracking the plane from the beginning of the footage, I rather moved along the timeline until I found a point when the plane I wished to track was completely in shot.

2.) I drew a spline around my plane, lined up my surface corners, then tracked first backwards, then forwards from this point.

3.) As my plane was to move in and out of my shot multiple times, I decided to set keyframes for the shape of my spline, each time at a position where my plane was nicely centred in my shot. This was done by moving the spline points into place and hitting “Add Key” under mocha’s “Keyframe Control” panel. Thus my spline had a shape to return to after leaving shot.

4.) With Splines and tracking in place, I enable my checkered surface pattern and my pink overlay grid and alligned them as I did in the previous example.

5.) Finally, I used “Adjust Track” to minimize drift, by adding keyframes just before, during, and shortly after my plane exited the shot.

Check out the following video for the two workflows highlighted above:

Workflows to help conquer difficult tracks in Mocha

Continuing on with my learning up on Planar tracking and Mocha, I’ve come across two factors thta can adversely effect a track. Namely reflective surfaces and drifting. Good news though, for I quickly learnt some techniques to minize such things! Please… read on…

Surface Reflections Throwing of a Track

For a reflective sufrace, use a Cutout exclude refletcive area from the Planar Track. Check out the following images for a brief explaination.

This slideshow requires JavaScript.

Fixing Drifting Throughout Your Track Using “Adjust Track” Mode

Often times a track will drift off target as it moves through the shot. In this case you can use Mocha’s “Adjust Track” feature to nudge the track back on target.

My workflow for doing this is as follows:

1.) Identify the last frame in which your tracked surface is undistorted. (Without any drifting)

2.) Make sure that the “Surface” cornder pins are in place to specify the surface you wish to insert/replace.

3.) Click to enable Mocha’s “Adjust Track” feature. Mocha will then generate 4 red ‘X’s, one at each Surface corner pin. Position these new markers over 4 easily identifyable features on you footage (High contrast areas work best). These 4 red X’s will form the reference points from which mocha will then base your future adjustment tweaks/keyframes to. The offset between the reference markers and the blue Surface corner pins will be maintained – the general procedure is to keyframe animate the position of the red markers, to bump the track in the right direction.

There should also be a keyframe marked on your timeline , this is referred to as the “master frame”.

4.) On your timeline move to where distortion / drift is at it’s worst, and reposition the 4 red markers so they are accurately positioned ontop of what you placed them on top of in step #3. (On top of the same object that they were in the “Master Frame”.

5.) “In-between animate the sections where drift still remains – eventually drift will be minimized!

Check out the following video for a summary of the two planar tracking techniques I’ve described above.

Stay tuned for more!

Experimenting with Planar Tracking

Another skill which I have set out to learn this year is compositing virtual elements into live action sequences.This technique can be referred to as “Tracking”, “Match Moving”, and “Planar Tracking”.

First off, I wanted to learn how to master planar tracking.

“Planar Tracking” is a fairly new technology and gains it’s name from how the system analyzes the source video – It seeks out different ‘planes’, isolating surfaces that can be followed through a shot. The user can define a plane for the computer to follow, and if tracked successfully, the movement of the ‘tracked’ object can be used to drive the motion of newly composited elements, or inverseley to stabilize footage within a frame.

A powerful Planar Tracking program is Mocha, by Imagineer Systems. Once tracking information is derrived from a videoclip within Mocha, it can be used in After Effects to animate the motion of any composited layer. Virtual elements  can use this tracking information to control what is essentially a camera move that mimics that of the original shot, so that the virtual and live action elements appear to have been shot by the same camera.

My Planar Tracking Workflow took this shape:

1. Live action footage was shot with my digital camera and imported  into Mocha as an image sequence.

2. Using “X-Splines” I defined the rough shape of the plane I wanted to be tracked. In this example i used 5 splines, as despite being a square object, 5 points would form a shape that would better describe the movement of the plane throughout the entire shot.

3.  With “Splines” in place I then had to set “Corner Pins”. I only set 4 of these, one in each corner of the square plane I was tracking.

4. With these in place I set Mocha to “Track Forward” from a point in the centre of my footage. With this track completed, I returned to the same point and set Mocha to “Track Backwards”. This centre point that I speak of need not strictly be at the centre the timeline, but rather a point throighout the footage when the plane you want to track is at it’s most flat with the camera.

5. WIth the footage succesfully tracked I then clicked to “Export Tracking Data” from Mocha.

6. In After Effects I opened a new composition that matched the dimensions of my original footage. It’s really important to make sure that Clip Dimensions, Pixel Aspect Ratio and Frame Rate are all the same between your Mocha Track and you After Effects project.

7. I placed my original raw footage (From my digital camera) onto one layer in After Effects, then created a new layer, which would include the elements I wished to “Track” into the shot. In the case of this example I opted for a Text layer.

8. With the tracking information copied to my clipboard from Mocha’s “Export Tracking Data” window, I then simply highlighted my new text layer and “Pasted” the information, making sure that the timeline was set to the beginning of my After Effetcs comp.

And that was it! My new text (virtual object ) now appeared to move with my original (live action) footage. Check out my video above for examples of how this process unfolded. From here I hope to further experiment with this technique, and then eventually move into placing 3D object into a live action scenes through a technique which is referred to as “Match Moving”. Stay tuned, folks!