MayaMan Help Contents

# PRMan 12

PRMan12 new baking mechanisms have been integrated into MayaMan in a variety of ways. To run prman12 in a baking mode select a 'bake' variant of the renderer from the Renderers pulldown menu in the basic options panel.

### 2D Baking

Using the baking controls in a MayaManMaterialAttributes node will allow you to create 2d baked maps which are then useful for accelerating subsequent renders or for export to game engines, etc. See the BakeAir documentation for details.

### 3D Baking

The global illumination values can be baked into a brickmap with the following changes.

#### During the bake phase the following should be observed

The 'Save File' should be the name of the pointcloud file to generate... using local storage is wise (ie: a file in the temp directory).

The 'Seed File' should be the name of the brickmap file to generate... generally this should be stored with the ribs.

If the 'Seed File' option is blank then no brickmap file is produced and the pointcloud file is kept otherwise the pointcloud is removed. Keeping the file can be handy if you want to combine several point clouds into one brickmap... ie: leave seed file blank and create a save file with a #f in the name... then configure a camera to look at the scene from several angles and render the sequence. The pointclouds left behind can be combined with prman's brickmake program.

#### During the render phase the following should be observed

The 'Seed File' should be the name of the brickmap file created in during the bake phase.

### Sub Surface Scattering

To create sub-surface scattering effects with PRMan12 you must add a material attributes node to the material(s) that will exhibit this effect and fill in the parameters. This is a two-pass effect, first render with the "Generate Cache" flag turned on to create a file that captures the radiance of the objects into a point cloud file whose name is derived from the group name. This point cloud is then further processed with prman's ptfilter and brickmake programs. When the "Generate Cache" flag is turned off the cached data is used to add subsurface illumination to the render.

## Baking Arbitrary Data And Copying It To The Vertex Color Of A Mesh

It may be useful to bake some data out and store it back as vertex color information on the mesh. To facilitate this the 'RemodelFromPointCloud' command (normally only used internally by the displacement baker) now has 2 new flags.

-lc "foo.ptc" | returns a string array of the data types and channel names contained in foo.ptc
-vc "foo.ptc" "chan" tol | copies the data indicated by 'chan' from the foo.ptc into the vertex color channel of the currently selected mesh, only samples in the point cloud that are within 'tol' of the vertex will be blended into the average for the vertex. if the 'tol' value is < 0 then it's absolute value is used as the search distance and only the best sample is assigned to the vertex, if 'tol' > 0 then the average of all samples in the search radius is used

For example, assign a material like the following to an object: `

        surface prman_lambert_bake(string ptc_file = "";)
        {
          normal NN = normalize(N);
          Ci = Cs * (ambient() + diffuse(NN));
          Oi = 1;
          bake3d(ptc_file, "_area,_radiance_t", P, N, "coordsystem", "world", "interpolate", 0,
                 "_area", area(P,"dicing"), "_radiance_t", Ci);
        }

` And do a render. This will create a pointcloud that contains the basic illumination information for the object.

Now copy the _radiance_t data to the vertex color channel of the selected mesh: ``

        MayaManRemodelFromPointCloud -vc "c:/temp/foo.ptc" "_radiance_t" 0.1

And to visualize the result, attach the basic prman 'constant' shader to the object and render, the resulting object should contain a fair amount of illum detail (determined by mesh resolution).

Note, you can put more than one object into the point cloud. The geo that you apply the point cloud to doesn't have to be the same as the bake geo, ie: You can bake on low rez geo and then uprez the geo before applying the point cloud so that detail is retained.

MayaMan Help Contents