render suite - renderman


This page shows the results of creating a render suite consisting of a light, a displacement shader, and a surface shader in conjunction. The light emits no light, it simply message passes the various passes out to the shaders in the scene. This way, you can quickly change render passes to all shaders in the scene.






Basic Idea:

Let's create some shaders we can use in the future!
It would also be really great to have a light that controls render passes.
When the light says to, the shader will perform that surface calculation.
As you can see to the right, all it really does is pass a yes or no, the shader listens.
The important part is that your messages are put in an illuminance loop, so the
light can evaluate it at rendertime.


/*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
are read in. We're just returning a 0 or 1, so it's a float function.
We must be in an illuminance loop, and we check a lightsource for
msg_diffuse and set the C to be whatever it says. Anytime we call
my_diffuse() in our shader, it's a 0 or 1.


//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
in your scene.


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.
Just give the user a string to put in, and convert it to a color
using the function texture();


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
everything turned on. Let's do this in passes, at high res!


		



Below is a breakdown of the elements added together:


		

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player






Here are the individual layers!
I had issues with the reflection pass
intensity and saturation compared to the beauty.
Luckily it was split into a pass so
manipulation of the individual layers
to sum up to the final image.


Ambient, Mask
Diffuse, Specular
Reflection, Occlusion
		




Conclusion: This project worked pretty well, the purpose of the shader suite
is very decisive and focused. It only scratches the surface of
what can be added to it, but it's a good foundation. The next
step would be adding controls and message passign for indirect
and subsurface passes.