Renderman – Atmosphere

Short example for creating atmospheric lighting effects in Renderman. Nuke makes an appearance at the end to do some relighting.

Depth of Field – Renderman + Nuke

Math set to ‘depth’ seems to give nice results.

Playing around with PxrSeExpr

This got started from a question on the Renderman forums about the difference between ST and UV. Renderman uses UV and ST to differiate between “implicit” and “explicit” texture coordinates. Implicit is automatically defined by the geometric shape and explicit is manually defined by the user.

With polygons and subdivision geometry, Renderman uses ST coordinates for texture mapping (it converts Maya UVs to Renderman STs behind the scenes). But it also automatically assigns UV coordinates to each face on the geometry, you might ask why would you need this?

For fun and profit!

Heat Map

Useful if you ever want to better visualize data images.

Basic idea is to put the data in the red channel, normalize it between zero and one, then make sure the green and blue channel are both set to one and convert the colourspace from HSV to Linear.

Blackpoint and Whitepoint are set to the minimum and maximum samples from the render. Gain is set to 0.666667 so that the range is mapped from Red to Blue, rather than Red through to Red. HyperLogGamma

Nuke expression reminder to self. Linear to HyperLogGamma and back again.

```r = current channel (r, g, b)
a1 = 0.17883277
b1 = 0.28466892
c1 = 0.55991073```

To HLG

`r > 1 ? a1 * log ((r) - b1) + c1 : 0.5 * sqrt(r`

From HLG

`r > 0.5 ? exp( (r - c1) / a1) + b1 : 4 * pow(r,2)`

Linux for CG – “easily goto directories, even if they don’t exist yet”

Quick little tidbit. This tests to see if a specific directory exists, if it does it goes to that directory, otherwise it creates the directory and then goes to it.

`alias makeshot 'test -d /prj/\$PROJECT/\$SHOT/ && cd /prj/\$PROJECT/\$SHOT || mkdir -p /prj/\$PROJECT/\$SHOT; cd /prj/\$PROJECT/\$SHOT'`

The first part ‘test -d’ checks if the directory exists, the command after && runs what happens if that check is true, the command after || runs if the check is false.

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`

Linear to sRGB

Putting this here for reference, I had this written down as a function to convert from linear light into srgb.

```// encode from linear light to sRGB luma
float sRGB_encode_f(float F)
{
float lin;
if(F <= 0.00304)
lin = F*12.92;
else
lin = (1.055 * pow(F, (1.0/2.4)) - 0.055);
return lin;
}```