Difference between revisions of "LopsLightingQuickstart"

From cgwiki
Line 121: Line 121:
 
* Append a karma lop
 
* Append a karma lop
 
* This acts like a render rop, and should be intuitive to understand; framerange, camera, resolution etc
 
* This acts like a render rop, and should be intuitive to understand; framerange, camera, resolution etc
 
+
* Set the framerange 1-24
 +
* Change the output suffix from exr to png
 +
* Change the rendering engine to XPU
 +
* Change pixel samples down to 4
 +
* In the lower section choose the 'Image output' tab, then the 'filters' subtab'. From here you can enable denoising, try optix to start with.
 +
* Click 'render to disk', your machine will render those frames. Render times will be maybe 10 seconds per frame, and Houdini will be locked up while rendering. Lets fix this.
  
 
=== Setup karma rendering with husk (wip) ===
 
=== Setup karma rendering with husk (wip) ===

Revision as of 21:49, 23 April 2022

Overview

You have a scene that you're just about to start rendering in Redshift/Mantra/Arnold, but you're keen to give Karma a try? Don't wanna learn all that prim/reference/sublayer/delegate stuff all the USD nerds talk about?

Hopefully this will get you started. USD jargon is unavoidiable at some point, but I think its possible to dive in without getting too caught in the jargon weeds. The aim here is to take a /obj, /mat, /rop setup, and port it to Lops as painlessly as possible, while picking up some basic USD concepts on the way.

What you know vs the end target

If you've rendered anything in Houdini before, you're probably used to a setup like this:

Old render layout.PNG

Familiar sure, but if you think about it, doesn't really play to any of the strengths of houdini's node network way of thinking. One of the goals of Lops is to unify this, so that you can combine everything into a single network:

Lops layout.PNG

Neat right? "Whatever," you say, "It's the same nodes in a different skin, big deal". But think about the sops tricks you're used to, and how you can reapply them in this context. Eg being able to have multiple cameras, and easily change between them with a switch node:

Lops camswitch.PNG

Or create a copy of your materials, change all their properties, and swap them out instantly:

Lops alt material library.PNG

Or add extra lights to different render passes visually, and chain multiple renders off the back of those:

Lops extra lights in pass2.PNG

All those thing are somewhat klunky to do with vanilla /obj /rops /mat, and very hard to see at a glance. Lops makes it very easy to see directly from the network what you're trying to do.

Example file

Here's a hip with some rbd, ground, volume, lights camera, we'll port this to lops.

File:Lops lighting start.hip

Lops lighting start screenshot.PNG

The plan

Here's what we'll do, playing to the strengths of Lops to start with, and talk about other options later:

  • Import geo from sops
  • Create lops lights
  • Create lops materials and assign
  • Create camera
  • Create a render node

Import geo

You can either jump to the /stage context, or do what I and the other sensible people do, create a lopnet (people who use the top level contexts are savages).

A sopimport node is like an object merge, it grabs geo from sops, and pulls it over to lops.

Create one, and set the path to the pig. Tada, your pig is in lops.

Now, an important thing to learn straight away, have a scene graph tree panel open somewhere (if you switch to the Solaris desktop, you'll see it). Why?

In /obj context you name your lights, name your containers, so that everything is neatly organised. In lops you're using nodes to define a set of things to render, and like in obj stuff can be parented together, have relationships and whatnot. The main node graph doesn't show you this, but the scene graph tree does.

See how the node appears in the tree as 'sopcreate1'? This is like the outliner in maya, its the top level name of the thing you just made, like the geometry container name in /obj.

Its called sopcreate1 because in its parameters, it uses $OS to define its own name. Lets be lazy here and rename the sopcreate node in the node network to 'pig', so that the scene graph is correct.

Now append another sopcreate, and point it to the ground. Note that when you attach the two nodes together and display the second, you see both the grid and the pig? Attaching these nodes appends their results, as opposed to sops which does chains of geometry modification, or in /obj, which does parenting operations (Katana operates very similar to Lops too).

Repeat the operation for the fog, you should now have all your geometry in lops, with a nicely named scene graph:

Lops sopimport basic.PNG

This is probably the biggest thing that holds people back from understanding Lops, this different way of dealing with geometry vs the network vs the scene graph. The rest should flow much more easily.

Create lights (wip)

  • Append a light lop
  • Use the transform parameters to move the light to the top left.
  • Select the 'base properties' tab, set colour and exposure (I set exposure up +4)
  • Can also hit enter to get its interactive handle to move in the viewport
  • Append 2 more lights, do the same
  • To hide the transform gizmo for the selected light, hit escape

Karma preview (wip)

  • In the viewport menu where it says 'persp', select Karma. You're now viewing the full quality renderer in the viewport. You can move stuff, change lights, it will keep up.
  • If the light icons are distracting, toggle the 'display light guides' toggle on the right stowbar of the viewport.
  • You can swap back and forth between HoudiniGL and Karma whenever you need.

Create camera (wip)

  • Append a camera lop
  • Look through it via the viewport menu ( where it says 'no cam', select and change to '/cameras/camera1')
  • Click the padlock icon on the right of the viewport, this locks the camera to match the view. Select the pig in the scene graph tree, hit space-f to frame, then the usual space or alt controls to rotate and pan the camera

Did you notice that in the scene graph tree the lights are put under a lights folder, and the camera under a camera folder. Why? Tidyness and convenience. You can see in the camera parameters it's primitive path is set to /cameras/$OS, lights are similar. You can place them wherever you want in the hierarchy, sidefx suggest with these defaults that having a top level folder that collects all the lights and cameras is useful. If you don't like it, you can just change the path, eg make it /$OS so that it no longer lives in a /cameras folder.

Create materials (wip)

  • Append a material library
  • Dive inside its a /mat context, create maaterials, or be lazy and copy them from /mat, paste here.
  • Jump up, look at the scene graph tree. There's now a materials folder (same idea as before, this is nice for tidyness), inside there are the materials.

Assign materials (wip)

  • Append a assign materials lop
  • Ensure the /materials folder is expanded in the scene graph tree
  • To assign the pig material to the pig geometry, drag the pig geo from the scene graph tree into the 'primitives' parm, and drag pig_mat from the materials folder into the 'material path' parm.
  • click the plus icon at the top of the parameters multilister twice, assign the ground material to the ground, fog material to the fog.

Note that if you select items in the scene graph tree, they'll be highlighted in the network view. If this bothers you, click the 'display selection' button on the right of the viewport to turn it off.

Karma XPU (wip)

  • In viewport, click the first menu where it says 'persp', choose 'karma'
  • Hit d in the viewport to bring up display properties, swap from CPU to XPU
  • After a short delay, XPU will kick in, offering even faster previews
  • Not all features are supported, but its being actively worked on
  • If the viewport feels like its lagging, try restarting karma (viewport persp menu, 'restart render')

Setup karma rendering to disk (wip)

  • Append a karma lop
  • This acts like a render rop, and should be intuitive to understand; framerange, camera, resolution etc
  • Set the framerange 1-24
  • Change the output suffix from exr to png
  • Change the rendering engine to XPU
  • Change pixel samples down to 4
  • In the lower section choose the 'Image output' tab, then the 'filters' subtab'. From here you can enable denoising, try optix to start with.
  • Click 'render to disk', your machine will render those frames. Render times will be maybe 10 seconds per frame, and Houdini will be locked up while rendering. Lets fix this.

Setup karma rendering with husk (wip)

  • Append a USD render rop
  • Have it write a USD framerange to disk
  • Go over to tops
  • Create a USD render top, point it to your usd files
  • This runs as a background process, and is more efficient than directly rendering from houdini to karma