Assigning a Viewer Material Shader
The Viewer is OpenGL based, so for materials to display in the Viewer, they must have an OpenGL Viewer shader. It is this Viewer shader, not a renderer's shader that the Viewer shows when in Shaded (raw) or Shaded (filmlook) modes.
For example, create a primitive, assign a 3Delight shader, and observe the Viewer output in Shaded (raw) mode.
|
1.
|
Create a primitive using a Primitive Create node. |
|
2.
|
Create a 3Delight material using a Material node. |
|
3.
|
Change the Diffuse Color in the Base Layer section. |
|
4.
|
Assign the material to the primitive using a MaterialAssign node. |
|
5.
|
Add a Spotlight using a GafferThree node, then position it. |
|
6.
|
Change the Viewer to Options > Shaded (raw) mode. |
Without a Viewer shader assigned, the primitive in the Viewer defaults to a gray Lambert.
Add a Viewer shader to your material, and observe the Viewer output in Shaded (raw) mode.
|
1.
|
Open the recipe described above. |
|
2.
|
Edit the parameters of the Material node. |
|
3.
|
Click Add shader, and select Surface from the dropdown list. |
|
4.
|
Select KatanaPhong as the Viewer shader type. |
|
5.
|
Edit the diffuse color of the KatanaPhong shader. |
|
6.
|
Change the viewer to Options > Shaded (raw) mode. |
The viewer displays the Viewer shader added to the material node.
Note: To have Viewer shaders mirror production shaders, it’s advisable to link by expression common parameters, such as diffuse and specular color, or texture file path.