|On this page|
Houdini’s 3D viewport has the ability to produce an interactive version of many lighting effects found in offline renderers. In addition, color correction through Lookup Tables (LUTs) and gamma correction can be applied.
Lighting in the Viewport
Many of the light types in Houdini have been modeled with OpenGL shaders. These light shaders produce a good approximation to the final rendered result so that lighting can be adjusted interactively. By default, most lights are rendered as point and spot lights, including area and environment lights. High Quality Light Shading, found on the 3D Viewer Display Options Effects tab and on the right toolbar, is used to enable the more complex shaders for these lights.
Area and environment lights require multisampling of the light source, and the Area Samples parameter in the 3D Viewer Display Options controls their rendering quality (default 16 samples). Increasing the value improves the quality, but slows down rendering.
High Quality Light Shading also enables an infinite number of lights in the viewport, avoiding the limited number of OpenGL lights (usually 8 or 16). Greater numbers of lights will gradually impact performance. This can be limited by the viewport display option Max Light Count display option (Lights tab) to preserve performance with many hundreds of lights. The top lights are selected by brightness.
Ramp-based light attenuation is also available in High Quality Light Shading mode, as is cone light soft edge falloff and projected light textures.
Finally, screen space ambient occlusion is only available when High Quality Light Shading is turned on. This emulates ambient occlusion by darkening edges and impressions, but it cannot do occlusion from more distant objects. It respects the Unit Length of the hip file when determining distances for occlusion shadowing.
Shadows are also supported from all light types. They can be enabled on the Effects tab of the 3D Viewer Display Options, or by using the Shadows toggle button on the right toolbar. While point lights cast hard shadows, environment and area lights can cast softer shadows.
The shadow quality can be changed from basic hard-edged shadows for all lights to smoothed, soft area shadows by clicking RMB the Shadows icon or using the Quality option in the 3D Viewer Display Options. Area shadows do not affect point lights, they will always use point shadows. Shadowmaps for lights are cached and only regenerated when the light’s casting area changes, or when the geometry producing shadows changes.
The higher quality shadow options can affect interactivity when adjusting lights or geometry in the scene. It is recommended that you reduce the shadow quality or turn them off altogether if the scene becomes choppy when modeling or positioning lights.
High Quality Lighting only runs in perspective views. Normal quality lighting will be used when orthographic projections (Top, Left, Front) are active. Flat shading is also unsupported; smooth shading will always be used.
The default shader used by the viewport has support for basic lighting, multiple textures and light-based textures. The Mantra Surface Material has these properties built in, but they can be added through the Edit Rendering Parameters interface for other shaders. The viewport rendering parameters can be found in the SHOP/OGL subfolder.
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 the MaterialX section below for more information).
Custom GLSL shaders may be used in the viewport as well, 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.
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 USD Preview Surface
Mtlx Unlit Surface
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 in GL:
Ambient Occlusion (a viewport setting instead)
all Light nodes
EDF and VDF nodes
Subsurface and Generalized Schlick BSDF nodes
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 material with a custom GLSL shader that has the
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.
If the Transparency option is off, cutouts are used instead. Any pixel with a final alpha value of 0.0 will not be drawn, otherwise the pixel will be drawn as if it were opaque.
When the Transparency display option is enabled, the Transparency may be set to Low Quality, Medium Quality or High Quality. These modes greatly improve the quality of transparent surfaces, especially overlapping transparent surfaces. However, High Quality Lighting is not applied to transparent objects for performance reasons. If you wish to see the effect of area or environment lighting on transparent surfaces, disable Transparency.
Low Quality transparency draws transparent objects front-to-back after all opaque objects have been drawn. Intersecting transparent objects will not render correctly, as will some overlapping object cases where the bounding boxes overlap.
Medium Quality transparency draws a limited number of layers, sorted on a per-pixel level. Shadows are not cast on transparent objects and normal quality lighting is performed.
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.
Particle systems can be rendered as sprites if a Sprite POP is present. Sprites are always drawn as transparent objects. 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.
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 8 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 beauty render.
Several effects can be applied after rendering and lighting - Uniform fog, Volumetric Fog, and Depth of Field. These may all be applied at the same time.
when you're going to use the OpenGL ROP.
Subtle uniform fog is also a nice depth cue for large scenes, especially in wireframe.
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 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.
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.
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 for High Quality Lighting
Reduce the Max Light Samples for High Quality Lighting
Turn off Volumetric Fog
Turn off High Quality Lighting
Reduce Volume Quality to Low
Reduce Transparency to Low Quality or Cutout
Turn off Transparency
Reduce Shadow Quality to Point
Turn off Depth of Field
Reduce Scene Antiaiasing to None
Turn off HDR Rendering
The following sections go into greater detail on performance and memory use.
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 Material Shaders on the Effects tab of the 3D Viewer Display Options is a good way to determine if the model 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.
Turn on some culling options on the Optimization ▸ Culling tab of the 3D Viewer Display Options, such as Remove Backfaces (backface culling) and Cull by drawing 'x' primitives out of every 'x' (polygon reduction).
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 earlier generations. All of the following options are found on the Effects tab of the 3D Viewer Display Options.
High Quality Light Shading is the most performance-intensive quality enhancement available. Disabling this will provide the highest performance increase, especially if many lights are in the scene, and complex lights like area, geometry, environment or portals are used. It is not enabled by default.
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 disabling the Enable Light in Viewport parameter in the Light object.
Try using a non-shaded mode such as Hidden Line Ghost or Wireframe.
=== 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.
There are several ways which VRAM can be used by Houdini:
Geometry - models and particle systems.
Textures - 2D textures on materials and for shadow maps; cube textures for environment maps on environment and area lights, plus omnidirectional light shadows; 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 Effects 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. Finally, material textures can be reduced by disabling Multi Texturing or removed entirely by disabling Display Textures n the Effects tab.
Textures used for shadows can be reclaimed by turning shadows off, or by reducing the shadow Quality to Point if many area lights are used on the Effects tab.
Framebuffer usage can be reduced by lowering Scene Antialiasing or disabling HDR Rendering. Scene Antialiasing increases the framebuffer size by the antialiasing factor (2x, 4x, 8x) and can be a major source of VRAM use. HDR Rendering increases the framebuffer size by 50%.
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.