Houdini to Glowstick
Use Houdini to create scenes that can be exported to OpenUSD for rendering inside Glowstick. When done correctly (i.e. understanding the current limitations of Glowstick), rendering seamlessly is possible.
Houdini is a challenging software to learn and is unlike other 3D applications, but there are great learning resources available from SideFX themselves as well as other educators. Check out the learning content from SideFX and make use of their extensive documentationFoundations | Getting Started Learning Path | SideFX
Things to Know Before You Start
Save your Houdini file, textures, and USDs on your local drive while you work, rather than in the Ubuntu network drive. Trying to save or export to the network drive directly can cause problems.
Houdini is primarily a procedural, node-based 3D application. You will be working mostly in the node graph rather than directly in the 3D view like in most other software.
Houdini works on the basis of Operators which are used as nodes in various Networks. Here is a list of the network folder types.
The operators are abbreviated as various OPs. For example, geometries and simulations may be created using SOPs (Surface Operators) and DOPs (Dynamics Operators) in the obj (Object) network folder. Expand the list below to see all the operators and their uses.
We’ll primarily be using SOPs to create geometry objects, SHOPs to create materials, LOPs to assemble our USD scene, and ROPs to output our scene to USD.
This is what you’ll see when you open Houdini. Below is a key for the colored regions and numbered annotations of useful tools/options.
3D View
Alt navigation
Perspective/orthographic views and viewpoints
Camera and light viewpoints
Viewport shading mode, object visibility, and multiview options
3D viewport tools
Selection modes
Node Graph
Double click to jump into a node or network
U to jump up a level or out of a network
Tab to search for and add nodes
Nodes (add with Tab key)
Network folder and current path (click to change between network folder types)
Node Parameters (control the effects of each node here)
Timeline
Playback controls
Enable/Disable Simulation Calculations
Creating or Importing Your Geometry
In the node graph, make sure you’re in the obj (Object) network folder and drop down a geometry node by pressing Tab then searching for “geometry.” You will build or import your geometry inside this node network. Double click the geometry node to ‘dive in.'
Build your geometry using SOPs or import geometry with a File node.
Since we’ll be referencing this geometry elsewhere to build our scene, it’s useful to append a Null node to stay organized and make it easy to find. Name it something like OUT_name.
Setting up Materials & Textures
Navigate to the mat (Materials) network folder
We’ll be using specific shading nodes that work well with USD Preview Surface, but in order to preview materials and textures in the 3D view you’ll need a standard shader like the Principled Shader
Add a Principled Shader and in the node parameters window, under the Textures tab, link your texture(s). Adjust the other parameters in the Surface tab.
To preview this material on your object, it needs to be assigned. Navigate back to the obj network folder and into your geometry network. Append a Material SOP and choose your PrincipledShader material.
Once you’re happy with your material, create the equivalent USD compatible shader.
Back in the material network, drop down a USD Material Preview Builder node.
USD Material Preview Builder node in the mat networkJump inside the material builder node. You’ll find a USD Preview Surface VOP already connected to the output for you. Expand the Surface menu to expose the available inputs and make any adjustments you’d like in the node parameters window.
Use a USD UV Texture node to add input textures and a USD Prim Var Reader node to source the UVs into the st input
IMPORTANT: The Signature of the primvarreader must be set to Float 2 in order work with Glowstick’s current OSL library.
To assign this material for use in our exported USD, we’ll have to link it in the Solaris stage network.
Assembling the USD Scene
Navigate to the stage network folder, drop down a LOPnet (Lighting Operator Network), and dive in. This is where we’ll build out the scene with our geometry, materials, lights, and camera, and export to USD.
Linking Geometry & Materials
Inside the LOPnet, drop down a SOP Import node. This is where we’ll reference any geometry objects we’ve imported or created.
Pick your geo object in the import node, making sure to choose the null OUT_name before any non-USD material had been assigned in the node chain.
Switch the Sublayer Style to Merge SOP Layer Into Existing Active Layer. This will write the geometry into the scene USD file rather than creating another file for the geo to be referenced by the USD.
If you have multiple geometries to import, repeat the SOPImport process and plug them all into a merge node.
Alternatively, if you’d like to use USD geo that you have on your drive, add a Reference node and select your USD.
Note: If you use this method, the geometry USD should be located in the same directory as your scene USD when you go to render in Glowstick
To assign your USDPreviewSurface material, append a Material Library node and pick your material in the Material VOP path. This only creates the material library in the LOPnet, so to attach the material to the geometry tick the Assign to Geometry checkbox and choose your SOPImport in the Geometry Path. You can also use a Material Assign node instead.
Setting Up Cameras
To add a camera and immediately snap it and lock it to the view, click the No Cam button in the top right of the 3D View and choose New Camera.
Camera properties can be tweaked in the View tab of its node parameters.
Since the MaterialLibrary node makes the objects very dark in the viewport, you can temporarily mute it with the yellow bypass toggle. This will help you better preview your lights as you place them.
Adding Lights
Create Glowstick-compatible lights by adding Area Light nodes. You can add and place multiple lights with the transform gizmos in the 3D view, then merge them with a Merge node. Use another merge node to add them to your main scene node stream.
Light properties like color and intensity can be tweaked in the node parameters.
Exporting USD from Houdini
Drop down a USD ROP node at the end of your network and select an output file path.
If you want to pack the imported SOP geometry into the scene USD, change the Save Style to Flatten All Layers. If you’d like to export a separate layer USD file for the geometry to be referenced by the scene/render USD, leave it on Flatten Implicit Layers.
Note: If you use this method, the geometry USD should be located in the same directory as your scene USD when you go to render in Glowstick
Click Save to Disk to export.
Rendering with Glowstick
Copy your USD and any textures and HDRIs from your local drive to your Ubuntu network home, making sure that the folder structure is identical as to maintain relative file path references.
Render by entering the code below. Switch the .usd file, HDRI, and resolution to your files and render settings.
bolt_server --backend /usr/share/bolt_server/libbolt_embree_backend.so -i ./pathtoUSD/USDFile.usd --sky 0,0,0 -h 1080 -w 1920 --iters 400 --bounces 5
When rendering with an HDRI, use
--hdriYou must specify which folder your HDRI is in like below since HDRIs are not part of the USD export.
--hdri ./pathtoHDRI/HDRIFile.exrbolt_server --backend /usr/share/bolt_server/libbolt_embree_backend.so -i ./ZeusBust/USD/ZeusBust.usd --hdri ./ZeusBust/Textures/HDRI/brown_photostudio_01_1k.exr -h 1080 -w 1920 --iters 400 --bounces 5
You can hide the HDRI image in the background by using:
--alphacolor 1This also exports a -alpha image that you can use as a mask for replacing the background in a photo editor
You can change the location of your render output with
--dest ./foldername/Be sure to include the
/at the end of the path to avoid exporting one level up
Lighting Differences
Lights can appear bright or dim when rendering with Glowstick. Set
--lightmulto correct the intensity.
bolt_server --helpfor documentation on commands and how to use them
