Renderman Denoising

A few little tips and tricks for Denoising stuff in Renderman…

Most of this comes from here… https://renderman.pixar.com/resources/current/RenderMan/risDenoise.html, you’ll need to make sure your environment variables are set correct to do this in the shell.

Note: This is using Windows, a lot of it is similar to Linux/Mac, there might be some syntax differences.

For all examples, we have a directory which contains the following image sequences…

RIS_denoised_variance.####.exr (the main render pass)
RIS_denoised_variance_directdiffuse1.####.exr (key light diffuse)
RIS_denoised_variance_directdiffuse2.####.exr (environment light diffuse)
RIS_denoised_variance_directspecular1.####.exr (key light specular)
RIS_denoised_variance_directspecular2.####.exr (environment light specular)

To denoise several frames (0001-0007) of the beauty render using single-frame denoising. Include the { } brackets around the frame numbers, wildcards * don’t seem to work for me in Windows.

denoise RIS_denoised_variance.{0001,0002,0003,0004,0005,0006,0007}.exr

To denoise the same seven frames (0001-0003) using cross-frame denoising.

denoise --crossframe -v variance RIS_denoised_variance.{0001,0002,0003,0004,0005,0006,0007}.exr

To denoise the AOVs as well, only on three frames this time…

denoise --override filterLayersIndependently true -- RIS_denoised_variance.{0001,0002,0003}.exr RIS_denoised_variance_directdiffuse1.{0001,0002,0003}.exr RIS_denoised_variance_directdiffuse2.{0001,0002,0003}.exr RIS_denoised_variance_directspecular1.{0001,0002,0003}.exr RIS_denoised_variance_directspecular2.{0001,0002,0003}.exr

 

VFX and Animation by some Numbers

If you’ve ever wondered how big the VFX and Animation industry is – this might give you some idea – and I have no idea how accurate this is.

I searched Linkedin for the most visible studios in the industry and recorded down how many employees were listed for each studio. Keep in mind a few things…

  • This only includes employees who are on Linkedin.
  • Relies on people entering the correct name of their employer and/or keeping their information up-to-date.
  • If your wondering why Lucasfilm is on there – lot’s of ILM people put it down as their employer (it technically is I guess). Impossible to know how much of those are ILM people versus other Lucas companies.

vfx_employees_on_linkedin

 

Text Values in Nuke for Wedge Renders

This is more a reminder for myself, as I can never remember the syntax for outputting values to Text nodes in Nuke.

Strength [format %0.2f [value strength]]

Often use this when doing wedge renders during lookdev. A wedge render is a render where you render several frames of the same thing but only change a few specific values to see what effect the change has.

nukewedge

A few things to note…

  • In this case the “strength” attribute to look up comes from a custom user knob on the same knob.
  • The format %0.2f statement is used to format the value. See the printf reference for more details.

nukewedge1

Batch – Using ffmpeg to create DNxHD quicktimes

Recently been going over my reel footage and decided it was time to convert everything into the same format, rather than have a collection of different AVI and MOV files all with different codecs.

I decided to go with Avid DNxHD36 as it plays and edits nicely on my machine.

I’m using the following windows batch file to drag n’ drop the files I want converted onto. They then go to a folder for sorting.

@echo off
if [%1]==[] goto :eof
:loop
ffmpeg -i %1 -vf "scale=1920:1080" -vcodec dnxhd -r 23.976 -b:v 36M "d:/media/dynamic/%~n1.mov"
shift
if not [%1]==[] goto loop

Works pretty good, only issue is it only works for footage which is or is-supposed-to-playback-as 16:9.

Linux for CG – Setting Up The Command Line

The command line (or unix shell) seems like one of the most archaic way possible to interact with a computer file-system. However most animation and vfx studios require that artists know the basics of interacting with the command line.

There are different types of command lines available, two of the more common are bash and tcsh.

Setting up the tcsh prompt

I primarily use tcsh, so I’ll start with setting it up so it’s more user-friendly. When you start using the default command line, it normally looks pretty dull…

Linux ShellI have my shell setup like so…

Linux ShellIt contains a bit more information. It contains my username (will), hostname (will-A8HE), the time and date as well as what directory I’m currently in. I’ve also put the prompt (>) on a new line, this gives me more real estate when dealing with long paths or filenames.

You can control this behaviour by setting up a .cshrc file (also sometimes called .mycshrc). This is a text file which stores information about how you want your shell setup. The first part of my .cshrc looks like this…

# Colors! This makes it easier to edit the colours on the prompt.
set     red="%{\033[1;31m%}"
set   green="%{\033[0;32m%}"
set  yellow="%{\033[1;33m%}"
set    blue="%{\033[1;34m%}"
set magenta="%{\033[1;35m%}"
set    cyan="%{\033[1;36m%}"
set   white="%{\033[0;37m%}"
set     end="%{\033[0m%}" # This is needed at the end... 🙁

set prompt="\n%B${green}`whoami`@`hostname`${white}%b %P %D/%W/%y ${blue}%// \n ${white}> ${end}"

# Clean up after ourselves...
unset red green yellow blue magenta cyan yellow white end

This sets up the prompt and because it’s quite awkward setting up colours, we’ve set some variables to make things easier. The hash (#) is used to add comments to the .cshrc file and get ignored by the shell.

The set prompt line can be broken down as follows..

  • \n Start a newline.
  • %B Make the text bold.
  • ${green} Make the text green.
  • `whoami` List my username.
  • `hostname` List my hostname (computer name).
  • ${white} Make the text white.
  • %b Make the text not-bold.
  • %P Time in 24 hour format.
  • %D Date.
  • %W Month.
  • %y Year.
  • ${blue}
  • %/ The current working directory.
  • \n Start a newline.
  • ${white} Make the text white.
  • ${end} End colour.

 

For a more complete listing of all the ways you can modify the prompt, see this page. Next up a few variables to set how the prompt behaves.

set filec
set autolist set color set colorcat
set nobeep

The first of these (filec) enables filename completion, the second (autolist) lists possible options for filename completion and the third (nobeep) stops the command line beeping at you. If you start typing the name of a file and press tab it either completes the name of the file or lists what options you have available. For example if there is only one file in the current directory which starts with ‘a’ and you press ‘a’ then ‘tab’, it will complete the filename for you – saving you from typing. If you have two filenames starting with ‘a’ like ‘andy’ and ‘andrew’ it will complete ‘and’ and list both filenames, press ‘y’ and ‘tab’ and it’ll complete ‘andy’, press ‘r’ and ‘tab’ and it will complete ‘andrew’.

Aliases

The alias command is a command which can be used to setup custom commands. For example I often setup up commands like ‘myren’ or ‘myscripts’ to quickly jump to my render folders or mel/python scripts folder.

alias ll 'ls -lh --color=auto'
alias lr 'ls -ltrh --color=auto'
alias duho 'du -h --max-depth 1'
alias resource 'source ~/.cshrc'
alias remwhite 'rename "y/ /_/" *'
alias copy 'rsync --progress'
alias mydev 'cd ~/Develop'
alias myren 'cd /prj/$PROJECT/$SHOT/maya/renders'

The first two list the contents of the directory, (ll) lists them in alphabetical order, (lr) lists them in descending time with the most recently modified file at the bottom. (duho) reports back the disk-usage of the current directory. (resource) is used to restart the shell to pick up any changes or new aliases I’ve added. (remwhite) removes whitespaces from any file names in the current directory. (copy) is similar to (cp) in that it’s used to copy files from one place to the other, however rsync gives you a progress meter so you know how long the file is going to take. (mydev) changes the directory to my local Develop directory, while (myren) relies on an environment variable called $PROJECT and $SHOT to be set, this allows me to change to the correct render folder depending on what project and shot I happen to be working on.

Most studios have their own environment variables setup, so you can normally reference those by using the (env) command in the shell to list all the environment variables available. To set up environment variables you can use (setenv), how the env variables are stored is dependant on where you set them. In my .cshrc I have these setup to affect any shell I open.

# Setup env variables for OpenEXR viewers.
setenv EXR_DISPLAY_VIDEO_GAMMA 2.2
setenv CTL_DISPLAY_CHROMATICITIES "red 0.6400 0.3300 green 0.3000 0.6000 blue 0.1500 0.0600 white 0.3127 0.3290"

If you want to just affect the current shell your in, you can type these out or use aliases to set variables.

# Set which project and shot I'm working on.
alias setshot 'setenv PROJECT \!:1; setenv SHOT \!:2;'

(\!:1) and (\!:2) are command lines arguments. Now when I type…

setshot myproj myshot

I now have two env variables called $PROJECT and $SHOT that my (myren) alias can reference.

# So this command...
myren
# Is the same as running...
cd /prj/myproj/myshot/maya/renders

My final .cshrc file looks something like this…

# Colors!
set     red="%{\033[1;31m%}"
set   green="%{\033[0;32m%}"
set  yellow="%{\033[1;33m%}"
set    blue="%{\033[1;34m%}"
set magenta="%{\033[1;35m%}"
set    cyan="%{\033[1;36m%}"
set   white="%{\033[0;37m%}"
set     end="%{\033[0m%}" # This is needed at the end... 🙁

# Set up the prompt...
set prompt="\n%B${green}`whoami`@`hostname -s`${white}%b %P %D/%W/%y ${blue}%// \n ${white}> ${end}"

# Clean up after ourselves...
unset red green yellow blue magenta cyan yellow white end

# Set shell behaviour...
set filec
set autolist set color set colorcat
set nobeep

# Setup aliases...
alias ll 'ls -lh --color=auto'
alias lr 'ls -ltrh --color=auto'
alias duho 'du -h --max-depth 1'
alias resource 'source ~/.cshrc'
alias remwhite 'rename "y/ /_/" *'
alias copy 'rsync --progress'

# Setup environment variables.
setenv EXR_DISPLAY_VIDEO_GAMMA 2.2
setenv CTL_DISPLAY_CHROMATICITIES "red 0.6400 0.3300 green 0.3000 0.6000 blue 0.1500 0.0600 white 0.3127 0.3290"

# Setup alias for which Project and Shot I'm working on.
alias setshot 'setenv PROJECT \!:1; setenv SHOT \!:2;'

Linux for CG – APT

APT (Advanced Packaging Tool) is a collection of tools to install and manage software packages on Debian and it’s various off shoots (for example Knoppix and Ubuntu). Much like installing software on other operating systems, a package can contain multiple executables (programs).

Some useful packages for CG work include..

In order to install these packages, these are the typical steps that one needs to go through.

Note that APT requires superuser (administrator) privileges which means you have to prefix the sudo command in front of the command. It’s likely if your an artist in a large CG studio that you won’t be a superuser, so these instructions only really apply if your wanting to setup linux at home or in a small studio environment.

The first thing you need to do is get an up-to-date list of all the available packages from the internet.

> sudo apt-get update

The next step is to search for the name of the packages your interested in. APT allows you to do simple word searches for packages

> sudo apt-cache search [package]

Once you’ve found the package your after…

> sudo apt-get install [package]
ie... sudo apt-get install openexr

If the package exists it will download and install the package on your computer, ready to go – no need to restart the computer. Although sometimes you may need to open a new shell in order to pick up any changes. Once that’s done you can upgrade any existing packages on your system by using…

> sudo apt-get upgrade

As an illustrated example, to install the openexr commands you’d run the following series of commands…

> sudo apt-get update
> sudo apt-cache search openexr
> sudo apt-get install openexr

To check if it’s installed the openexr commands correctly try run either exrmaketiled or exrstdattr on the command-line.

 

 

 

OSL – BlackBody Colour

This node outputs a normalised colour given an input temperature in degrees Kelvin. This can be used as an input for lights to give the effect of different colour temperatures.

Download Here

BlackBodyColour Controls
BlackBodyColour Controls
  • Temperature: Temperature in degrees Kelvin.