Tessellation and Rendering

Tessellation is the operation that turns the defined scene into a renderable representation containing triangles, ready for rendering. The actual render process that creates images or other representations of the triangles is outside the scope of API. The caller of API is free to let every type of renderer use the data created here: ray tracers, scene viewers, wireframe viewers, etc.

mi_api_render
miBoolean mi_api_render(
    char            *group_name,    /* root group */
    char            *c_inst_name,   /* camera */
    char            *option_name,   /* options */
    char            *inh_name)      /* inher function */

After the scene has been set up, it can be prepared for rendering. This can be done implicitly using frame calls (see above), but the recommended method uses direct render calls. The name of the root instgroup, the name of the camera instance to use (which must also be added to the root group explicitly), the options element name, and an optional inheritance or traversal function name must be given. The inheritance/traversal function is not a shader, has no custom parameters and is not declared. It is sufficient if it exists under the given name in one of the libraries linked with the LINK module. mi_api_render does not start rendering itself but only does some checks, prepares API for rendering and returns to the caller.

mi_api_render_params
miBoolean mi_api_render_params(
    miTag           *root_group,
    miTag           *camera_inst,
    miTag           *camera,
    miTag           *options,
    miInh_func      *inheritance_func)

Give access to the render parameters. This function can be called after a successful mi_api_render. The function using these parameters typically calls mi_rc_run next. The inh_is_traversal field in the options determines whether inheritance_func is an inheritance function or a traversal function.

mi_api_render_release
miBoolean mi_api_render_release(void)

After rendering has completed, this function must be called to clean up initializations performed by mi_api_render_params. Tessellation and Rendering is normally bracketed by mi_api_render_params and mi_api_render_release. Despite its name mi_api_render is not itself involved in rendering in any way, it just records the names of the root group, camera, camera instance, and options; basically it implements the render statement in the .mi language. The reason for this split is to return control to the calling application when a render statement is encountered. The application may want to draw a wireframe on the display, echo to a file, translate to another format, but not actually render anything.

Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.