mip_binaryproxy
 
 
 

Category: mental ray > Geometry

Shader Family: Geometry

Output: Custom

This shader provides a very fast way to load goemetry on demand. Its main goal is performance, since it skips over any form of translation or parsing by writing directly to a binary file format which can be pulled directly into RAM at render time. There are other methods in mental ray to load geometry on demand (assemblies, file objects, geometry shaders, etc.), but they generally involve parsing or translation steps that can impact performance.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

object_filename

The file name to read (or write). By convention, the file extension is .mib for mental images binary.

write_geometry

The shader has a read mode and a write mode:

  • When write_geometry is on (write mode) and the geometry parameter points to an instance of an existing scene object, this object is written to the .mib file defined by object_filename.

  • When write_geometry is off (read mode), the geometry parameter is ignored (not used). Instead, the shader creates a mental ray placeholder object which contains a callback that loads the actual geometry from the file on demand. This generally happens when a ray hits the object's bounding box, although mental ray may load it for other reasons at other times.

geometry

An object to be written (by write_geometry) to the .mib file defined by object_filename.

meter_scale

Allows the object to be interpreted in a way that is independent of units. If this value is 0.0, the parameter is not used.

When used, the value should be the number of scene units that represent one meter; for example, if scene units are millimeters, this value would be 1000.

  • When writing (write_geometry is on), this value is simply stored as meta data in the .mib file.

  • When reading (write_geometry is off), the object is scaled by the ratio of the value stored in the file, and the value passed at read time to account for the difference in units, if any.

flags

A bit flag with each bit having a specific meaning. This parameter is used for algorithm control, and should remain at 0 in most cases.

Currently used values are:

  • [1] Forces the use of assemblies rather than placeholders. These are two slightly different techniques that mental ray uses to load objects on demand. See mi Archives and Stand-ins [Rendering] and About Geometry Shaders [Materials and Shaders] for more information. Note that assemblies work only with BSP2 acceleration, and that multiple instances of the same assembly cannot have different materials or object flags applied. This limitation does not exist for placeholders.

  • [2] Auto-assemblies mode. The shader uses assemblies if BSP2 acceleration is used, and placeholders if it's not used.

  • [4] Does not tessellate the object before writing it. The object is written in its raw format. The object must already be a mental ray primlist (miBox) for this to work. When this bit is set, displacement is not baked to the file. When it is not set (the default), displacement is baked.

    Note that when baking displacement, a view-dependent approximation cannot be used. This is because there is no view set up at the time when this shader executes, so the resulting tessellation will turn out poorly.

All other bits should be kept zero, since they may become meaningful in future versions.