View Full Version : SLIM: RSL occlusion switch from read to bake

05 May 2005, 01:02 AM
I wrote a SLIM palette for occlusion that has a switch between baking a point cloud and reading a brickmap. This is just the RSL code inside the .slim file. For straight RSL, The "void" would be changed to "surface" , among other changes...
Mode 0 is read and 1 is bake. After baking with raytracing, one can convert the point cloud to a brickmap, and switch it to read. Then you don't need to raytrace for occlusion renders.
When baking, SLIM palette must contain a ribbox called "FrameBox" that says
DisplayChannel "occlusion"

A current error with the filename is that if you use a colon in the filename, it throws an unknown variable type in the point cloud display driver, and the point cloud can't be converted into a brickmap. By default it renders to the maya/bin folder.
EDIT: solution:

defaults are: opacity 1,1,1
samples 64
maxdist 5
file "file.ptc"
mode 0
displaychannels "occlusion"
Ci 1,1,1
Oi 1,1,1
envdir 0

RSLFunction {
void byus1e_occSwitch( color opacity;
float samples;
float maxdist;
string file;
float mode;
string displaychannels;
output color Ci;
output color Oi;
output vector envdir;)
float occ = 0;
float ok;
normal Nn = normalize(N);
if(mode == 0) {
ok = texture3d(file, P, Nn, displaychannels, occ);
/***if texture didn't exist, render white.****/
if (ok != 1)
occ = 0;

occ = occlusion(P, Nn, samples, "maxdist", maxdist, "environmentdir", envdir);
bake3d(file, displaychannels, P, Nn, displaychannels, occ);
Oi = opacity;
Ci = (1 - occ) * Oi;

CGTalk Moderation
05 May 2005, 01:02 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.