Applying and Editing Realtime Shaders
Applying and editing realtime shaders is similar to applying and editing mental ray shaders. However, it’s important to remember that the render tree is the only place where you can connect them to one another.
When you connect realtime shaders, the order in which they’re connected defines the order of execution. In the example below, the OGL Shade node sets up a fixed function shading pipeline, while the OGL Draw node draws the object in the 3D view. If you invert the order, then the object would be drawn before it was shaded, leading to a different, and most likely undesired result.
That said, it’s important to remember that only Draw nodes should ever be connected to an object’s material node because they are responsible for drawing the realtime effects created by the shade trees that feed into them.
You can attach a realtime shader to an object using either the Material menu commands on Render toolbar or the render tree.
You can apply realtime shaders to an object using the presets available from the Material menu in the Render toolbar. Applying realtime shader preset to an object automatically creates a local material for the object.
To connect a realtime shader preset to an object
1. Select an object.
2. From the Render toolbar, choose one of the
following presets from the
Get > Material menu:
Preset |
Result |
OGL Combined |
Connects an OGL Combined node (OGLCom) to the realtime input of the object’s material node. |
OGL One Pass |
Creates a one-pass realtime shader tree consisting of an OGL Draw node, and OGL Shade node, and OGL Texture Transform node, and an OGL Texture node. The draw node is connected to the realtime input of the object’s material node. |
OGL Two Pass |
Creates a two-pass realtime shader tree consisting of an OGLShade node, two OGL Texture nodes (one for each pass), two OGL Texture Transform nodes (one for each pass), and two OGL Draw nodes (one for each pass). The last draw node is connected to the realtime input of the object’s material node. |
OGL Three Pass |
Creates a three-pass realtime shader tree consisting of an OGLShade node, three OGL Texture nodes (one for each pass), three OGL Texture Transform nodes (one for each pass), and three OGL Draw nodes (one for each pass). The last draw node is connected to the realtime input of the object’s material node. |
OGL Alpha Transparency |
Creates a one-pass realtime shader tree consisting of an OGL Draw node, and OGL Shade node, and OGL Texture Transform node, and an OGL Texture node. The draw node is preconfigured for alpha blending and its OGL Draw node is connected to the realtime input of the object’s material node. |
More... |
Opens a browser to the Material shader folder. You can navigate to the Realtime shader folder and select any draw-capable realtime shader to apply to your object. |
3. Press 7 to open the render tree in which you can see and modify the preset’s structure.
|
Applying a realtime shader preset overwrites any existing shaders that are applied to the object. |
Using the render tree to connect realtime shaders to each other gives you the most precise control over the structure of the realtime shader tree. The first node that you get and connect to your object’s Material node should be a Draw shader.
To connect realtime shaders in the render tree
1. Select an object that has a local material applied to it.
2. Press 7 to open a render tree.
3. Do one of the following:
- If you want to build an OpenGL shade tree, choose Realtime OpenGL > OGL Draw from the Nodes menu to get an OGL Draw node.
- If you want to build a DirectX shade tree, choose Realtime DirectX > DX Draw from the Nodes menu to get an DX Draw node.
4. Connect the Draw node to the material node’s RealTime input.
5. Now you can select additional realtime shaders from the Nodes > Realtime menus and connect them to the draw node.
Like mental ray shaders, you edit realtime shaders using their property editors. You can access the realtime shaders’ property editors in almost as many ways as you can access those of mental ray shaders.
One important difference to keep in mind is that when you open a realtime shader’s property editor, a combined property editor is displayed. The combined editor displays the property pages of every shader sequentially, from the one you selected to the one farthest from the material node.
Information about realtime shader parameters listed in their property editors is available from the help topic for that property editor.
To open a realtime shader’s property editor
• Do one of the following:
- In the render tree, double-click the realtime shader that you want to edit, or select it and press Enter.
or
- Select the object whose shader you want to edit and choose Modify > Texture from the Render toolbar. All of the realtime shaders connected to the object are listed alphabetically in the submenu. Select one.
or
- 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 shader icon
beneath the RealTime node to open its related property editors.
|
You cannot use the Modify > Shader command to edit realtime shaders. • If the object has a mental ray surface shader attached, this command opens the surface shader’s property editor. • If no surface shader is connected, the command has no effect. |
To detach a realtime shader
• Do one of the following:
- 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 in the Material and Shader Basics guide.
or
- Delete the shader from the explorer: it is removed, as well as any shaders that were connected to its Previous input.
You can delete a shader by selecting it in either the explorer, render tree, or schematic view and pressing Delete. The shader is removed from all views.
SOFTIMAGE|XSI v.6.01