RMS 18
Import Reyes Shader


return to main index



Introduction

This tutorial demonstrates how to import a shader into HyperShade. If the reader does not have access to a pre-compiled (.slo) shader the source code shown below can be used to generate a very simple shader. The code should be saved as redLeft.sl.


Listing 1 (redLeft.sl)


surface
redLeft(float  Kfb = 1 /* fake brightness */)
{
color surfcolor = 1;
if(s <= 0.5)
    surfcolor = color(1,0,0);
        
Oi = Os;
Ci = Oi * Cs * surfcolor * Kfb;
}

Open the redLeft.sl file in Cutter and use alt+e, control+e or apple+e to compile the shader. For more detailed information about compiling a shader refer to the tutorial "Cutter Setup: RenderMan Shader Writing".

The location of the compiled (.slo) shader file can be confirmed by looking at the "Options" tab of the Process Monitor - figure 1.



Figure 1


HyperShade

Open the HyperShade editor and choose,
    RenderMan/Reyes->Shaders->RenderManShader



Figure 2


In the attribute editor use the yellow directory button to browse for the .slo file.



Figure 3


Assign the shader to an object or objects in the scene and render. Since the simple shader given in listing 1 does not call any lighting functions the scene will not require any lights.








© 2002- Malcolm Kesson. All rights reserved.