Houdini 17.5 Nodes Shader nodes

Material shader node

A higher-level shader that can contain one or more sub-shaders, such as surface shaders, displacement shaders, and property shaders.

On this page

Overview

The Material node is a container for other shader types, letting you "package up" combinations of lower-level shaders (such as surface shaders and displacement shaders) with individual settings into a new "look" you can assign as a single unit.

The gallery of materials in the material palette pane are all customized examples of the Material shader.

See the documentation for the gallery materials that ship with Houdini.

Creating and editing materials

Through Houdini’s parameter editing interface, you can promote parameters from contained shaders onto the material, letting you create a material with a custom interface, where users can manipulate some of the underlying parameters but others are kept hidden.

To...Do this

Create a new Material from scratch

In the network editor, Go to the /shop level and create a Material node, then double-click the node to go inside. Create and edit shader nodes inside the material and connect them to the special "suboutput" node.

Customize an existing material from the gallery

Click the Material Palette pane. Drag one of the materials from the gallery (on the left) into the list of shaders in the scene (on the right). Then you can edit the material’s settings, edit the shaders inside, or edit its interface.

See the material palette documentation for more information.

Promote parameters from contained shaders onto the Material node

In the material’s parameter editor, click the Gear icon and choose Edit parameter interface. Under Create parameters, click the From nodes tab, then drag parameters from shaders inside the material into the Existing parameters list to promote them.

See the parameter editing window documentation for more information.

Override a material’s settings per-object or per-primitive

See rendering properties.

Examples

Down Hill Lava Flow Example for Material shader node

In this file we create a downhill lava flow with crust gathering and hardening at the base of the slope. All of the animation is achieved through the shader itself, and all of the geometry is completely static.

Note

Most of the parameters for the lava material are overridden by point attributes created in the surface nodes.

FirePit Example for Material shader node

Note

No geometry is animated in this file. All animation is achieved by animating the textures

Flames are grids so that UV textures can easily be applied, they are then warped around a metaball using a magnet SOP. The flames are then assigned to either a yellow or blue Flames texture. The Flames' opacity mask wrap is set to Decal to prevent the texture from repeating and showing a single pixel ring at the top of the flame geometry. I'm also using a mask file named flameOpacMap.jpg to enhance the flames' shape at the top. The noise offset has been animated over $T with an greater emphasis on the Y axis so that the flames look like they are rising. This is the same reason the Noise jitter is larger for the Y axis as well.

The coals are spheres that have been copy stamped onto a deformed grid. Using Attribute Create surface nodes I am able to override and copy stamp the lava texture’s parameters at the SOP level so that local variables, such as $BBY, can be used to animate the texture. This way the texture’s crust and its crust values can be used only to form the tops of the coals. This reserves the lava aspect of the texture to be used on the bottoms of the coals. The lava intensity (Kd attribute) is then stamped and animated to create the look of embers on the bottom of coals glowing.

StyleDisplacement Example for Material shader node

This is an example file showing an object made up of two quads, one with a bump map, the other with true displacement. This object is duplicated, and the second copy uses a style sheet to reverse the material assignments on the two quads.

The following examples include this node.

RiverBed Example for Fluid Object dynamics node

A simple river bed has a fluid source and fluid sink set up so that liquid rushes down the river.

rbdsmokesource Example for Smoke Object dynamics node

A ghostly tetrahedron bounces around a box, its presense shown by its continuous emission of smoke.

StickyDonut Example for Sticky object node

In this example, a donut is stuck to an animated sticky object on the surface of a grid.

MotionVector Example for Mantra render node

The example demonstrates how to generate a motion vector layer for post-velocity compositing. Load the example and render 5 frames. Then in the image viewer, switch from 'C' (colour) to 'motion_vector' to see the results.

Volume Rendering - File Referenced Smoke Example for Mantra render node

Volume rendering is a rendering approach that allows high-quality, integrated rendering of volumetric effects like smoke, clouds, spray, and fire.

Volume rendering is suitable for rendering many types of volumetric effects. Scenes that are particularly suited to rendering with mantra volumes include:

  • Detailed "hero" clouds, smoke, or fire

  • Fields of instanced clouds, smoke, or fire

Scenes where volume rendering may not be quite so applicable include:

  • Scenes with a single uniform fog

In this particular example, a bgeo file (1 frame only) was exported from a fluid simulation of smoke and is now referenced using the File SOP. A material using VEX Volume Cloud is assigned to this volumetric data at the top level of the Volume Object. To see this scene in shaded mode, ensure that HOUDINI_OGL_ENABLE_SHADERS is set to 1 in the environment variables.

Controlling Quality/Performance

Volume rendering uses ray marching to step through volumes. Ray marching generates shading points in the volume by uniformly stepping along rays for each pixel in the image. There are two ways to change the quality and speed of the volume ray marching:

  1. The samples parameter on the Sampling tab of the mantra ROP. More pixel samples will produce more ray marches within that pixel leading to higher quality. Using more pixel samples will also improve antialiasing and motion blur quality for the volume.

  2. The volumesteprate parameter on the Sampling tab of the mantra ROP. A larger volume step rate will produce more samples in the volume interior, improving quality and decreasing performance. A separate shadow step rate can be used for shadows.

Which parameter you should change will depend on your quality requirements for pixel antialiasing. In general, it is better to decrease the volume step size rather than increase the pixel samples because a smaller volume step size will lead to more accurate renders.

This render uses 2×2 samples and volume step rate of 1. Notice the detail in the shadows.

This render uses the same scene with 4×4 samples and a volume step rate of 0.25. The fine detail in the shadow has been lost and the volume is somewhat more transparent. The quality level is approximately the same.

RampReference

This example demonstrates the use of ramps and referenced ramps which are animated over time.

Down Hill Lava Flow Example for Material shader node

In this file we create a downhill lava flow with crust gathering and hardening at the base of the slope. All of the animation is achieved through the shader itself, and all of the geometry is completely static.

Note

Most of the parameters for the lava material are overridden by point attributes created in the surface nodes.

FirePit Example for Material shader node

Note

No geometry is animated in this file. All animation is achieved by animating the textures

Flames are grids so that UV textures can easily be applied, they are then warped around a metaball using a magnet SOP. The flames are then assigned to either a yellow or blue Flames texture. The Flames' opacity mask wrap is set to Decal to prevent the texture from repeating and showing a single pixel ring at the top of the flame geometry. I'm also using a mask file named flameOpacMap.jpg to enhance the flames' shape at the top. The noise offset has been animated over $T with an greater emphasis on the Y axis so that the flames look like they are rising. This is the same reason the Noise jitter is larger for the Y axis as well.

The coals are spheres that have been copy stamped onto a deformed grid. Using Attribute Create surface nodes I am able to override and copy stamp the lava texture’s parameters at the SOP level so that local variables, such as $BBY, can be used to animate the texture. This way the texture’s crust and its crust values can be used only to form the tops of the coals. This reserves the lava aspect of the texture to be used on the bottoms of the coals. The lava intensity (Kd attribute) is then stamped and animated to create the look of embers on the bottom of coals glowing.

VolumeNoiseIso Example for Mantra: VEX Volume Procedural shader node

This example shows how to render an isosurface defined by a cvex shader using mantra’s volume rendering capabilities. A noise field is generated by a cvex shader, which is attached to the VEX Volume Procedural. The volume is shaded by finding the surface where the density crosses 0, and then shading using a simple surface shader that shows the normals.

FluffyTorus Example for Bake Volume geometry node

This example shows how to setup the Bake Volume SOP to compute the lightfield created by the shadowing of a fog volume. It then exports the fields properly to be rendered in Mantra by a constant volume shader.

FurBallWorkflow Example for Fur geometry node

This example demonstrates how the Fur SOP and Mantra Fur Procedural can be applied to an animated skin geometry. CVEX shaders are used to apply a custom look to the hairs based upon attributes assigned to the geometry.

FurPipelineExample Example for Fur geometry node

This example illustrates how custom shaders can be used to define the appearance of fur generated by the Fur SOP.

FurTextureMap Example for Fur geometry node

This example demonstrates how to use a texturemap to color fur.

RaytraceVopShader Example for Ray Trace VOP node

This example demonstrates a simple ray traced shader using a vop vex network. To modify the shader properties, create a properties shader in the material and connect it to the output shaders node. You can then add rendering parameters to the properties node. For example to control the number of reflection bounces, you would add the reflect limit parameter.

Shader nodes