LopsLightingQuickstart
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.
Basics
What you know vs the end target
If you've rendered anything in Houdini before, you're probably used to a setup like this:
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:
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:
Or create a copy of your materials, change all their properties, and swap them out instantly:
Or add extra lights to different render passes visually, and chain multiple renders off the back of those:
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.
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:
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 background rendering with husk (wip)
- Append a USD rop (NOT a USD Render rop, thats a different thing)
- Set the framerange to 1-24, write to disk, it should be very quick
- This USD file has everything required to render, like a .ifd, .rib, or .ass for other renderers. We can use tops to render this in a background process.
- Jump up to /obj, create a topnet, dive in
- Create a file pattern top, point it to the usd file you just generated.
- Append a USD Render rop
- Set 'evaluate using' to 'frame range', set the range to 1-24, and enable 'all frames in one batch.
- Select the rop, press shift-v to start tops processing. The frames will be writtn to disk, more efficently and in the background rather than locking up your session.
Next steps
Ok, that's the basics covered. Where to from here?
Scene import
Now is the time to tell you about the 'scene import' lop. It's meant to be a shortcut to do all the work I just had you do. :)
That said, while the amount of work the scene import lop does is admirable, it can fail on all sorts of edge cases, and the nature of Houdini and everyones individual crazy networks, its too easy to run into. Besides, if you want to start using Lops effectively, eventually you have to start building setups as I've shown here.
Karma Rop
You might've also spotted this lurking in /out, dive inside and you'll see its a mini lopnet using a scene import lop, and all the karma lop parameters promoted to the top of its UI. So the same caveats apply; fine for simple things, will probably break if you push complex old scenes through it, and really, you're not learning.
Sop create vs sop import
There's no need to create your work in /obj and then import it. A sopcreate node lets you dive inside and just create sops directly, saving you a step, and keep your network less dive crazy.
The rest
There's lots to cover, but this was the bare minimum to get renders out. If you're interested in more, go check out the other USD and lops guides I've written on this site.