RSL NODE – bake out texture

Its been available for ages but I finally got around to looking at what the RSL node does (find it under the general utilities in the maya nodes). With this you can quickly code up shaders built in Maya with the required RSL code – Here is an example where the RSL node enables the output of a .bake file.

Turn off Cull Hidden Surfaces, Cull Backfacing Surfaces and Dice Raster Orient while baking

Shading parameters

string bake_file = “”
color i_color
output color o_color

Shading code

extern point P;
extern normal N;
normal Nf = normalize(N);
bake ( bake_file, s, t, i_color);

Bake out command line
tdlmake -bakeres 640(or whatever texture size you want) C:\texture.bake C:\texture.tdl

Put created TDL in shader
string texturename = “”; )
color Ct;
Ct = ( texturename != “” ) ?
texture( texturename) : 1.0;
Oi = Os;
Ci = Ct;
Ci *= Oi;

Leave a Reply

Your email address will not be published. Required fields are marked *