Blender to Glowstick

Blender to Glowstick

Use Blender to create scenes that can be exported as OpenUSD for rendering inside Glowstick. When done correctly (i.e. understanding the current limitations of Glowstick), rendering seamlessly is possible.

Blender Crash Courses

Getting Started in Blender Pt. 1: https://drive.google.com/file/d/1Q4uDBq-R84O1g4QE1bB38aGRnOB2GEgq/view?usp=sharing

Getting Started in Blender Pt. 2: https://drive.google.com/file/d/12FlHY6WeV0vdWYQsb3VOsG4o-y-DmL7P/view?usp=sharing

Blender Materials Pt. 1: https://drive.google.com/file/d/13rvUNmE3qL6z6W7J-BeLp8TvqfJwogRb/view?usp=sharing

Things to Know Before You Start

  • Save your Blender 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.

  • Set up Blender to automatically use relative file paths rather than absolute ones in Edit>Preferences>Save & Load>Default to Relative Paths

  • For those that are already familiar with navigation in other DCCs like Maya, 3DS Max, Houdini, C4D, etc. you can set your Blender keymap to Industry Compatible in Edit>Preferences>Keymap.

image-20250425-171622.png
  • You can enter/exit Quad View by hovering over a 3D Viewport window and pressing Ctrl+Alt+Q or going to View>Area>Toggle Quad View.

image-20250425-172102.png
  • You can enter/exit camera view by pressing Numpad 0 (including the top right window of the Quad View.

  • You can switch between perspective and orthographic views using Numpad 5 and rotate to each orthographic view with 1, 3 and 7, or with the navigation gizmos in the upper right corner.

image-20250425-172733.png
  • Displacement maps are not yet supported in Glowstick.

Setting Up Cameras

  • Add a camera using Shift+A or Add>Camera from the top left menus.

  • Lock the camera to your 3D view while navigating by opening the side bar on the right with N, then going to View>View Lock>Camera to View.

    • Alternatively, snap the camera to your current view with Ctrl+Alt+Numpad 0

  • Adjust your camera’s properties like focal length, clipping, focus distance and aperture by opening the Properties editor then going to Object Data Properties.

image-20250425-174502.png

Adding Lights

  • Create Glowstick-compatible lights from Add>Light>Area. Other light types may not work properly.

  • Adjust light strength and other settings from the Properties editor, Object Data Properties like with the camera settings mentioned above.

Setting up Materials & Textures

  • You may want to switch to the Shading workspace where you’ll automatically get a 3D Viewport in Material Preview mode and a Shader Editor for working with material nodes.

    • Loading material preview the first time takes several seconds, so switching to the Shading workspace may cause Blender to hang for a bit.

  • Create a new material by selecting an object and in the Properties editor going to the Materials tab and pressing New.

image-20250425-180752.png
  • This will create a Principled BSDF shader setup, which is conveniently what Blender’s USD exporter can convert to USD Preview Surface materials.

  • To add textures, use Shift+A and search for Image Texture and connect to the relevant sockets on the Principled BSDF.

    • To easily add an organized texture set as shown below, enable the Node Wrangler addon in preferences then use Ctrl+Shift+T with the Principled BSDF selected and select all of your textures in the file browser.

    • Normal maps must be fed through a Normal Map node before being plugged into the shader.

image-20250425-184702.png
  • The Mapping node lets you edit the scale and rotation of your textures if they’re tileable.

  • For any texture that doesn’t contribute directly to color (i.e. anything that isn’t diffuse/base color), make sure the Color Space is set to Non-Color data.

image-20250425-184934.png
  • To setup HDRI world lighting, switch the data context in the Shader Editor from Object to World.

    • Pipe your HDRI texture through a Background node before plugging it into the World Output.

    • You can find tons of great free HDRIs here. HDRIs • Poly Haven

image-20250425-195550.png
  • Make sure each texture (including your HDRI) is using relative paths by selecting its node, opening the side panel with N, and checking the path format in Node>Properties

    • If any textures have absolute paths, you can resolve them with File>External Data>Make Paths Relative.

image-20250425-190146.png

Exporting USD from Blender

  • To export a USD, go to File>Export>Universal Scene Description

  • Most of the default export settings are fine, but there are some changes to make.

    • Choose Selection Only if you want to only export selected objects.

    • Make sure Relative Paths is enabled.

    • Disable World Dome Light from the exported object types. Blender’s dome light conflicts with Glowstick’s HDRI implementation.

    • Enable Triangulate Meshes and use default triangulation settings.

    • Make sure USD Preview Surface Network is enabled.

    • Change the Export Textures method to Keep so that the USD references your textures using their original relative paths.

    • Before exporting, save these changes to a Preset by clicking the + in the top right and naming it Glowstick. This way you can choose it from the dropdown and won’t need to make all these changes every time you re-open Blender.

image-20250425-191714.png
  • By default, Blender exports a Binary encoded USD file (.usdc). If you’d like to export an ASCII file so that the USD is readable in a text editor for debugging, manually rename the file to .usda before export.

    • If desired, you can rename the file extension to .usd after exporting while keeping the file in ASCII format.

image-20250425-193747.png

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 --hdri

    • You must specify which folder your HDRI is in like below since HDRIs are not part of the USD export.

      • --hdri ./pathtoHDRI/HDRIFile.exr

      • bolt_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 1

      • This 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 be blown out when rendering with Glowstick. Set --lightmul to a value like 0.01 to reduce.

  • bolt_server --help for documentation on commands and how to use them

Comments