render suite - renderman
|
Basic Idea:
|
/*Render Pass Manager Light:
Uses message passing to tell companion shaders what to do.
Included: surface shader and displacement shader.
Makes render passes a breeze!
*/
light lgt_jak_passManager(
float Diffuse_OnOff = 1;//Turns Diffuse On and Off
float Specular_OnOff = 1;//Turns Specular On and Off
float Ambient_OnOff = 1;//Turns Ambient On and Off
float Occ_OnOff = 0; //Turns Occlusion On and Off
float Occ_Invert = 0; //Occlusion Invert, use to generate an occlusion pass by itself
float Reflection_OnOff = 0;//Turn Reflection On and Off
float Fresnel_OnOff = 0;//Fresnel Reflectivity On and Off
float Mask_OnOff = 0;//Turns the shader's mask On and Off
output float msg_occmode = 1;
output float msg_ambient = 1;
output float msg_specular = 1;
output float msg_diffuse = 1;
output float msg_fresnel = 1;
output float msg_reflection = 1;
output float msg_occlusion = 1;
output float msg_indirect = 1;
output float msg_mask = 1;
)
{
normal Nn = normalize(N);
illuminate (Ps + Nn){
Cl = 0;
msg_diffuse = Diffuse_OnOff;
msg_specular = Specular_OnOff;
msg_ambient = Ambient_OnOff;
msg_occmode = Occ_Invert;
msg_fresnel = Fresnel_OnOff;
msg_occlusion = Occ_OnOff;
msg_reflection = Reflection_OnOff;
msg_mask = Mask_OnOff;
}
}
|
Here's an example of how the different messages from the light
|
//Read Diffuse Message Pass from Light, give a 1 or 0 inside this shader.
float my_diffuse()
{
float srf_diff = 0;
float C = 0;
illuminance(P)
lightsource("msg_diffuse",srf_diff);
C = srf_diff;
return C;
}
//Inside the shader:
//Diffuse Switch
if (diff_onoff != 0){
diffusesum = Kd * diffuse(Nf);
}
|
As you can see, there are a lot of options specific to each shader
|
string ColorTexName=""; //Color Texture
float Kd=0.7;//Diffuse Corefficient
string SpecularTexName="";//Specular Texture string SpecularTexName=""; //Specular Texture
float Ks=1;//Specular Coefficient
float Spec_size=0.01;//Specular Size
float Spec_sharpness = 0.02,//Specular Sharpness
Ka=1;//Ambient Coefficient
float Ambocc_Samples = 64,//Occlusion Samples
Ambocc_Maxvariation = 0.02,//Max Variation
Ambocc_Coneangle = 180,//Cone Angle, change to get normal occlusion or reflection occlusion
Ambocc_Maxdist = 100;//Max Distance (Search for Occlusion Proximity)
float Ambocc_density=1;//Density of Occlusion
string Hitmode = "primitive";//Hit Mode
string EnvTexName = ""; //Environment Texture
float Kr=0.3,//Reflective Coefficient
Fresnel_Amp=1,//Rim Amplitude
Fresnel_width=1;//Rim Width
float Raytrace = 0;//Turns on Raytraced Reflections
float Rfl_blur = 0;//Reflection Blur Ammount
float Rfl_samples = 1;//Reflection Blur Samples
float Rfl_maxdist = 100;//Reflection MaxDistance
color Mask_Color = 1;//Mask Color
|
It's quite easy to implement texture maps in RSL.
|
string ColorTexName=""; //Color Texture string SpecularTexName="";//Specular Texture color ColorTex = texture(ColorTexName); color SpecTex = texture(SpecularTexName); |
Here's the beauty pass of the final render, with
|
|
Below is a breakdown of the elements added together: |
|
Here are the individual layers!
|
Ambient, Mask Diffuse, Specular Reflection, Occlusion |
| Conclusion:
This project worked pretty well, the purpose of the shader suite
|
|