Home Creators Posts Import Register Favorites Logout

Downloads

  • gaffer_final.gif
  • close.black.0001.jpg
  • close.red.0001.jpg
  • gaffer74b.png
  • gaffer74b.png
  • gaffer76b.png
  • bhgc_gaffer.gfr

Some files exceed the archive size limit and weren't saved: 7 files. Please note these limits are in place to keep this site running long term, without costing a fortune. You can favorite the creator though, certain milestones increase the limit.

Content

The time has come! We're going to put everything we've learned into practice and create some beautiful final renders of our chess scene. First, let's introduce two new concepts: Context Variables and Spreadsheets.

Gaffer allows the use of variables to control just about every parameter in our scene. We could control displacement height using a variable, geometry paths using a variable, light rotation using a variable, you name it. 

For our scene let's create a few global Context Variables. Open the File > Settings... menu, go to the Variables tab and add three string variables: tex, color and lighting.

Set the value of tex to be the folder on disk where you downloaded the image textures in Part 5 of this series. Give color a default value of black and set lighting to Default.

These new variables can be referenced using the ${<variable>} syntax. For example, we can retrieve the current value of color by referencing ${color}.

Let's explore how this works in practice.

First, we can update all our texture paths to read ${tex}/<image_name>.exr, and, going one step further, update individual pieces to ${tex}/${color}/<piece_name>.color.exr. Using that approach, the path ${tex}/${color}/pawn.color.exr points us to <tex>/black/pawn.color.exr and <tex>/red/pawn.color.exr, depending on the value of color, and so on.

It's clear now why we created tex and color variables, but what will lighting be used for?

To explain that, we need to set up a Spreadsheet.

In Gaffer, Spreadsheets are used to store groups of alternate parameter settings that can then be referenced by name. To showcase this, let's first add an environment light to our scene. Head up to the lights section of the graph and add a new cyclesBackgroundLight. Connect a cyclesEnvironmentTexture to the color input and point it to an HDR image of your choice. Let's animate this 360 degrees around the Y axis over 12 frames, just like we did with the chess set turntable. Don't forget to set the animation interpolation to linear!

Now we've got our original three point light setup plus an HDRI. We don't want them active at the same time, so let's add a spreadsheet that is connected to the intensity of each light. Right click on the intensity parameter of one of the lights and select Create Spreadsheet. 

Name the new spreadsheet light_selector, then right click on the node and select Show Name. Set the Selector parameter to our already-created lighting variable. 

Add the intensity parameters from the other three lights, this time by right clicking and selecting Add to Spreadsheet > light_selector.  

Rename the columns to something more recognizable by right clicking on each one and selecting Set Label... Make sure the Default value is set to the three point lights "on" and HDRI "off."

Add a new row to the spreadsheet and name it env. Set this to three point lights "off" and the background light to an intensity of 1. 

Now we can switch between the two lighting setups simply by changing the value of the lighting variable.

How do we do that? One way is to open up the Settings menu again and type the new value there, but that's not very interactive. Instead, let's add a ContextVariableTweaks node at the bottom of our graph. Add two String slots by clicking the plus icon: one for color (set to red) and one for lighting (set to env). Now all we have to do to switch settings is enable or disable the variable overrides here and the render will automatically update!

Great, now we're ready to render. In this scene we want to output four 12-frame animations (turntable black, turntable red, env black, env red) and two closeup shots (closeup black and closeup red).

Add Outputs nodes for each branch we'll be rendering, selecting Batch instead of Interactive this time. We'll have one branch for the three point turntable, one for the env turntable and one for closeups. Set the image name output for each (#### expands to the current frame number, four digits) and add any AOVs you might want. For simplicity's sake we'll just render out a beauty pass here, but more experienced users can easily add additional outputs such as diffuse, specular, Z, N, etc. Note that we put another ContextVariableTweaks in the env light branch of the graph since we want to override the Default lighting for that sequence of renders.

Connect each Outputs to a Render node and choose Cycles from the dropdown. This will convert each branch in the graph to a task that a Gaffer Dispatcher can execute for us.

To showcase more of Gaffer's power, let's explore how can render everything all at once with only a few clicks.

Connect all our tasks to a Wedge node. This will take incoming tasks and organize them according to rules we set. In this case, we'll keep it simple and tell the Wedge to redo all the incoming tasks with the two different colors. Set the Variable to color, then create a String List and populate it with red and black. This means that Gaffer will render everything twice: once with red pieces and once with black.

Next, connect a FrameMask to the closeup section of the node tree. The turntable and env light renders are both 12 frames long, but we only need one frame of the closeups. By default, the Wedge will render the entire frame range, so we'd end up with 12 identical closeups. We can use FrameMask to limit the closeup part of the graph to Frame 1 only. The Wedge will simply stop processing the closeups after the first frame is finished.

Finally, go to our CyclesOptions node and reduce the adaptive threshold to 0.008. This will give us very clean final images. We can also turn on Depth of Field on the closeup camera. Set the desired F-Stop and Focus Distance on cam_close and then enable Depth of Field in the appropriate StandardOptions node.

Ok.

Are you ready for it?

Connect a LocalDispatcher to the very end of our node tree. Make sure Frames Mode > Full Range is selected, then click Dispatch to submit the job, sit back and relax. 

We can view the job's progress and have the option to terminate it by adding a Local Jobs pane anywhere in the Gaffer interface. (You can add panes by clicking the four squares icon on the top right of any panel.)

That wraps up this Introduction to Gaffer tutorial series! I hope everyone found it educational and that it inspires you to give Gaffer a try in your own projects. If you prefer to use Arnold for rendering, Gaffer has world-class Arnold integration. All the concepts we covered here will apply. 

You can download my complete scene file attached below. Remember that you'll have to update texture and geometry paths to the location of the files on your system.

Enjoy and have fun!

Files

Comments

No comments found for this post.