Blot12345
10-21-2009, 04:28 AM
Hi everyone,
I just started getting into renderman shader writing. I am trying to figure out how the bake3d function works. I used the shader below to try to bake out a .ptc file, however I don't think the ptc file is being baked correctly. I only get black images when I use the ptrender utility, and no data shows up when I open the .ptc file in 3Delight's ptcviewer utility. Is there any easy way to verify the contents of a ptc file? Can anyone see an error in the shader below? (I am using Renderman for Maya 3.0.1 in Maya 2009)
Edit: I think my problem may have to do with assigning "DisplayChannels" in maya. I know in an RIB file the syntax is: DisplayChannel(channel name). Is there a maya equivalant?
Any help would be greatly appreciated.
surface
bake_radiance_t(string filename = ""; color Kdt = 1)
{
color irrad, rad_t;
normal Nn = normalize(N);
float a = area(P,"dicing"); //micropolygon area
/* Compute direct illumination (A and D) */
irrad = ambient() + diffuse(Nn);
/* Compute the radiance diffusely transmitted through the surface, Kdt is the surface color */
rad_t = Kdt * irrad;
/*Store in ptc file */
bake3d(filename, "_area,_radiance_t", P, Nn, "interpolate", 1, "_area", a,"_radiance_t",rad_t);
Ci = rad_t *Cs *Os;
Oi = Os;
}
Thanks,
-Alex
I just started getting into renderman shader writing. I am trying to figure out how the bake3d function works. I used the shader below to try to bake out a .ptc file, however I don't think the ptc file is being baked correctly. I only get black images when I use the ptrender utility, and no data shows up when I open the .ptc file in 3Delight's ptcviewer utility. Is there any easy way to verify the contents of a ptc file? Can anyone see an error in the shader below? (I am using Renderman for Maya 3.0.1 in Maya 2009)
Edit: I think my problem may have to do with assigning "DisplayChannels" in maya. I know in an RIB file the syntax is: DisplayChannel(channel name). Is there a maya equivalant?
Any help would be greatly appreciated.
surface
bake_radiance_t(string filename = ""; color Kdt = 1)
{
color irrad, rad_t;
normal Nn = normalize(N);
float a = area(P,"dicing"); //micropolygon area
/* Compute direct illumination (A and D) */
irrad = ambient() + diffuse(Nn);
/* Compute the radiance diffusely transmitted through the surface, Kdt is the surface color */
rad_t = Kdt * irrad;
/*Store in ptc file */
bake3d(filename, "_area,_radiance_t", P, Nn, "interpolate", 1, "_area", a,"_radiance_t",rad_t);
Ci = rad_t *Cs *Os;
Oi = Os;
}
Thanks,
-Alex
