DeepRaster

From Odwiki

Jump to: navigation, search

Not to be confused with a DeepShadow map, a deep raster is an image which contains more than simple color/depth data. For example, a single deep raster may contain color information along with surface normals, shading position, opacity information and arbitrary other data.

This term is often synonymous with the RenderMan term, "Arbitrary Output Variables" (AOVs for short.)

Using DeepRasters

During rendering, much data is processed by the shaders and ultimately an output Color (Cf) and Opacity (Of) is produced per ShadingSample. In the renderer's final phase, these color/opacity ShadingSamples are composited together to produce a 2D raster image with color and Alpha information. These outputs are evident if you look in VOPs shading contexts at the form of the OutputVOP.

It is possible to instruct the renderer to store the result of any of these shader calculations in custom named variables and to output this data into an additional raster - either into the same file as the primary color and alpha as an additional raster plane (if the FileFormat of the output image can handle it: as a "Deep Raster") or into completely seperate files. The names of the variables and the names of the destination image files are wholly up to the user to specify.

A custom shader can contain any number of temporary variables - a shader can be many thousands of operations utilizing thousands of variables, and so the overhead in trying to store all this information for all of the millions of ShaderSamples would be way too much for the renderer to be efficient and store for potential output, hence the need for the user to specify exactly which information is useful to him. Note: if you're building your shaders in VOPs all of the variable names are chosen by the VOPs building mechanism and so are very likely not sensible to the user.

In VOPs, specifying the output variable is handled by the ParameterVOP with the "Export Parameter" toggle enabled. This is true for both VEX and RSL shaders.

Also, each shader operates on a minimal set of required data regardless of what end result the shader is producing, and this information is always available for output by the renderer. Examples of these variables are the SurfaceNormal (N), SurfacePosition (P), parametric positions s & t, etc.

Mantra

In Mantra when using VEX code directly this entails the use of the "export" keyword. In VOPs, the ParameterVOP sports a toggle to output the variable as an export variable.

It's worth noting that export variables are not solely for the purpose of writing into Deep Rasters; they are also used for displacment and light exports (see VEX limport() and dimport()).

Other Renderers

This entire mechanism is virtually identical for PrMan as it is for Mantra, and most likely for other renderers which adhere to the RenderMan specification.

© 2009 od[force].net | advertise