mcjRIBCook ( for the PC )
mcjRIBCook
mcjRIBCook is an exe [PC] meant to be launched from the command line or through a batch file.
mcjRIBCook.exe and the manual (the page you are reading) are in the zip file at the bottom of this page.
As you know, Daz Studio can output a scene as a RIB file, which can then be rendered using any Renderman compliant renderer ...
As you also know, 3Delight offers a free Renderman compliant standalone renderer
http://www.3delight.com/en/
once installed
when the "license server" is running
you can render RIB files by double-left-clicking on them
or by launching renderdl.exe which is usually located in C:\Program Files\3Delight\bin
If the compiled shaders ( .sdl ) referenced by Daz Studio's RIB files are not of the proper version
the 3delight renderer will complain, and use its own default shaders. The results are usually not good.
If you have access to the source code of the shaders (.sl) you could compile them using shaderdl.exe
which is usually located in C:\Program Files\3Delight\bin
RIB files are often gigantic. In a few seconds, mcjRIBCook can parse a RIB file and substitute RIB
commands and values
the best example is, substitute all the surface shader names for one of your choice
--
the list of substitutions to be performed must be placed in an "opts file"
It's a simple ascii text file, each line must be two columns wide,
the column separator must be one TAB character
SearchKey SubstituteValue
SearchKey SubstituteValue
SearchKey SubstituteValue
SearchKey SubstituteValue
In the first version of mcjRIBCook, leading blank spaces were taken in consideration, in the new version they are not. Which means, you can specify "Surface" as a key, and all lines in the RIB file starting with "Surfaces" will be "hits" without regard for leading blank spaces.
The substitute value will be written with the proper number of leading spaces to preserve the indentation on the RIB file.
Format Format 1280 720 1
Surface Surface "ptc_write"
Display Display "temp.tiff" "file" "rgba"
here is an example of an opts file, the filename is optsPCld.txt. ( it's part of the mcjRIBCook package )
changes all the surface shader names to "ptc_write" preceded by the addition of 3 new attributes
changes the shaders search path from whatever it is, to the path of the rib file
changes the shading rate to 1.0
changes the Format to 1280x720x1
changes the output image name to temp.tiff
Option "searchpath" "string shader" Option "searchpath" "string shader" [ "&:.:${RIBDIR}" ]
ShadingRate ShadingRate 1.0
Format Format 1280 720 1
Surface Attribute "cull" "hidden" [0]
Surface Attribute "cull" "backfacing" [0]
Surface Attribute "dice" "rasterorient" [0]
Surface Surface "ptc_write"
Display Display "temp.tiff" "file" "rgba"
here is the command line to use mcjRIBCook and the opts file optsPCld.txt to process the file noowone.rib and produce the file noowonePtc.rib
mcjRibCook noowone.rib noowonePtc.rib optsPCld.txt
if you render the resulting file noowonePtc.rib it will "bake" a "points cloud" as explained here:
http://www.3delight.com/en/uploads/docs/3delight/3delight_43.html
the "points cloud" file can be enormous, a scene with 400000 polygons, rendered with shadingrate 1.0 can me 250 MB
Using a shadingrate like 20 produces much smaller point cloud files much faster
here is another opts file, the filename is optsPOcc.txt. ( also part of the mcjRIBCook package )
changes all the surface shader names to "ptc_occlusion"
changes the shaders search path from whatever it is, to the path of the rib file
changes the shading rate to 1.0
changes the Format to 1280x720x1
changes the output image name to TestOcc.tiff
Option "searchpath" "string shader" Option "searchpath" "string shader" [ "&:.:${RIBDIR}" ]
ShadingRate ShadingRate 1.0
Format Format 1280 720 1
Surface Surface "ptc_occlusion"
Display Display "TestOcc.tiff" "file" "rgba"
here is the command line to use mcjRIBCook and the opts file optsPOcc.txt to process the file noowone.rib and produce the file noowoneOcc.rib
mcjRibCook noowone.rib noowoneOcc.rib optsPOcc.txt
noowoneOcc.rib will render the scene using "point-based occlusion as explained here:
I also provide the shader ptc_occlusion_tinted.sl which combines the occlusion darkness with the diffuse color of each surface
the opts file optsPOccTinted.txt is exactly like the previous one except that is subtitutes the surface shaders for "ptc_occlusion_tinted" and the output image is "TestOccTinted.tiff"
so you use it with:
mcjRibCook noowone.rib noowoneOccTinted.rib optsPOccTinted.txt
note that if the image is too dark, sometimes setting "clamp", 1, in the shader (then recompiling it ) may help.
if an object in the scene has faulty normals (the object is defined inside out) then changing the "hitsides" parameter of the shader to "both" can resolve the problem, possible values are "front", back", "both".
/* A simple surface shader to compute occlusion (a.k.a geometric
exposure) using a point cloud file */
surface ptc_occlusion_tinted(
string ptc_file = "default.ptc";
float bias = 0.01; )
{
normal Nf = faceforward( normalize(N), I );
Ci = Cs - occlusion( P, Nf,
"filename", ptc_file,
"pointbased", 1,
"bias", 1,
"clamp", 1,
"hitsides", "front" );
}