Houdini 20.0 Solaris

LOPs for lighting tutorial 1

In the first tutorial, you will open and explore the example LOPs scene file, create a point light and a new camera, make a few adjustments to LOPs and render properties and settings, and produce a test render.

On this page

Before you begin

  • You should already be familiar with Houdini before doing this tutorial. Please also read the Solaris “A Few Things to Know” section before beginning, as there are links to a few good introductory pages.

  • You do NOT have to do the LOPs Intro tutorials before this one, but it would be helpful.

Load the scene

  • Start Houdini

  • Switch to the Solaris desktop.

  • Load the tutorial-lighting-start.1.hip file.

    • Remember that the directory BarScene should be at the same level as your .hip files.

  • With lighting disabled, you should see something like this in your viewport.

Note

If at any point you can’t see lighting in your scene, simply create a new Scene Viewer tab.)

If you see nothing, it’s because the Stage Manager cannot find the assets on disc. If you can see the scene, skip the rest of this section.

If you see nothing through the viewport, (or you want to stage the assets somewhere else so they can be shared among multiple users), follow these instructions:

  • Go to the Stage Manager LOP.

  • Click on the “Show/Hide Parameters” icon. You should now see every single asset as it has been marshalled into the Stage Manager. If you are not familiar with the Stage Manager, be sure to review Tutorial 2.

  • You will notice that there is a “Reference File” paramater on each tab. This shows us where on disc Houdini is looking for the asset. Right now, Houdini is looking in $HIP/BarScene, ($HIP means “the location on disc where I launched Houdini”, or “the location on disc where the file I loaded was located”.) If you do not have the BarScene directory in a direct subdirectory of $HIP, then you have to fix it. Here is how:

    • Open an Hscript textport. (Windows -> hscript textport).

    • In the textport, type: opfind \$HIP/BarScene

    • This will show you all the nodes in Houdini that have a reference that begins with “$HIP/BarScene”. Why the back-slash? This “protects” the variable, meaning that Houdini should look for word “$HIP” literally instead of looking for the value of $HIP.

    • You should only see “/stage/stagemanager1” as a result.

    • Now let’s change all references. In this example, let’s assume your assets are in /home/projects/assets/BarScene. In the hscript text port type: opchange \$HIP/BarScene /home/projects/assets/BarScene.

    • Houdini should report the paths it has changed, and the scene should update.

Explore the node network

You will see a node network that looks like this:

  • The Stage Manager, as explained already, is where the assets are marshalled into the stage.

  • The Edit Properties LOP is used to add attributes to prims. More on this later.

  • The SOP Create LOP node is used to allow us to use the power of SOPs to create geometry in LOPs. Select the node and hit ENTER to see how the scene backdrop was created. Hit u to jump back up.

  • The camera is obviously, a camera.

    • In the camera, go to the “View” tab and modify the the horizontal and vertical apertures to 19.2 and 10.8 to create an an HD-resolution camera.

Note

To render with depth of field, the f-stop has to be non-zero. We will not be rendering with DOF in this tutorial.

Add a second camera

The scene already has a camera in it. Let’s make another.

  • ALT drag on the shot_0001 Camera node to make a copy.

  • Rename it “shot_0002” (if necessary, it should have been auto-renamed to this by Houdini).

  • Rewire the network so shot_0002 is under shot_0001.

  • Turn on the display of the shot_0002 camera.

  • In the viewport, look through the shot_0002 camera.

    • Lock the viewport and tumble around to create another camera view.

  • Note the value in the “Primitive Path”. This will tell LOPs (and USD) where to store the cameras in the scene.

    Primitive Path

    /cameras/$OS

  • With the shot_0002 LOP selected, you can see your cameras in the Scene Graph Tree under /cameras.

    • Please see the end of LOPs Tutorial 6 for notes on organizing your USD stage.

Add a table lamp

Note

Before we continue, note that there is an image of the completed node network at the end of this tutorial. If in doubt, jump ahead and look at this image to see how the network is wired up. For the most part, the order the nodes are wired does not make any difference, so generally you can ignore any discrepencies between the images in this tutorial and your own node network.

We are now ready to light our scene. Let’s start by putting in a light to represent the light bulb inside the lamp shade. Note the geo representation of the bulb is cylindrical.

Note

In the following section, we are going to be zooming in on a part of our scene. If you cannot see parts of your scene that are very close to the camera, you may have to adjust the near clipping plane. In the viewport, it d for display options set the near clipping plain to 0.

  • In the viewport, turn on point snapping, and in the right-click menu, disable “Orient to Normals” and enable “Points” only. Zoom into your scene and then ⇥ Tab in the viewport and select “Point Light”. Click somewhere near where you think the bulb should go, (you may want to change to wireframe view). A new point light will have been created. Change the “type” to “cylinder,” and rename to “tablelamp”.

  • Turn off point snapping, and using the light handles, scale and rotate the light as required (use “b” hotkey to toggle resize handles and “y” to toggle translate and scale handles).

  • You should end up with something like this, (you can do this via the parameter interface or the mini-parmeter interface at the top of the viewport:

    Primitive Path

    /lights/$OS

    Type

    Cylinder

    Radius

    .01

    Length

    .08

    Intensity

    5

    Color

    Give the light a warm color.

Note

If you happen to find yourself outside of the “light” context in the viewport, just select a light and hit ENTER in the viewport.

Generate a test render

Let’s do our first Karma render. In the viewport, choose “Karma” from the dropdown. You should see a render begin shortly.

Now let’s adjust the intensity of the light. With the light still selected, (and in the “light” context in the viewport):

  • ⌃ Ctrl + ⇧ Shift to adjust the intensity of the light.

  • ⌃ Ctrl + ⇧ Shift + Scroll (mouse wheel) to adjust the increment that the light intensity will be adjusted at.

In the video below, we are using the above key combo to adjust the intensity of our light and also the intensity increment of our light.

Note

If you find that the Karma render scene intensity does not match the GL render scene intensity, switch to High Quality Lighting in the viewport in the icon strip on the right.

Edit the Properties LOP

The Edit Properties LOP, configured as it is here, makes Karma render the specified prims as a subdivision surface to make it smoother. By itself, without configuration, it does nothing. Here is how it has been configured for you already:

  • We chose what prims to operate on. In this case, all the prims (meshes) under the component Table.

    Primitives

    /Table/*

  • To add these spare paramaters, click on “Edit Properties”

    • 1 - From the dialog that pops up, go to the “From USD” tab.

    • 2 - Enter “subdivision” in the Filter.

    • 3 - Choose “subdivisionScheme” and “triangleSubdivisionRule” from the interface.

    • 4 - Hit the “->” arrow button to move these paramaters into the node interface.

    • 5 - Hit “Accept” in the interface.

The properties have been added to the LOP, (and the resulting USD file).

Tip

You will probably want to save this set-up as a preset.

Define the render properties

We are now going to set some render properties and add a switch LOP so we can switch between shots.

  • Append a Karma Render Properties LOP.

    Camera

    /cameras/shot_`padzero(4,opdigits(“.”))`

    Output Picture

    $HIP/render/beauty.shot_`padzero(4,opdigits(“.”))`.$F4.exr

Tip

Let’s examine the expression `padzero(4,opdigits(“.”))`. This expression allows us to extract the digits from the current node, (removing leading zeros), and then pad that digit to four places. This allows us to copy and paste this node as many times as we want and it will “just work” because the expression updates.

  • The backticks (`) mean that Houdini should evaluate what’s inside the backticks as an expression, not treat this as a literal word. (The “backtick” is the key above the TAB key on a North American keyboard. Note that it is not the “single quote” (Single quote: ' Backtick: ` ).

  • opdigits(".") - Extract the digits from the current node (“the current node” is the "." part of the expression).

  • padzero(4,value) - Pad the value given by four digits

In this Render Properties node, you can set the output file path, AOVs you would like to render, resolution, pixel samples, etc. This allows per-shot customization.

  • Append a Configure Layer LOP to the Render Properties LOP.

    • Rename it “start_end1”

    • Delete the expressions in the start and end parameters by right-clicking on them and choosing “Delete Channels”.

    Start

    1

    End

    70

    • Copy and paste the Configure Layer LOP and the Karma Render Properties LOP.

    • In the second Karma Render Properties LOP:

    Start

    71

    End

    240

We now want to be able to easily switch between the shots and cameras.

  • Append a Switch LOP. Wire in the two configure layer LOPs.

    • In the viewport, switch the view to “Render Settings Cam”

  • In the viewport, toggle on “Stage Frame Range Drives Playbar Range”

Now when you change the value of the switch LOP, you will notice the view through the camera changes, and the frame range changes in Houdini.

Your network should look something like this, (note that it does not matter where the light is, and we will be re-organizing this shortly):

A note on render settings

If you look in the Scene Graph Tree, you will notice a prim called “Render”. If you dive down, you will see a rendersettings prim (/Render/rendesettings). If you also look in the Scene Graph Details panel, you will see the values of those prims. This is what Karma uses when you render, and this information will be stored in any USD files you save out.

Let’s start lighting

In the LOPs Lighting Tutorial 2, we are going to start adding more lights to our scene.

Solaris

USD

Geometry

  • SOP Geometry I/O

    Details of how Houdini converts SOP geometry to USD, and how you can control the process.

  • Component Builder

    The Component Builder tool puts down a network snippet for creating a USD model from SOPs, with support for materials, variants, payloads, and layering.

Layout

  • Edit node

    Interactively transforms prims in the viewer. Can use physics collisions to position props realistically.

  • Layout node

    Provides tools for populating a scene with instanced USD assets. You can place individual components, paint/scatter components in different ways using customizable brushes, and edit existing instances.

  • Custom Layout Brushes

    How to create layout brush digital assets you can use to customize the behavior of the Layout LOP.

Look Development

  • MaterialX

    Houdini has VOP node equivalents of the MaterialX shader nodes. You can build a shader network using these nodes, or import an existing MaterialX-based shader, and use them with Karma (Houdini’s USD renderer).

  • UDIM Paths

    You can encode different tiles of a texture space into different texture files, each with its own resolution. You can then specify a texture filename such as kaiju.exr, and Houdini will replace the token with the specific tile address at load time.

  • Shader Translation Framework

    Describes the Solaris shading framework, including shader node translation to USD primitives.

Karma rendering

Tutorials