Created by Christos Obretenov

@ Lollipop Shaders

Tutorials | Shader Writing

Shader Writing


In this series, we will be exploring the technical side of rendering with RenderMan by taking a "how-to" approach to the lessons. The classes are extended with technical breakdowns, explainer diagrams, and renders. We also dive into sessions in Maya to show the lessons in action!

Even though this training has been designed using version 21, most concepts are directly applicable to version 22.

Video List

  • Class 10 - Comparisons

    In our final class of this course we develop a new algorithm, a layered fbm noise, that we implement in all 3 languages of this course: se expressions, OSL, and C++ pattern nodes. We then have a starting point for doing some comparison tests to see which renders faster, is easier to code, more versatile, and the pro's and cons of all 3.

  • Class 09 - Patterns in C++ Part 2

    We continue programming our first pattern from class 8, exploring the distinction between uniform and varying parameters for upstream connection, and some gotcha's to eliminate artifacts and getting new parameters setup correctly with GetParamTable and the enum data structure for paramId. Continuing with some useful utility for our custom pattern node, we show how to read a custom primvar attribute such as our MatteID, and writing to a custom AOV. We can do the same with some "builtin" variables such as curvature, surface normals, derivatives, and others.

  • Class 08 - Patterns in C++ Part 1

    We now jump into C++ Patterns! Since there is a lot of overhead for writing and compiling C++ patterns, we start off with the simplest possible example by just setting a color that is connectable upstream. First an overview in Maya how it fits into our existing Kitchen scene file shader network, then we jump in to the user interface .args file to setup the parameters and register our custom node in RenderMan for Maya. We then jump into the .cpp code and show the overhead setup for a Pattern node, then where the custom stuff happens inside our shading context loop. We need to compile our C++ pattern so we go through that on OSX/Linux, then in Windows via the Cutter program used earlier in this course. We finish up this lesson with an overview slide and showing how we can also connect our custom OSL patterns made earlier in this course into our newly created C++ pattern node, all in the hypershade node editor.

  • Class 07 - OSL Part 4. Shader Metadata & Registering Plugins

    The next step in our OSL shaders progression is adding shader metadata for more useful user-interface options, but this requires us some setup steps to "register" our plugin with RfM. The good news is once we set this up we are good to go for all future custom plugins, including C++ patterns, bxdf's, integrators, etc. This class shows you how to setup your dev environment for all these plugins for yourself or the whole studio, in OSX/Linux/Windows.

  • Class 06 - OSL & PxrOSL Part 3

    "Understanding Projections" is the theme of our 3rd class in OSL, and we cover ST, UV projections, then move onto transforming our point P into Screen/NDC projections and finally triplanar. We do all this from scratch in OSL on our recurring Kitchen scene, and show the results of these projections using 3 examples:

    1. The useful ratGrid.tex
    2. A simple sketch texture mixed with an upstream pattern PxrDirt
    3. The beauty render using Pixar128 library textures fed into our OSL and PxrSurface

    We also show how we can plug in any pattern upstream from our OSL, like PxrDirt or Curvature, then manipulate it in our OSL, then output it to PxrSurface BxDF.

  • Class 05 - OSL & PxrOSL Part 2

    In our 2nd class on OSL we jump back into our kitchen scene (from Class 3) and take the exact same Se Expressions we created to drive the displacement and noise on the soapbubbles material with iridescence thin film, and convert those to OSL. Converting our previous Se Expressions to OSL gives us a great understanding of the differences of those two types of programmable patterns. We then introduce the concept of procedural variation by assigning a random color MatteID to each object in the scene, and reading that attribute in our OSL. Once we have this random tag on each object, the world is our oyster in what we want to do with it in the OSL: procedurally vary for each object the noise that drives dispalcement, soapbubbles thin film thickness noise, anything we want. We then take this same workflow into the oak OSL shader introduced in the last class, and modify it to vary the ring frequency and wobble frequence as well as color of our oak wood shading. We also demonstrate on the carbonfibre shader using the same technique varying the mesh pattern and diffuse color.

    Sections:

    1. Intro
    2. SeExpr to OSL noise()
    3. Random MatteID on objects
    4. gettattribute()
    5. Procedural Variation on frequency
    6. Procedural Variation on oak.sl
    7. Procedural Variation on carbonfibre.osl
  • Class 04 - OSL & PxrOSL Part 1

    We morph into the second big topic of Course 2: OSL with PxrOSL. In our first class we get the history, intro, and basics out of the way then show our way around PxrOSL with Maya, writing 2 simple OSL shaders from scratch, compiling them, and loading them in Maya/PxrOSL. Another neat example to explore is the RIB scene file that ships with RenderMan Examples that demos a few OSL shaders (carbon fibre and wood), this example being totally standalone RenderMan without Maya so a great learning tool.

    Sections:

    1. 1) Intro
    2. 2) Docs
    3. 3) OSL vs PxrOSL
    4. 4) Maya Teapot
    5. 5) 1st Simple OSL
    6. 6) Primvars st UVs
    7. 7) 2nd Simple OSL
    8. 8) RIB from Maya
    9. 9) Standalone RIB Example
    10. 10) Recreate in Maya
    11. 11) RIB Summary Slide
  • Class 03 - Se Expressions Part 3

    Applying our Se Expressions lessons into an Iridescence Material with PxrSurface from the all new Preset Browser, we explore a new Kitchen scene available from the RenderMan Community site. We modify an Se Expression from last class into one that works to drive the signal of the “Thin Film Thickness" parameter for our iridescence render of soap bubbles material, explore “thin" refraction, create vector displacement Se Expression with vfbm, vturbulence, and vnoise functions.

    Sections:

    1. Intro
    2. Kitchen Scene
    3. Preset Browser
    4. Iridescence Material
    5. Thin Refraction
    6. Integrators
    7. Visualizing Noise Signal with PxrConstant
    8. SeExpr Iridescence Film Thickness
    9. Animate Iridescence Film Thickness
    10. SeExpr Vector Displacement
    11. Exercises
  • Class 02 - Se Expressions Part 2

    Continuing off from Part 1, we get into more complex Se Expressions including: vectors and facing ratio variations. And a production example with procedural noise patterns including voronoi and fbm, textures and uv coords all in one pattern. We introduce a much better tool for editing Se Expressions on the fly: Cutter!

    Sections:

    1. Intro
    2. Cutter to the Rescue
    3. Vectors: Facing ratio
    4. Facing ratio: metals
    5. Voronoi: anisotropy
    6. Production Example: Intro
    7. Production Example: Se Expr Setup
    8. Production Example: Summary
    9. Acknowledgements

    Links referred to in course

    http://fundza.com/cutter/se_expr/
    www.cgbreakdown.com (Production Example)

  • Class 01 - Se Expressions Part 1

    Description: Starting off our 2nd course we introduce Se Expressions: great for quick prototyping and programming without compiling, and realtime code modifications of your patterns right in the IPR render!

    Sections:

    • Intro -Introduction to the class
    • What Is Se Expression?- Explanation of the language
    • Examples- Examples of different kinds of Se Expressions: patterns, textures, normal facing ration, combinations of all.
    • All Patterns Overview- Overview of all the different types of patterns: factory plugins, Se Expressions, OSL, Custom C++ Patterns
    • Maya from Scratch- Lets build it up from scratch with our own Se Expression
    • Maya SeExpr Voronoi- A voronoi pattern for our 1st example, explaining P vs Pobj through animation
    • Noise Graphs- modifications to the noise signal
    • Resources- links to documentation and history.
    • https://rmanwiki.pixar.com/display/REN/PxrSeExpr+Quick+Reference
    • https://www.disneyanimation.com/technology/seexpr.html
    • The Big Question- watch to find out!

About the Author

Christos Obretenov was educated at Simon Fraser University with a BSc in Computing Science specializing in Computer Graphics, Christos Obretenov started contributing to the Animation and Film industry at Mainframe Entertainment in conjunction with Simon Fraser University. He continued his career by designing and developing shading software for Walt Disney's "The Wild" feature film, followed by shading and lighting for Superman Returns, Spider-Man 3, Beowulf, Christmas Carol, Mars Needs Moms, and Life of Pi (which won the 2013 Oscar for Best Visual Effects) feature films. Recently co-founding LollipopShaders.com, Christos develops procedural solutions to shading and lighting, currently experimenting with Physically Plausible Shading. He resides in Vancouver, Canada. 

LinkedIn Profile | IMDB Film Credits  
 
 
 

NEWS | Check out the RenderMan "SciTech" Art Challenge Winners!