Houdini 21.0 Basics

Advanced Viewport Shading

On this page

Houdini’s 3D viewport has the ability to produce an interactive version of many lighting effects found in offline renderers. You can also apply simple post-effects, like depth of field and bloom. Color correct the final image with OpenColorIO or traditional Lookup Tables (LUTs) and gamma correction.

Note

When OpenGL is the renderer, Scene Lights is called High Quality Lighting and Work Lights is called Headlight (the extra work light modes are unsupported). Normal Quality Lighting is available only if OpenGL is the renderer.

Lighting in the viewport

Houdini has three main lighting modes: No Lighting, Work Lights, and Scene Lights. These take effect when the shading mode is Flat Shaded or Smooth Shaded, but are otherwise ignored.

No Lighting

All geometry is displayed without any lighting. Only diffuse and emission color and textures are shown. All lights in the scene are ignored.

Work Lights

There are different work light setups available, which you configure in the Lighting Properties window ( the Work Lights button in the display toolbar and choose Properties). Work Lights render faster than Scene Lights, but in some cases aren’t quite as high-quality as their Scene Lights counterparts.

  • Headlight: The traditional “over the shoulder” distant light.

  • Dome Light: An environment light with a configurable environment map.

  • Physical Sky: A two light setup that models a realistic sun and sky based on real-world parameters.

  • Three Point Lighting: Three lights setup in a typical key, fill, and back light configuration.

All work light setups except Headlight can optionally cast shadows, though this has a performance hit. All lights in the scene are ignored when in Work Lights mode.

Scene Lights

Most of the light types in Houdini have been modeled with GPU shaders, which produce a good approximation to the final rendered result so you can interactively adjust lighting. The Lights tab in the 3D Viewer Display Options contains settings that can balance lighting quality with interactive performance.

  • Max Light Count: If the number of scene lights exceeds this number, render only the brightest lights up to this limit. Instanced lights don’t count towards this limit. This prevents the scene from losing interactivity with hundreds of lights or more.

  • Light Sampling: Some lights, such as area and environment lights, require a number of rays to be sent from the surface to the light to accurately model. Denoising can reduce the need for a high number of samples.

  • Fast Interactive Sampling: Reduce the number of samples while performing an interative action, such as tumbling or dragging a handle.

Tip

Instancing lights in LOPs is an excellent way to optimize a large number of lights in the viewer. Light instancing isn’t supported in objects.

Ray tracing

Ray tracing uses GPU-accelerated ray queries to provide more accurate lighting and shadows. It’s recommended that Denoise if Needed is on to reduce the noise this technique produces. Alternatively, increase Light Samples if denoising makes interactivity too sluggish.

Ray tracing also turns on shadows for instanced lights, if shadows are on, and a nicer form of Ambient Occlusion.

Ray tracing requires additional GPU memory for geometry, roughly doubling the memory cost of geometry (the actual extra memory cost is GPU driver specific).

Note

This requires a GPU with ray tracing capability and the Vulkan renderer. Ray tracing is not currently supported on MacOS, and not supported on OpenGL.

Ambient Occlusion

Ambient Occlusion provides a good visualization of small surface features and provides a better spatial sense of the scene by adding subtle shadowing.

With Use Ray Tracing on, this provides accurate occlusion shading by sending rays a short distance from the surface being shaded. You can change the ray distance, the ray spread, and occlusion darkness. If Use Ray Tracing if off, this uses a less accurate screen-space occlusion shader.

Shadows

Generate shadows for lights. Shadow maps generate when Use Ray Tracing is off, which requires an extra pass and a small amount of GPU memory per light. Manage the memory used with the map size and memory display options (in the Shadows section of the Lights tab). When Use Ray Tracing is on, shadow maps are not required.

Note

Use Ray Tracing must be on for instanced lights to cast shadows.

Materials

The viewport supports three different types of materials: a fixed viewport material, a MatCap material, and a MaterialX material network.

Default viewport material

If the material is represented by a VOP that isn’t a MaterialX node, the default viewport material is used. It has support for basic lighting, multiple textures, and light-based textures. The Mantra Surface Material and the Principled Shader have these properties built-in, but you can add them through the Edit Rendering Parameters interface to parameters on other shaders. The viewport rendering parameters are in the SHOP/OGL subfolder. Only parameters tagged with a viewport property on the referenced node are seen by the viewer.

Note

Inputs to a SHOP and any non-MaterialX VOP are ignored in this mode.

Bump and normal mapping are supported for adding surface detail. Diffuse, specular and reflection maps are supported for color sampling. An opacity map is also supported to provide ease of transparency when multiple diffuse textures are used (otherwise, the first diffuse layer can specify opacity).

In terms of shader processing, the final normal is computed from either the interpolated vertex normals or the normal map if supplied. A bump map will further perturb the normals.

The normal and viewing direction is then used to compute the specular reflection. A specular map may used to tint the specular highlight, multiplied by the constant material specular color. The shininess factor can be encoded in the alpha channel and mapped to a shininess range using the Specular Map parameter set. If a reflection map is used, the specular color is further multiplied by a lookup into the reflection map using the reflection vector.

The diffuse color is a combination of the interpolated vertex color (if any), multiplied by the diffuse map (if any), multiplied by the constant material diffuse color.

The opacity is determined by the interpolated vertex alpha (if any), multiplied by the constant material alpha, multiped by the opacity map (if any) and finally multiplied by the first diffuse layer’s alpha channel (if any, and the diffuse texture has an alpha channel).

MaterialX VOPs or shader prims can be used to generate materials for the viewport for more custom effects. Most of the MaterialX nodes are supported (see MaterialX for more information).

Custom GLSL shaders may be used in the viewport if the renderer is OpenGL, though they need to follow a few guidelines to work properly in all cases. See How to write an OpenGL Shader. However, it is recommended that MaterialX shader networks be used wherever possible for custom shaders as these provide a more accessible shading solution.

Note

Custom GLSL shaders aren’t supported for Vulkan.

MatCap material

The MatCap shading mode can apply MatCap materials, which you can make the default material type if no material is assigned (use the Default Material option in the Material tab of the Display Options). A MatCap texture encodes fixed lighting and material information. MatCap materials don’t respond to any form of lighting (for example, Work Lights or Scene Lights). Houdini provides some default MatCap maps, and others can be found online.

MaterialX

Materials can be defined by MaterialX VOPs (for objects and SOPs) or MaterialX shader prims (for LOPs). The entire network must be made of MaterialX nodes, so for example “Mtlx Add” must be used instead of “Add”. Materials can be defined for surfaces (polygon meshes, NURBS, subd surface) and curves (polygon, bezier, NURBS). Curves are shown as ribbons with the line width taken from the 'width' attribute.

Output nodes can be one of:

  • Mtlx Standard Surface

  • Mtlx Surface

  • Mtlx USD Preview Surface

  • Mtlx OpenPBR Surface

  • Mtlx GLTF PBR Surface

  • Mtlx Unlit Surface

  • Mtlx Displacement

If none of those are the output node, the first input of the output node is used as the emission color, with no light shading for visualization purposes.

BSDF and EDF nodes only have basic support. BSDFs are layered by combining their parameters, where those apply to the viewport’s shading engine. EDFs simply map to the emission color as a uniform color. These give a basic preview of textures and colors, but not necessarily an accurate preview of how an offline renderer will shade them.

Some MaterialX nodes are not supported:

  • Curve Adjust

  • Blur

  • HeightToNormal

  • Ambient Occlusion (a viewport setting instead)

  • all Light nodes

  • EDF and VDF nodes

  • Subsurface and Generalized Schlick BSDF nodes

Limitations

The following are the viewport’s limitations for MaterialX:

  • Can’t specify different normals for Coat.

  • Can’t apply Sheen and Coat simultaneously.

  • Thin film isn’t supported.

  • Subsurface scattering only adds the constant subsurface color to diffuse.

  • Mixing surface shaders blends the surface shader parameters together, rather than blending the final color of each.

Transparent Objects

Houdini draws transparent objects separately in a transparent pass after all opaque objects have been drawn when the Transparency display option is on. Objects are considered to be transparent if they have the following:

  • point or vertex color and alpha

  • a material applied with an alpha value other than 1.0 or 0.0

  • a material applied that references a diffuse RGBA texture with alpha values other than 1.0 or 0.0

  • a material applied with an opacity map

  • a MaterialX material with an input attached to Transmission, Alpha, or Opacity

  • a material with a custom GLSL shader that has the ogl_alpha uniform defined

  • sprites

  • volumes

Only those parts of the object which meet the above criteria will be considered transparent, so some primitives within a geometry model may be drawn in the opaque pass if they do not qualify.

When the Transparency display option is off, alpha is ignored.

When the Transparency display option is on, set the transparency quality to Cutout, Low Quality, Medium Quality, or High Quality. The higher modes improve the quality of transparent surfaces, especially overlapping transparent surfaces.

Cutout transparency discards any pixel with a final alpha value less than 1.0 (that is, it’s not drawn), otherwise the pixel is drawn as if it were opaque.

Low Quality transparency draws the frontmost faces of transparent objects, and then overlays that on the opaque geometry. Transparent objects behind another transparent object aren’t rendered, including the backfaces of the same object.

Medium Quality transparency draws a limited number of layers, sorted on a per-pixel level.

High Quality transparency allows more layers to be drawn, which produces a better result for many overlapping transparent objects. Shadows can also be cast onto transparent objects.

Sprites

Points can be rendered as sprites if a Sprite SOP is present. Sprites are always drawn as transparent objects unless the gl_spriteblend detail attribute is present on the geometry (add this with a Visualize Properties SOP). A sprite is a small texture that always faces the camera, centered at the particle. Sprites are drawn after all other transparent objects except for volumes when in Medium Quality or High Quality transparency mode.

Change the display of sprites in the display options' Geometry tab using the parameters in the Particles section.

Volumes

Volumes can be rendered at a variety of quality levels which improve the look of the volume at the expense of performance. Volumes do not cast or receive shadows, nor does ambient occlusion affect them. Volumes can be rendered without transparency, producing a solid outline of the volume.

Volumes are limited to using a 128×128×128 16-bit 3D texture by default. For larger datasets, this limit can be adjusted on the Optimization ▸ Textures page of the display options.

Volumes are drawn in the final pass of the opaque beauty render, before transparent objects.

Post Effects

Several effects can be applied after rendering and lighting: Bloom, Uniform Fog, Volumetric Fog, and Depth of Field. These may all be applied at the same time. These effects are useful in several cases:

  • When you're going to use the Flipbook ROP (or the OpenGL ROP) to render a preview frame.

  • Subtle uniform fog is also a nice depth cue for large scenes, especially in wireframe.

  • Use Bloom as a cue for lighting hotspots.

Uniform Fog

This provides a simple depth-based fog shader. By adjusting the fog color and density, many different kinds of atmospheric looks can be modeled (mist, smog, dust). It can also be restricted to a range of depth values, to avoid fog close to the camera or prevent solid fog from forming at extreme distances. There is also a depth clip which prevents objects past a certain distance from receiving any fog, which is useful for avoiding fog on background images and plates.

Uniform fog can be controlled by height as well, to make overcast or ground-hugging fog. Finally, the brightest distant light in the scene can be used as the sun which does simple lighting on the fog. See the Uniform Fog display options in the Fog tab of the display options. Uniform fog is available in all lighting modes.

Volumetric Fog

Volumetric fog is a more advanced atmospheric effect that allows lights to illuminate the fog, creating blooms and rays through the fog. It requires High Quality Lighting and its look greatly benefits from shadows. The Quality of the fog determines size of the volume used for lighting, and the overall performance of the effect (Low is fast, High is slow but much higher quality).

Volumentric fog shares many of the same parameters as Uniform Fog. One key difference is that the Depth Range should be tightly bound around the lights illuminating it to avoid grainy looking fog. It’s useful to use Volumetric lighting in the foreground over a small depth range, and Uniform Fog in the background to fill in the rest.

Lighting can be varied per-light with the OpenGL Fog Light properties. To only light the fog with a small number of lights, set Light Intensity to zero, then put the Light Intensity property on those lights.

Note

Volumetric Fog is currently not supported by Vulkan.

Bloom

Bloom is a simple effect that mimics subtle atmospheric or lens effects around bright spots in the scene. Pixels with intensities above the Bloom Threshold will cause a small halo around them. The size of the halo is based on the pixel intensity and can be further scaled by the Bloom Scale. The brightness of the bloom is also based on the pixel’s intensity, and then be further modified by Bloom Intensity. This effect requires OpenGL 4.4.

Depth of Field

Depth of Field creates a blurred effect on objects outside of the focus area when looking through a camera with a non-zero fStop. It can be enabled with Camera Depth of Field in the display options (Scene tab). Additional bokeh sprites can be added if the hardware supports GL4.4, which produces bokeh blooms at very bright spots. The bokeh can be circular or sourced from an image (file or COP). The Bokeh Boost increases the number and brightness of these blooms.

Note

Because the depth of field blur is done on a 2D image, there is a practical limit to how blurred the background and foreground can become. The additional bokeh sprites can help make the blur look larger.

Managing Performance and Graphics Memory

Houdini allows for high quality display of many different aspects of the viewport rendering, including lights, shadows and materials. However, it is not advisable to set all of these features to the maximum quality setting at the same time, even on high-end graphics hardware. Many of these features are designed to improve image quality for specific situations, such as evaluating the contribution of lights or viewing a volume in great detail. Pushing everything to high quality can end up reducing viewport interactivity to the point where making changes is painfully slow.

There are several quick ways to return to interactive frame rates if the viewport is sluggish, if these display options are active:

  • Reduce the Max Light Count

  • Reduce the Max Light Samples

  • Turn off Volumetric Fog

  • Turn off Use Ray Tracing or Denoise if Needed

  • Reduce Volume Quality to Low

  • Reduce Transparency to Low Quality or Cutout

  • Turn off Transparency

  • Turn off Shadows if Use Ray Tracing is off

  • Turn off Depth of Field

  • Reduce Scene Antiaiasing

  • Disable Textures

  • Turn off HDR Rendering (OpenGL only)

Note

The following sections go into greater detail on performance and memory use.

Viewport Performance

Performance in the viewport is affected by two things: what you are displaying (the model), and how you are displaying it (display options). Turning off Use Materials in the Materials tab of the 3D Viewer Display Options is a good way to determine if the model or the shading is the constraining factor, as this will disable most of the advanced viewport effects.

If the model does appear to be the limiting factor, you can try a variety of things:

  • Turn off the display flags some objects.

  • Display the non-subdivided geometry, if a Subdivide SOP is used. Turn on the render flag on the Subdivide SOP, and the display flag of the SOP before it. Alternatively, if the subdivision is done by the Display As parameter on an object, set Display As to Full Geometry.

  • Turn on some culling options on the Optimization ▸ Culling tab of the 3D Viewer Display Options, such as Remove Backfaces (backface culling). For packed geometry, reduce the Scene Polygon Limit to replace distant primitives or objects with their bounding box. The closest objects or primitives to the camera are rendered normally.

If the display options are the limiting factor, you can reduce the quality of the displayed geometry. This is more common on graphics hardware with fewer shaders or older GPUs. All of the following options are found on the Lights, Geometry, Texture, and Material tabs of the 3D Viewer Display Options.

  • Scene Lights is the most performance-intensive quality enhancement available. Switching to Work Lights provides the highest performance increase, especially if many lights are in the scene, and complex lights like area, geometry, environment or portals are used. If many lights are in the scene and some scene lighting is desired, reduce the Max Light Count and Light Sampling or Max Light Samples instead.

  • If many volumes are shown, reducing the Volume Quality will improve interactivity. Turning off Transparency may help as well, though at a fairly large quality decrease.

  • Transparency causes more passes to be rendered and can result in slower rendering, if transparent objects are present. Volumes, sprites, materials with alpha less than one, and RGBA textured materials will all cause a transparency pass to be rendered. Try lowering the Transparency Quality first, then disable it if needed.

  • Shadows can slow down the system, especially if there are many lights in the scene, or if area lights or portals are used and the Shadow Quality is set to Area or above. Try reducing the shadow quality first. You can also disable a light from rendering in the viewport by turning it off in the Scene Graph Tree in LOPs, or by turning off the Enable Light in Viewport parameter in the Light object in objects.

  • Try using a non-shaded mode such as Hidden Line Ghost, MatCap Shaded, or Wireframe.

  • Turn off visualization.

Viewport Memory Management

Graphics hardware has a limited pool of on-board memory (VRAM). Exceeding this limit will result in geometry, textures, and framebuffers swapping in and out of system memory. This can be observed as a frame rate stutter which may gradually correct itself. Houdini also uses VRAM in other areas (such as OpenCL simulations, COPs, and Karma XPU), which may contribute to a low memory situation that can affect interactive performance. In extreme cases, geometry disappears or the entire application becomes sluggish.

There are several ways that the 3D viewer uses VRAM:

  • Geometry - models and particle systems.

  • Textures - 2D textures on materials; shadow maps; environment maps on environment lights; 3D textures for volumes.

  • Framebuffers - textures and windows used to display information on the screen.

Geometry can be reduced in several ways, as stated above in Viewport Performance.

Texture usage can be reduced by disabling mipmapping, on the Material tab, or by changing the settings found on the Optimization ▸ Textures page. Reducing the maximum size of a texture, or its default bit depth, can decrease the overall memory use of material textures. Remove material textures entirely by turning off Display Textures in the Textures tab.

Textures used by shadow maps can be reclaimed by turning shadows off, or by using Ray Tracing (though this has its own cost).

Ray tracing creates an acceleration structure for each object or primitive, which roughly doubles the memory use required for geometry. Turn off this option to free up memory.

Framebuffer usage can be reduced by lowering Scene Antialiasing. Scene Antialiasing increases the framebuffer size by the antialiasing factor (4× or 8x) and can be a major source of VRAM use.

Framebuffer memory increases as the size of the Houdini window increases. A high resolution display, such as the 2560×1536 resolution found on many 30" monitors, will consume much more VRAM than a smaller resolution. Using multiple monitors will double or triple the framebuffer use as well.

Tip

Use the gpumem command to list all GPUs and inspect the VRAM usage for each GPU by the various parts of Houdini, including the 3D viewer.

Basics

Getting started

Next steps

Customization

Guru-level