ML Blog

雕刻时光
Sculpting in time

每一个故事都有起点与终点
Every story has a beginning and an end.

7-Minute Read

Reference

Renderman 24 For Blender Doc

Shading

Materials and shading networks in RenderMan for Blender are built up pretty much the same way as Blender’s built-in renderers, using the Shader Editor. However, there are some shortcuts and UI widget differences.

Attaching a Material

You can attach materials (bxdf’s) to selected objects using the shortcuts in the Object Context Menu:

This will attach the selected material to the selected objects in the outliner.

You can also attach material to an object in the usual way within the Material Properties tab

Click New:

Then click Add RenderMan Nodetree

and select the RenderMan material you want to use.

RenderMan shading networks will always terminate with a RenderMan Material Output node.

Here’s an example shading network:

Patterns

Pattern nodes can be connected to materials or other patterns in the usual way using Shader Editor. or directly within the Material properties Tab.

For parameters that can take a pattern connection, a will be shown next to the parameter value. This is our connection widget.

Clicking on the widget will show our connection menu. Here’s an example:

Patterns will be broken up into categories for easier browsing. The __EXISTING__ section will show existing nodes in the shader graph that you can connect to. If the parameter is already connected some more options will appear.

The top line will show what node is currently connected to this parameter. The Disconnect item will disconnect the parameter from the incoming node. The Remove item will disconnect and remove the incoming node from the graph. Solo Input Node allows you to solo the incoming node. This is useful if you want to concentrate on tweaking the node, independent of the whole material.

Displacement in Blender

To render displacement on your geometry in RenderMan for Blender, use the PxrDisplace node.

Adding PxrDisplace

To add PxrDisplace, make sure you’ve already added a RenderMan material to your geometry. In the material properties , under the Displacement panel, select PxrDisplace from dropdown list next to “Displacement”.

The main parameters you will probably be working with are:

  • Gain: Gain for the displacement. If it is zero, there will be no displacement.

  • Scalar Displacement: Scalar displacement input. This is a float displacement.

  • Vector Displacement: Vector displacement input. Vector displacement data is a three channel data file, XYZ.

There are also some utility patterns for displacement:

Avoiding cracks on polygonal meshes

When displacing a mesh with hard normals, faces can separate and create cracks. Displacement moves vertices in the direction of its normal but adjacent vertices on different sides of a hard edge have different normals and will move is different directions, creating gaps or cracks.

RenderMan has a “polygon:smoothdisplacement” attribute that will create a fully smoothed copy of the normals and use it instead of the original normals.

n RenderMan for Blender, this attribute is enabled by the “Prevent polygon cracking” check box in the object data properties on the mesh.

Fur/Hair Shading in Blender

Fur and hair rendering/shading with RenderMan for Blender can be done in the usual way when rendering hair in Blender. The main RenderMan material used for hair is PxrMarschnerHair.

Creating a Hair System

To create a hair system, select the mesh object you want to add hair, and click on the particle properties. Add a new particle system and select Hair.

Your object should look something like this in the viewport.

Shading Hair

As mentioned earlier, we will use the PxrMarschnerHair material to shade our hair. To do that, click on the material properties for your mesh . In the material list, click the + button to add a new material slot, then click New.

Click Add RenderMan Nodetree and then select PxrMarschnerHair from the dropdown menu.

Back in the particle properties , go under the Render section and change Material to the new PxrMarschnerHair material we added.

Artistic Control

The PxrMarschnerHair material should enough to render realistic hair. However, the parameters can be a little too technical. For more artist friendly controls, the PxrHairColor pattern node can be used in addition to PxrMarschnerHair. There are three outputs from PxrHairColor that need to be connected to PxrMarschnerHair. It’s best to use the Shader Editor to do the connections. The image below shows how they should be connected.

Changing Mode to Artistic will give you more artistic friendly control to help with hair shading.

Hair ID Primvar

PxrHairColor includes controls for adding randomness to the color. This is controlled by an ID primitive variable. In RenderMan for Blender, we add an “index” primitive variable for each strand of hair. This “index” primitive variable can be used as the source for the ID primvar.

Material Layering with PxrLayerSurface in Blender

RenderMan allows for creating complex looks through layering materials. This means effects like car paint, labels on bottles, dirt or mud, can all be layered efficiently for rendering.

Below you can find a step by step example of creating a patina on a bronze monkey head, using PxrLayerSurface. PxrLayerSurface is the same as PxrSurface except that most of the parameters that don’t apply to layering have been hidden from the UI.

Attach Material

Attach a PxrLayerSurface material to your selected object. You can do this via the object context menu.

For PxrLayerSurface, RenderMan for Blender will automatically add a PxrLayerMixer node, along with two PxrLayer nodes that will act as a base layer and an upper layer. Here’s what your network should look like at the start:

Base Layer (copper)

For the base layer, we will create a copper look. First, rename the PxrLayer node that’s connected to the PxrLayerMixer’s Base Layer parameter, to something like copper. Here are the settings for our copper layer:

Layer 1 (patina)

For the upper layer, we will create a patina look. Like the base layer, rename the PxrLayer node to be called patina (this is connected to PxrLayerMixer’s Layer 1 parameter). Here are the settings for our patina layer.

Masking

If you render your scene as is, you’ll notice that only the patina layer is showing, and none of the copper layer. In order to mix the two together, we need to use a mask value. For the mask, we will use a PxrDirt pattern node. Start by creating a PxrDirt node and connecting the resultR output to the Layer 1 Mask parameter of PxrLayerMixer. You can do this in the shader editor, like the image below:

or use the connection widget in the material panel, like this:

Below are the settings we will use for our PxrDirt.

To help break up the mask a bit, we connected a PxrGamma to the Unoccluded parameter, and then connected a PxrFractal pattern to PxrGamma’s Input Color parameter.

If you want to work on the mask value, independent of the whole network, you can use the Solo Node function. Click the connection widget on the material panel, then click on Solo Input Node.

Result

Here’s the result of our layered material.

For more added realism, consider using a PxrBump pattern, connected to the Global Bump parameter of each layer to create a more uneven surface.

UDIMs in Blender

Working with UDIMs in Blender is very straightforward.

If your textures use the Mari UDIM style and the filename is: Diffuse.1001.tex, you need to set the Atlas Style to UDIM (Mari) and in the filename parameter, use Diffuse.<UDIM>.tex for the textures to load into their correct UDIMs.

Note : <UDIM> can be in either UPPER or lowercase <udim>

A Mari UDIM example for the first UV tile would be Diffuse.1001.tex where “1001” replaces <UDIM> in the texture filename.

Value Filename Atlas Style Use in Path Alternative
0 Diffuse.1001.tex UDIM (Mari) Diffuse.<UDIM>.tex Diffuse.<udim>.tex
1 Diffuse.U1_V1.tex UV Tile Base-1 (Mudbox) Diffuse.<U>_<V>.tex
2 Diffuse.u0_v0.tex UV Tile Base-0 (Zbrush) Diffuse.<u>_<v>.tex

Recent Posts

Categories

About

不断的学习思考, 保持好奇心
Keep thinking, Stay curious
始终保持对于新事物的敏感
Always be sensitive to new things