Your Ad Here

Applying and Editing Shaders

There are several ways in which you can attach a shader to an object. You can:

• Attach a shader to geometric objects, cameras, lights, and render passes.

• Attach a shader to multiple objects, a group, and to a hierarchy of objects. When you apply a shader to a hierarchy, its properties propagate to all objects in the branch or model.

• Attach a shader to a cluster of polygons to define local materials and textures.

• Assign a tree of shaders to a single property of another shader.

 

You can also drag and drop a shader from a browser or toolbar to elements in your scene displayed in the explorer or render tree. If you try to attach a shader to an incompatible object type (for example, you cannot attach a lens shader to a light), the mouse pointer displays a circle and bar icon to indicates that you cannot perform the action.

Attaching Surface Shaders to Objects

The first shader that you attach to a new object will likely be a surface shader. Surface shaders define the object’s basic surface shading characteristics. You can apply surface shaders using any of the techniques described below or using the Get > Material menu in the Render toolbar.

For more information about surface shaders and applying them to objects, see Materials and Surface Shaders.

Attaching Shaders to Cameras and Lights

Attaching a shader to a camera or light is very similar to connecting a shader to an object. For more information on how to specifically use shaders with cameras and lights, see Cameras and Lights and Shadows in the Lights and Cameras guide.

Global vs. Local Shaders

When a shader is attached to an object, it is considered a local shader. If it is attached to a scene, it is called a global or pass shader. Pass shaders are attached to the scene at the render pass level and control global rendering attributes like environment shading, volume effects, and the output shaders that are applied to the scene after rendering in complete.

• For more information about applying pass shaders, see Pass Shaders.

• For more information about render passes, see Passes & Partitions in the Rendering guide.

• For more information about applying local shaders, see the information in this section.

Conversion Shaders

As you attach networks of shaders to your objects, you’ll notice that some of them are designated as conversion shaders. Conversion shaders are utility shaders that modify one shader’s output before it is connected to other shader’s parameters. Generally speaking, conversion shaders fall into three categories:

Type conversion shaders allow you to convert a shader’s output from one type of information to another. For example, the Color2Scalar shader converts a shader’s color output into a scalar value.

Color conversion shaders allow you to modulate color information output from a given shader. For example, the Color Correction shader allows you adjust the hue, saturation, level, gamma, and contrast of a shader’s color output.

Simple math shaders allow you to perform basic mathematical operations on the output of a given shader. For example, the Scalar Share shader allows you to share a single scalar value between several other shaders.

Typically, these shaders require some adjustment of their parameters when you first connect them, but require little adjustment afterwards. Having them designated as conversion shaders is useful for navigation purposes because, by default, they are bypassed when you navigate between shader property editors.

When you open a shader’s property editor, you can tell which of its parameters are connected to other shaders via conversion shaders because their connection icons are red and marked with a small “c”.

 

By holding the mouse pointer over the connection icon, you can display a list of the conversion shaders between the current shader and the next non-conversion shader.

 

Inserting Conversion Shaders

Although you can connect conversion shaders directly to other shaders’ parameters, it’s more likely that you’ll want to insert them between two shaders that are already connected. You insert conversion shaders from other shaders’ property editors, or in the render tree.

• For more information about inserting conversion shaders from property editors, see Using the Connection Icon.

• For more information about working with conversion shaders in the render tree, see Inserting Nodes.

Applying Shaders

Once you’ve attached a material and surface to your object(s), you can start to create virtually any type of surface you want. You can use any of these methods to attach any further shaders:

• Using the Shader menu on the Render toolbar, as described in the following procedure.

• Using the connection icon in a shader’s property editor, as described [here].

• Using the render tree, as described [here].

Regardless of which method you use to apply a shader, the shader’s property editor opens in a floating window as soon as it is applied.

Using the Shader Menu (Render Toolbar)

Once you have applied a surface shader to an object, you can map almost any shader on to any parameter of the material node.

To map a shader

1. Select an object and choose Get > Shader from the Render toolbar. The menu that appears lists all of the object’s Material node’s inputs—or ports.

 

2. To connect a shader to one of the Material’s ports, open the port’s sub-menu and choose one of the following options:

[spacer]

Option

Result

Edit

If a shader is already connected to the port, this option opens its property editor.

If the connected shader is a conversion shader, the next connected non-conversion shader’s property editor is opened. See [here] for details.

Disconnect

Cuts the connection between the port and an attached shader.

Insert

Opens a sub-menu from which you can select a conversion shader (Invert, Color Correction, and so on) to connect to the port.

If a shader is already connected to the port, the conversion shader is inserted between the port and the previously connected shader.

Edit Conversions

Opens a combined property editor for all conversion shaders connected in series to the port.

For example, if a Phong shader’s diffuse parameter is connected to a Color Correction shader, which is connected to an Intensity shader, which is connected to an Image texture shader, choosing Edit Conversions opens a combined property editor for the Color Correction and Intensity shaders.

[Various shaders]

Lists shaders that are commonly associated with the port. Selecting one of these shaders connects it to the port.

If a shader is already connected to the port, it is disconnected and replaced with the new shader.

Clips

Opens a sub-menu listing all of the scene’s image clips. Choosing a clip connects it to the port via an Image shader.

Sources

Opens a sub-menu listing all of the scene’s image sources. Choosing a source creates a clip from it and then connects the clip to the port via an image shader.

More...

Opens a browser so you can select any shader from the shader library. The selected shader is connected to the parameter.

If a shader is already connected to the parameter, it is disconnected and replaced with the new shader.

Note: Once you select a shader from the browser, it appears in a list of most recently used shaders under the More... option.

 

You can tell when a port is already connected to a shader because its entry in the Get > Shader menu is marked with a (=).

3. Once you select a shader to connect to a parameter, the chosen shader’s property editor opens automatically. You can now edit its parameters.

Using the Connection Icon

When you apply a shader to an object, the shader’s property editor opens. To the right of each parameter, there is a “plug” connection icon . Click the icon to open a menu of shaders that you can attach directly to the parameter. Attaching a shader to a parameter lets you control the parameter with another shader instead of a simple color or numeric value.

Once a shader is connected to a parameter, you can use the same menu to disconnect it, connect another shader, or insert a conversion shader between the parameter and the shader you just connected to it. You can also use this menu to blend shaders with specific parameters using texture layers.

To connect a shader to a parameter

1. From any shader’s property editor, click the connection icon for the parameter you wish to connect to another shader.

 

2. From the menu, choose one of the following:

[spacer]

Option

Result

Edit

If a shader is already connected to the parameter, this option opens its property editor.

If the connected shader is a conversion shader, the next connected non-conversion shader’s property editor is opened. See [here] for details.

Disconnect

Cuts the connection between the parameter and an attached shader.

Blend with

Opens a sub-menu from which you can select a texture shader. The selected shader is blended with the parameter’s value via a new texture layer.

For more information about working with texture layers, see Texture Layering in the Texturing guide.

Insert

Opens another menu from which you can select a conversion shader (Invert, Color Correction, and so on).

If a shader is already connected to the parameter, the conversion shader is inserted between the parameter and the previously connected shader.

Once you connect a conversion shader to a parameter, a small “c” appears in the connection icon.

Edit Conversions

Opens a combined property editor for all conversion shaders connected in series to the parameter.

For example, if a Phong shader’s diffuse parameter is connected to a Color Correction shader, which is connected to an Intensity shader, which is connected to an Image texture shader, choosing Edit Conversions opens a combined property editor for the Color Correction and Intensity shaders.

[Various shaders]

Lists shaders that are commonly associated with the parameter. Selecting one of these shaders connects it to the parameter.

If a shader is already connected to the parameter, it is disconnected and replaced with the new shader.

Clips

Opens a sub-menu listing all of the scene’s image clips. Choosing a clip connects it to the parameter via an Image shader.

Sources

Opens a sub-menu listing all of the scene’s image sources. Choosing a source creates a clip from it and then connects the clip to the parameter via an image shader.

More...

Opens a browser so you can select any shader from the shader library. The selected shader is connected to the parameter.

If a shader is already connected to the parameter, it is disconnected and replaced with the new shader.

Note: Once you select a shader from the browser, it appears in a list of most recently used shaders under the More... option.

The connection icon changes to indicate that a shader is connected to (or blended with) the parameter.

 

3. You can now do one of the following:

- Click the connection icon to open the property editor of the shader that you connected to the parameter.

or

- Right-click the connection icon to reopen the menu from which you can select any of the options listed in step 2.

Using the Render Tree

Using the render tree to connect shaders to each other gives you the widest possible range of control when connecting shaders.

For more information on how to use and create effects with the render tree, see The Render Tree.

 

Editing Shaders

An important part of the process of fine-tuning a scene is editing its shader properties. You can edit every shader using its property editor. Property editors contain the various parameters that define the properties of individual objects, whether they be geometric objects, lights, or cameras. You can display and use multiple property editors simultaneously. For more information on property editors in general, refer to the Scene Elements guide.

Information about parameters listed in the property editor is available from the help topic for that property editor.

 

Editing Shaders Using Commands on the Render Toolbar

1. In a 3D view, select an object whose shaders you want to edit.

2. Do one of the following:

- From the Render toolbar, choose Modify > Shader, to open the object’s surface shader. The property editor opens in a floating window and you can now edit any of its parameters. Click the various tabs to select different parameter groups.

or

- From the Render toolbar, choose Modify > Texture and select a shader from the menu. The property editor opens in a floating window and you can now edit any of its parameters. Click the various tabs to select different parameter groups.

Editing Shaders From a Property Editor

If you already have a shader’s property editor open, you can quickly open the property editors of shaders connected to the current shader’s parameters by clicking any parameter’s connection icon.

• If the parameter is connected directly to another shader, its connection icon is red . Clicking the icon opens the connected shader’s property editor.

• If the parameter is connected to another shader via one or more conversion shaders, its connection icon is red and marked with a small letter “c” . In this case:

- Clicking the connection icon skips the property editors of the conversion shader and goes straight to the next non-conversion shader in the sequence.

Let’s say you have a Phong shader whose diffuse parameter is connected to a Color Correction shader. The Color Correction shader’s Input parameter is, in turn, connected to a Cell texture shader. When you open the Phong shader’s property editor and click the diffuse parameter’s connection icon Cell shader’s property editor opens rather than the color correction shader’s.

- If the conversion shader is the only shader connected to the parameter, clicking the connection icon opens its property editor.

To edit conversion shader properties, right-click the connection icon and choose Edit Conversions from the menu. A combined property editor for all of the conversion shaders attached to the parameter opens.

For more information about conversion shaders, see Conversion Shaders.

• If the parameter is blended with one or more shaders via texture layers, its connection icon is marked with a small blue “L” . Clicking the connection icon simply opens the menu, as it would if the parameter was unconnected. That’s because the texture layers’ property editors are appended to the shader’s property editor, so you can edit the layers properties by scrolling down.

For more information about texture layers, see Texture Layering in the Texturing guide.

Of course a parameter can be directly connected to one shader and blended with others . It might even be directly connected via conversion shaders . In such cases, clicking its connection icon opens the connected shader’s property editor, as described above.

 

To see which shader is connected to a given parameter, hold the mouse pointer over the parameter’s connection icon. The name of the connected shader appears in the tooltip.

 

If the parameter is connected to another shader via one or more conversion Shaders, the tooltip lists all of the conversion shaders as well as the next non-conversion shaders.

 

To open shader property editors in other ways

• With the object selected, click the Selection button on the Select panel to display the selected object’s node. Expand its material node and click the surface-shader icon beneath the surface node to open its related property editors.

 

• Select the object and open a render tree view. Double-click on the shader node you wish to edit.

Detaching Shaders

To detach a shader

• Do one of the following:

- Delete a shader from the explorer: it is removed and no longer affects the object.

or

- Use the render tree to graphically disconnect and/or delete the shader. For more information on how to use the render tree, see The Render Tree.

Deleting a Shader

You can delete a shader by selecting it in the explorer, render tree, or schematic view and then pressing Delete. The shader is removed from all views.



SOFTIMAGE|XSI v.6.01     

Return to Softimage XSI Index


Your Ad Here